diff options
author | dec05eba <dec05eba@protonmail.com> | 2025-01-04 03:35:46 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2025-01-04 03:35:46 +0100 |
commit | f379b87b33282a7d583ce5e57be684a718f6a68d (patch) | |
tree | ae902e73e7391dc9e292f49a68be11bbb52c3e65 /src/gui | |
parent | 2ddb9980e1822cf6ad9f335d0d6af7ca3c17b2bc (diff) |
Flatpak: disable hotkey section
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/GlobalSettingsPage.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gui/GlobalSettingsPage.cpp b/src/gui/GlobalSettingsPage.cpp index 5153981..7b7bea5 100644 --- a/src/gui/GlobalSettingsPage.cpp +++ b/src/gui/GlobalSettingsPage.cpp @@ -137,13 +137,15 @@ namespace gsr { } void GlobalSettingsPage::add_widgets() { + const bool inside_flatpak = getenv("FLATPAK_ID") != NULL; auto scrollable_page = std::make_unique<ScrollablePage>(content_page_ptr->get_inner_size()); auto settings_list = std::make_unique<List>(List::Orientation::VERTICAL); settings_list->set_spacing(0.018f); settings_list->add_widget(create_appearance_subsection(scrollable_page.get())); settings_list->add_widget(create_startup_subsection(scrollable_page.get())); - settings_list->add_widget(create_hotkey_subsection(scrollable_page.get())); + if(!inside_flatpak) + settings_list->add_widget(create_hotkey_subsection(scrollable_page.get())); settings_list->add_widget(create_application_options_subsection(scrollable_page.get())); scrollable_page->add_widget(std::move(settings_list)); @@ -165,12 +167,14 @@ namespace gsr { const int exit_status = exec_program_on_host_get_stdout(args, stdout_str); startup_radio_button_ptr->set_selected_item(exit_status == 0 ? "start_on_system_startup" : "dont_start_on_system_startup", false, false); - enable_hotkeys_radio_button_ptr->set_selected_item(config.main_config.enable_hotkeys ? "enable_hotkeys" : "disable_hotkeys", false, false); + if(enable_hotkeys_radio_button_ptr) + enable_hotkeys_radio_button_ptr->set_selected_item(config.main_config.enable_hotkeys ? "enable_hotkeys" : "disable_hotkeys", false, false); } void GlobalSettingsPage::save() { config.main_config.tint_color = tint_color_radio_button_ptr->get_selected_id(); - config.main_config.enable_hotkeys = enable_hotkeys_radio_button_ptr->get_selected_id() == "enable_hotkeys"; + if(enable_hotkeys_radio_button_ptr) + config.main_config.enable_hotkeys = enable_hotkeys_radio_button_ptr->get_selected_id() == "enable_hotkeys"; save_config(config); } }
\ No newline at end of file |