combobox support
This commit is contained in:
parent
0051b9011b
commit
f30f9c8404
2 changed files with 24 additions and 16 deletions
4
build.sh
4
build.sh
|
@ -1,2 +1,2 @@
|
|||
nuitka3 ./src/main.py --linux-onefile-icon=./data/icon.png --onefile --output-dir=./build --run
|
||||
#--disable-console --linux-icon=./data/icon.png --output-dir=./build --clean-cache=all #--include-plugin-directory=./src/ --run --disable-console --linux-icon=./data/icon.png --output-dir=./build #--clean-cache=all --recompile-c-only #--windows-icon-from-ico=./data/icon.ico --disable-console --linux-icon=./data/icon.png --onefile --output-dir=./build
|
||||
nuitka3 ./src/main.py --onefile --output-dir=./build --run
|
||||
#--disable-console --output-dir=./build --clean-cache=all #--include-plugin-directory=./src/ --run --disable-console --linux-icon=./data/icon.png --output-dir=./build #--clean-cache=all --recompile-c-only
|
|
@ -48,15 +48,20 @@ def run_installer(download_folder_tmp, col_isDark):
|
|||
for widget in visible_widgets:
|
||||
widget.pack_forget()
|
||||
|
||||
# Create widgets for current tab
|
||||
# Create widgets for the current tab
|
||||
current_tab = tab_combobox.get()
|
||||
widget_specs = tabs.get(current_tab, [])
|
||||
|
||||
widgets = []
|
||||
for spec in widget_specs:
|
||||
spacing_top = 10 # Adjust the spacing as needed
|
||||
|
||||
for index, spec in enumerate(widget_specs):
|
||||
widget = create_widget(spec, container)
|
||||
if widget:
|
||||
widget.pack(pady=20, padx=20)
|
||||
if index == 0: # Add spacing from the top only for the first widget
|
||||
widget.pack(pady=spacing_top, padx=20)
|
||||
else:
|
||||
widget.pack(pady=spacing_top, padx=20)
|
||||
widgets.append(widget)
|
||||
|
||||
return widgets
|
||||
|
@ -71,6 +76,10 @@ def run_installer(download_folder_tmp, col_isDark):
|
|||
elif widget_class == CTkProgressBar:
|
||||
progress_bar = CTkProgressBar(master=master, **widget_args)
|
||||
return progress_bar
|
||||
elif widget_class == CTkComboBox:
|
||||
# Remove the 'text' argument if it exists
|
||||
widget_args.pop('text', None)
|
||||
return CTkComboBox(master=master, **widget_args)
|
||||
else:
|
||||
return spec(master=master)
|
||||
|
||||
|
@ -105,17 +114,16 @@ def run_installer(download_folder_tmp, col_isDark):
|
|||
tab_combobox.set(list(tabs.keys())[previous_tab_index])
|
||||
visible_widgets = create_widgets_for_current_tab()
|
||||
|
||||
def switch_to_install_tab():
|
||||
switch_to_tab("Tab3")
|
||||
|
||||
tabs = {
|
||||
"Tab1": [
|
||||
(CTkButton, {"text": "Next Tab", "command": switch_to_next_tab}),
|
||||
(CTkButton, {"text": "Previous Tab", "command": switch_to_previous_tab}),
|
||||
(CTkButton, {"text": "Get Browser package", "command": get_default_packages}),
|
||||
(CTkComboBox, {"text": "Language", "values": ["London", "Britan", "New York"]}),
|
||||
(CTkComboBox, {"text": "Theme", "values": ["System", "Light", "Dark"]}),
|
||||
CTkEntry,
|
||||
CTkProgressBar,
|
||||
CTkRadioButton,
|
||||
CTkSlider,
|
||||
CTkSwitch
|
||||
(CTkCheckBox, {"text": f"Force {'Dark' if col_isDark else 'Light'} on every website"}),
|
||||
(CTkButton, {"text": "Install", "command": switch_to_install_tab}),
|
||||
(CTkButton, {"text": "Customise", "command": switch_to_next_tab}),
|
||||
],
|
||||
"Tab2": [
|
||||
(CTkButton, {"text": "Next Tab", "command": switch_to_next_tab}),
|
||||
|
|
Reference in a new issue