From 71a437b512e0156ceae4532fb896c49f05da5954 Mon Sep 17 00:00:00 2001 From: thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> Date: Tue, 16 Aug 2022 08:08:30 -0400 Subject: [PATCH] DisplaySettings: Update Workspaces tab GML Removes some verbiage and arranges things consistent with other settings dialogs. Ideally we shouldn't litter UIs with shortcuts, tips, tricks, self-evident or redundant descriptions, etc, so this can be refined again in the future once there's an official way to expose/ customize keyboard shortcuts. --- .../DisplaySettings/DesktopSettings.gml | 94 +++++++++---------- .../DisplaySettings/DesktopSettingsWidget.cpp | 3 + 2 files changed, 48 insertions(+), 49 deletions(-) diff --git a/Userland/Applications/DisplaySettings/DesktopSettings.gml b/Userland/Applications/DisplaySettings/DesktopSettings.gml index 2704145466..ce5266da5e 100644 --- a/Userland/Applications/DisplaySettings/DesktopSettings.gml +++ b/Userland/Applications/DisplaySettings/DesktopSettings.gml @@ -5,69 +5,65 @@ } @GUI::GroupBox { - layout: @GUI::VerticalBoxLayout { - margins: [14, 14, 4] - } - title: "Workspaces" - shrink_to_fit: true - - @GUI::Widget { - fixed_height: 32 - layout: @GUI::HorizontalBoxLayout { - margins: [6] - } - - @GUI::Label { - text: "Rows:" - text_alignment: "CenterRight" - } - - @GUI::SpinBox { - name: "workspace_rows_spinbox" - min: 1 - max: 16 - orientation: "Horizontal" - } - - @GUI::Label { - text: "Columns:" - text_alignment: "CenterRight" - } - - @GUI::SpinBox { - name: "workspace_columns_spinbox" - min: 1 - max: 16 - orientation: "Horizontal" - } + title: "Layout" + preferred_height: "shrink" + layout: @GUI::HorizontalBoxLayout { + margins: [8] + spacing: 2 } @GUI::Widget { - fixed_height: 76 - layout: @GUI::HorizontalBoxLayout {} + fixed_width: 32 + layout: @GUI::VerticalBoxLayout {} - @GUI::Label { - fixed_height: 32 - fixed_width: 32 - icon: "/res/icons/32x32/app-welcome.png" + @GUI::ImageWidget { + bitmap: "/res/icons/32x32/workspaces.png" + } + + @GUI::Layout::Spacer {} + } + + @GUI::Widget { + layout: @GUI::VerticalBoxLayout { + margins: [4, 0, 0, 16] + spacing: 10 } @GUI::Widget { - layout: @GUI::VerticalBoxLayout { - margins: [6] + layout: @GUI::HorizontalBoxLayout { + spacing: 8 } @GUI::Label { - text: "Use the Ctrl+Alt+Arrow hotkeys to move between workspaces." - text_alignment: "TopLeft" - word_wrap: true + text: "Rows:" + autosize: true + } + + @GUI::SpinBox { + name: "workspace_rows_spinbox" + min: 1 + max: 16 + } + + @GUI::Widget { + fixed_width: 8 } @GUI::Label { - text: "Use the Ctrl+Shift+Alt+Arrow hotkeys to move between\nworkspaces and move the active window." - text_alignment: "TopLeft" - word_wrap: true + text: "Columns:" + autosize: true } + + @GUI::SpinBox { + name: "workspace_columns_spinbox" + min: 1 + max: 16 + } + } + + @GUI::Label { + name: "keyboard_shortcuts_label" + text_alignment: "CenterLeft" } } } diff --git a/Userland/Applications/DisplaySettings/DesktopSettingsWidget.cpp b/Userland/Applications/DisplaySettings/DesktopSettingsWidget.cpp index 2c2901ffff..e72a9f8685 100644 --- a/Userland/Applications/DisplaySettings/DesktopSettingsWidget.cpp +++ b/Userland/Applications/DisplaySettings/DesktopSettingsWidget.cpp @@ -33,6 +33,9 @@ void DesktopSettingsWidget::create_frame() m_workspace_columns_spinbox->on_change = [&](auto) { set_modified(true); }; + + auto& keyboard_shortcuts_label = *find_descendant_of_type_named("keyboard_shortcuts_label"); + keyboard_shortcuts_label.set_text("\xE2\x84\xB9\tCtrl+Alt+{Shift}+Arrows moves between workspaces"); } void DesktopSettingsWidget::load_current_settings()