166 @brief Update icons to change between light and dark items depend on theme state.
169 config_btn(self.
ui.btn_lock, icon=ICON_LOCK_LIGHT
if b_light_theme
else ICON_LOCK_DARK)
170 config_menu(self.
ui.action_show_interim, icon=ICON_STATUS_LIGHT
if b_light_theme
else ICON_STATUS_DARK)
171 config_menu(self.
ui.action_open_folder, icon=ICON_OPEN_FOLDER_LIGHT
if b_light_theme
else ICON_OPEN_FOLDER_DARK)
172 config_menu(self.
ui.menu_combine_report, icon=ICON_COMBINE_LIGHT
if b_light_theme
else ICON_COMBINE_DARK)
173 config_menu(self.
ui.action_print_file, icon=ICON_PRINT_FILE_LIGHT
if b_light_theme
else ICON_PRINT_FILE_DARK)
174 config_menu(self.
ui.action_create_billing, icon=ICON_REPORT_LIGHT
if b_light_theme
else ICON_REPORT_DARK)
175 config_menu(self.
ui.action_article_preview, icon=ICON_PRINT_PREVIEW_LIGHT
if b_light_theme
else ICON_PRINT_PREVIEW_DARK)
176 config_menu(self.
ui.menu_user, icon=ICON_USER_LIGHT
if b_light_theme
else ICON_USER_DARK)
177 config_menu(self.
ui.action_user_edit, icon=ICON_USER_EDIT_LIGHT
if b_light_theme
else ICON_USER_EDIT_DARK)
178 config_menu(self.
ui.action_user_import, icon=ICON_USER_IMPORT_LIGHT
if b_light_theme
else ICON_USER_IMPORT_DARK)
179 config_menu(self.
ui.action_user_export, icon=ICON_USER_EXPORT_LIGHT
if b_light_theme
else ICON_USER_EXPORT_DARK)
180 config_menu(self.
ui.action_user_new, icon=ICON_USER_RESET_LIGHT
if b_light_theme
else ICON_USER_RESET_DARK)
181 config_menu(self.
ui.menu_articles, icon=ICON_ARTICLES_LIGHT
if b_light_theme
else ICON_ARTICLES_DARK)
182 config_menu(self.
ui.action_articles_edit, icon=ICON_ARTICLES_EDIT_LIGHT
if b_light_theme
else ICON_ARTICLES_EDIT_DARK)
183 config_menu(self.
ui.action_articles_import, icon=ICON_ARTICLES_IMPORT_LIGHT
if b_light_theme
else ICON_ARTICLES_IMPORT_DARK)
184 config_menu(self.
ui.action_articles_export, icon=ICON_ARTICLES_EXPORT_LIGHT
if b_light_theme
else ICON_ARTICLES_EXPORT_DARK)
185 config_menu(self.
ui.action_articles_new, icon=ICON_ARTICLES_RESET_LIGHT
if b_light_theme
else ICON_ARTICLES_RESET_DARK)
186 config_menu(self.
ui.action_change_path, icon=ICON_CHANGE_FOLDER_LIGHT
if b_light_theme
else ICON_CHANGE_FOLDER_DARK)
187 config_menu(self.
ui.menu_com_port, icon=ICON_PRINTER_LIGHT
if b_light_theme
else ICON_PRINTER_DARK)
188 config_menu(self.
ui.menu_paper_width, icon=ICON_PAPER_LIGHT
if b_light_theme
else ICON_PAPER_DARK)
189 config_menu(self.
ui.menu_style, icon=ICON_THEME_LIGHT
if b_light_theme
else ICON_THEME_DARK)
190 config_menu(self.
ui.menu_language, icon=ICON_LANGUAGE_LIGHT
if b_light_theme
else ICON_LANGUAGE_DARK)
192 config_menu(self.
ui.action_english, icon=ICON_LANGUAGE_ENGLISH)
193 config_menu(self.
ui.action_german, icon=ICON_LANGUAGE_GERMAN)
194 config_menu(self.
ui.menu_log_verbosity, icon=ICON_LOG_LIGHT
if b_light_theme
else ICON_LOG_DARK)
195 config_menu(self.
ui.action_help, icon=ICON_HELP_LIGHT
if b_light_theme
else ICON_HELP_DARK)
196 config_menu(self.
ui.action_about_app, icon=ICON_APP)
197 config_menu(self.
ui.action_reset, icon=ICON_RESET_LIGHT
if b_light_theme
else ICON_RESET_DARK)
225 @brief set position and size of items
226 @param b_update_only_total_font : status if update only text font size
228 i_actual_width, i_actual_height = get_window_size(self.
ui)
230 if (i_actual_width >= I_DEFAULT_WIN_WIDTH)
and (i_actual_height >= I_DEFAULT_WIN_HEIGHT):
231 if self.
ui.model.c_auth.get_article_view_state():
232 item_number_size = self.
ui.model.c_config.item_number_size
234 item_number_size = ItemNumber.MIN
235 ext_factor = ITEM_NUMBER_COLUMN_MIN / D_ITEM_NUMBER_COLUMN[item_number_size]
236 x_scale_factor = i_actual_width / I_DEFAULT_WIN_WIDTH
237 y_scale_factor = i_actual_height / I_DEFAULT_WIN_HEIGHT
238 self.
table_font = self.
get_font(
"table", x_scale_factor=x_scale_factor, y_scale_factor=y_scale_factor)
240 if b_update_only_total_font:
241 config_text(self.
ui.text_total, font=self.
get_font(
"total", ext_factor=ext_factor, x_scale_factor=x_scale_factor, y_scale_factor=y_scale_factor))
244 i_btn_row_cnt = D_ITEM_NUMBER_ROW[item_number_size]
245 table_width = (1 / 3) * i_actual_width
246 total_button_width = i_actual_width - table_width
247 x_single_button = int(total_button_width / i_btn_row_cnt)
250 i_btn_column_cnt = D_ITEM_NUMBER_COLUMN[item_number_size]
251 total_button_high = i_actual_height - 85
252 y_single_button = int(total_button_high / (i_btn_column_cnt + 1))
253 y_order_gap = total_button_high - (y_single_button * (i_btn_column_cnt + 1))
257 for i, btn
in enumerate(self.
ui.l_bnt_fnc):
258 if i < item_number_size:
260 if (i % i_btn_column_cnt) == 0:
262 i_column_idx = i % i_btn_column_cnt
263 x_pos = i_row_idx * x_single_button
264 y_pos = total_button_high - ((i_column_idx * y_single_button) + (2 * y_single_button) + y_order_gap)
265 config_btn(btn, size=(x_pos, y_pos, x_single_button, y_single_button),
266 font=self.
get_font(
"articles_button", ext_factor=ext_factor, x_scale_factor=x_scale_factor, y_scale_factor=y_scale_factor))
268 x_table = i_actual_width - (x_single_button * i_btn_row_cnt)
269 y_table = y_single_button * i_btn_column_cnt
270 y_single_button += y_order_gap
271 y_lowest_pos = total_button_high - y_single_button
274 i_icon_size = int(min(D_FONT_SIZE[
"lock_button"] * x_scale_factor, D_FONT_SIZE[
"lock_button"] * y_scale_factor))
275 config_btn(self.
ui.btn_lock, size=(0, y_lowest_pos, x_single_button, y_single_button), icon_size=i_icon_size,
276 icon=ICON_LOCK_LIGHT
if self.
is_light_theme()
else ICON_LOCK_DARK)
278 config_btn(self.
ui.btn_multi, size=(x_single_button, y_lowest_pos, x_single_button, y_single_button),
279 font=self.
get_font(
"multi_button", ext_factor=ext_factor, x_scale_factor=x_scale_factor, y_scale_factor=y_scale_factor))
281 config_btn(self.
ui.btn_calc, size=(2 * x_single_button, y_lowest_pos, x_single_button, y_single_button),
282 font=self.
get_font(
"calc_button", ext_factor=ext_factor, x_scale_factor=x_scale_factor, y_scale_factor=y_scale_factor))
284 i_icon_size = int(min(D_FONT_SIZE[
"ec_button"] * x_scale_factor, D_FONT_SIZE[
"ec_button"] * y_scale_factor))
285 config_btn(self.
ui.btn_clear, size=(3 * x_single_button, y_lowest_pos, x_single_button, y_single_button),
286 font=self.
get_font(
"clear_button", ext_factor=ext_factor, x_scale_factor=x_scale_factor, y_scale_factor=y_scale_factor), icon_size=i_icon_size)
288 x_start_print = i_btn_column_cnt
289 if item_number_size == ItemNumber.MAX:
291 i_print_width_factor = 4
292 elif item_number_size == ItemNumber.EXT:
294 i_print_width_factor = 3
297 i_print_width_factor = 2
298 config_btn(self.
ui.btn_print, size=(x_start_print * x_single_button, y_lowest_pos, i_print_width_factor * x_single_button, y_single_button),
299 font=self.
get_font(
"print_button", ext_factor=ext_factor, x_scale_factor=x_scale_factor, y_scale_factor=y_scale_factor))
301 config_text(self.
ui.text_total, size=((i_btn_column_cnt + 1) * x_single_button, y_lowest_pos, x_table, y_single_button),
302 font=self.
get_font(
"total", ext_factor=ext_factor, x_scale_factor=x_scale_factor, y_scale_factor=y_scale_factor))
304 config_table(self.
ui.table_items, row_description=self.
ui.model.c_language.get_table_row_description(), font=self.
table_font, auto_size=
True,
305 size=((i_btn_column_cnt + 1) * x_single_button, 0, x_table, y_table),
306 min_section_size=int(D_FONT_SIZE[
"table_vertical"] * y_scale_factor))