UI: Tweaks for HotkeySettings

Tweaks a few things:
- Make strings translatable
- Makes the column headers bold for clarity
- Makes the border darker on Linux, like goeiecool suggested.
- Make the column headers have some padding to make it look nicer.
This commit is contained in:
Crementif 2025-07-26 13:11:34 +02:00
parent d99ad42f06
commit 9ea36825fe

View file

@ -89,11 +89,11 @@ std::optional<std::string> SaveScreenshot(std::vector<uint8> data, int width, in
if (SaveScreenshotToClipboard(image)) if (SaveScreenshotToClipboard(image))
{ {
if (!save_screenshot) if (!save_screenshot)
return "Screenshot saved to clipboard"; return _tr("Screenshot saved to clipboard");
} }
else else
{ {
return "Failed to open clipboard"; return _tr("Failed to open clipboard");
} }
} }
if (save_screenshot) if (save_screenshot)
@ -102,11 +102,11 @@ std::optional<std::string> SaveScreenshot(std::vector<uint8> data, int width, in
if (imagePath.has_value() && SaveScreenshotToFile(imagePath.value(), image)) if (imagePath.has_value() && SaveScreenshotToFile(imagePath.value(), image))
{ {
if (mainWindow) if (mainWindow)
return "Screenshot saved"; return _tr("Screenshot saved");
} }
else else
{ {
return "Failed to save screenshot to file"; return _tr("Failed to save screenshot to file");
} }
} }
return std::nullopt; return std::nullopt;
@ -140,7 +140,7 @@ HotkeySettings::HotkeySettings(wxWindow* parent)
m_sizer->AddGrowableCol(1); m_sizer->AddGrowableCol(1);
m_sizer->AddGrowableCol(2); m_sizer->AddGrowableCol(2);
m_panel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_SIMPLE); m_panel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_THEME);
m_panel->SetSizer(m_sizer); m_panel->SetSizer(m_sizer);
Center(); Center();
@ -150,13 +150,13 @@ HotkeySettings::HotkeySettings(wxWindow* parent)
CreateColumnHeaders(); CreateColumnHeaders();
/* global modifier */ /* global modifier */
CreateHotkeyRow("Hotkey modifier", s_cfgHotkeys.modifiers); CreateHotkeyRow(_tr("Hotkey modifier"), s_cfgHotkeys.modifiers);
m_hotkeys.at(0).keyInput->Hide(); m_hotkeys.at(0).keyInput->Hide();
/* hotkeys */ /* hotkeys */
CreateHotkeyRow("Toggle fullscreen", s_cfgHotkeys.toggleFullscreen); CreateHotkeyRow(_tr("Toggle fullscreen"), s_cfgHotkeys.toggleFullscreen);
CreateHotkeyRow("Take screenshot", s_cfgHotkeys.takeScreenshot); CreateHotkeyRow(_tr("Take screenshot"), s_cfgHotkeys.takeScreenshot);
CreateHotkeyRow("Toggle fast-forward", s_cfgHotkeys.toggleFastForward); CreateHotkeyRow(_tr("Toggle fast-forward"), s_cfgHotkeys.toggleFastForward);
m_controllerTimer = new wxTimer(this); m_controllerTimer = new wxTimer(this);
Bind(wxEVT_TIMER, &HotkeySettings::OnControllerTimer, this); Bind(wxEVT_TIMER, &HotkeySettings::OnControllerTimer, this);
@ -214,13 +214,15 @@ void HotkeySettings::Init(MainWindow* mainWindowFrame)
void HotkeySettings::CreateColumnHeaders(void) void HotkeySettings::CreateColumnHeaders(void)
{ {
auto* emptySpace = new wxStaticText(m_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL); auto* emptySpace = new wxStaticText(m_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL);
auto* keyboard = new wxStaticText(m_panel, wxID_ANY, "Keyboard", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL); auto* keyboard = new wxStaticText(m_panel, wxID_ANY, _tr("Keyboard"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL);
auto* controller = new wxStaticText(m_panel, wxID_ANY, "Controller", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL); auto* controller = new wxStaticText(m_panel, wxID_ANY, _tr("Controller"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL);
keyboard->SetFont(keyboard->GetFont().Bold().Larger());
controller->SetFont(controller->GetFont().Bold().Larger());
keyboard->SetMinSize(m_minButtonSize); keyboard->SetMinSize(m_minButtonSize);
controller->SetMinSize(m_minButtonSize); controller->SetMinSize(m_minButtonSize);
auto flags = wxSizerFlags().Expand(); auto flags = wxSizerFlags().Expand().Border(wxTOP, 10);
m_sizer->Add(emptySpace, flags); m_sizer->Add(emptySpace, flags);
m_sizer->Add(keyboard, flags); m_sizer->Add(keyboard, flags);
m_sizer->Add(controller, flags); m_sizer->Add(controller, flags);