aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2025-01-04 03:35:46 +0100
committerdec05eba <dec05eba@protonmail.com>2025-01-04 03:35:46 +0100
commitf379b87b33282a7d583ce5e57be684a718f6a68d (patch)
treeae902e73e7391dc9e292f49a68be11bbb52c3e65 /src
parent2ddb9980e1822cf6ad9f335d0d6af7ca3c17b2bc (diff)
Flatpak: disable hotkey section
Diffstat (limited to 'src')
-rw-r--r--src/gui/GlobalSettingsPage.cpp10
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