Fix incorrect action text in hotkey configuration

This commit is contained in:
dec05eba
2025-01-24 11:18:27 +01:00
parent c396a1f922
commit aed169aa40
4 changed files with 28 additions and 4 deletions

View File

@@ -92,5 +92,6 @@ namespace gsr {
ConfigureHotkeyType configure_hotkey_type = ConfigureHotkeyType::NONE; ConfigureHotkeyType configure_hotkey_type = ConfigureHotkeyType::NONE;
CustomRendererWidget *hotkey_overlay_ptr = nullptr; CustomRendererWidget *hotkey_overlay_ptr = nullptr;
std::string hotkey_configure_action_name;
}; };
} }

View File

@@ -1,4 +1,4 @@
project('gsr-ui', ['c', 'cpp'], version : '1.1.1', default_options : ['warning_level=2', 'cpp_std=c++17'], subproject_dir : 'depends') project('gsr-ui', ['c', 'cpp'], version : '1.1.2', default_options : ['warning_level=2', 'cpp_std=c++17'], subproject_dir : 'depends')
if get_option('buildtype') == 'debug' if get_option('buildtype') == 'debug'
add_project_arguments('-g3', language : ['c', 'cpp']) add_project_arguments('-g3', language : ['c', 'cpp'])

View File

@@ -1,7 +1,7 @@
[package] [package]
name = "gsr-ui" name = "gsr-ui"
type = "executable" type = "executable"
version = "1.1.1" version = "1.1.2"
platforms = ["posix"] platforms = ["posix"]
[lang.cpp] [lang.cpp]

View File

@@ -132,7 +132,7 @@ namespace gsr {
if(!configure_hotkey_button) if(!configure_hotkey_button)
return; return;
mgl::Text title_text("Press a key combination to use for the hotkey \"Start/stop recording\":", get_theme().title_font); mgl::Text title_text("Press a key combination to use for the hotkey \"" + hotkey_configure_action_name + "\":", get_theme().title_font);
mgl::Text hotkey_text(configure_hotkey_button->get_text(), get_theme().top_bar_font); mgl::Text hotkey_text(configure_hotkey_button->get_text(), get_theme().top_bar_font);
mgl::Text description_text("The hotkey has to contain one or more of these keys: Alt, Ctrl, Shift and Super. Press Esc to cancel.", get_theme().body_font); mgl::Text description_text("The hotkey has to contain one or more of these keys: Alt, Ctrl, Shift and Super. Press Esc to cancel.", get_theme().body_font);
const float text_max_width = std::max(title_text.get_bounds().size.x, std::max(hotkey_text.get_bounds().size.x, description_text.get_bounds().size.x)); const float text_max_width = std::max(title_text.get_bounds().size.x, std::max(hotkey_text.get_bounds().size.x, description_text.get_bounds().size.x));
@@ -253,7 +253,6 @@ namespace gsr {
configure_hotkey_start(ConfigureHotkeyType::SHOW_HIDE); configure_hotkey_start(ConfigureHotkeyType::SHOW_HIDE);
}; };
return list; return list;
} }
@@ -581,6 +580,30 @@ namespace gsr {
content_page_ptr->set_visible(false); content_page_ptr->set_visible(false);
hotkey_overlay_ptr->set_visible(true); hotkey_overlay_ptr->set_visible(true);
overlay->unbind_all_keyboard_hotkeys(); overlay->unbind_all_keyboard_hotkeys();
switch(hotkey_type) {
case ConfigureHotkeyType::NONE:
hotkey_configure_action_name = "";
break;
case ConfigureHotkeyType::REPLAY_START_STOP:
hotkey_configure_action_name = "Turn replay on/off";
break;
case ConfigureHotkeyType::REPLAY_SAVE:
hotkey_configure_action_name = "Save replay";
break;
case ConfigureHotkeyType::RECORD_START_STOP:
hotkey_configure_action_name = "Start/stop recording";
break;
case ConfigureHotkeyType::RECORD_PAUSE_UNPAUSE:
hotkey_configure_action_name = "Pause/unpause recording";
break;
case ConfigureHotkeyType::STREAM_START_STOP:
hotkey_configure_action_name = "Start/stop streaming";
break;
case ConfigureHotkeyType::SHOW_HIDE:
hotkey_configure_action_name = "Show/hide UI";
break;
}
} }
void GlobalSettingsPage::configure_hotkey_cancel() { void GlobalSettingsPage::configure_hotkey_cancel() {