From b746afb030fc529dcf31011ebefeea06cec0736a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Thu, 21 Aug 2025 15:35:18 +0200 Subject: [PATCH] Make sure that groups order is consistent accross Blueprint files --- .../account_switcher_button.blp | 10 +-- .../account_switcher_popover.blp | 10 +-- src/components/action_button.blp | 66 +++++++++---------- src/components/avatar/editable.blp | 24 +++---- src/components/media/video_player.blp | 10 +-- src/components/power_level_selection/row.blp | 8 +-- src/components/rows/loading_button_row.blp | 16 ++--- src/components/rows/substring_entry_row.blp | 9 ++- src/components/user_page.blp | 21 +++--- src/error_page.blp | 12 ++-- .../accept_request_page.blp | 8 +-- .../cancelled_page.blp | 8 +-- .../choose_method_page.blp | 8 +-- .../completed_page.blp | 8 +-- .../confirm_qr_code_page.blp | 28 ++++---- .../no_supported_methods_page.blp | 8 +-- .../qr_code_scanned_page.blp | 8 +-- .../room_left_page.blp | 8 +-- src/identity_verification_view/sas_emoji.blp | 4 +- src/identity_verification_view/sas_page.blp | 8 +-- .../scan_qr_code_page.blp | 8 +-- .../wait_for_other_page.blp | 8 +-- src/login/greeter.blp | 14 ++-- src/login/homeserver_page.blp | 18 ++--- src/login/in_browser_page.blp | 14 ++-- src/login/method_page.blp | 12 ++-- src/login/mod.blp | 8 +-- src/login/sso_idp_button.blp | 4 +- 28 files changed, 183 insertions(+), 185 deletions(-) diff --git a/src/account_switcher/account_switcher_button.blp b/src/account_switcher/account_switcher_button.blp index b90c0688..7005abc1 100644 --- a/src/account_switcher/account_switcher_button.blp +++ b/src/account_switcher/account_switcher_button.blp @@ -5,16 +5,16 @@ template $AccountSwitcherButton: Gtk.ToggleButton { tooltip-text: bind template.root as <$Window>.session-selection as <$FixedSelection>.selected-item as <$SessionInfo>.user-id-string; toggled => $toggle_popover() swapped; - accessibility { - description: _("Switch Accounts"); - has-popup: true; - } - styles [ "image-button", "circular", ] + accessibility { + description: _("Switch Accounts"); + has-popup: true; + } + child: $Avatar { size: 24; data: bind template.root as <$Window>.session-selection as <$FixedSelection>.selected-item as <$SessionInfo>.avatar-data; diff --git a/src/account_switcher/account_switcher_popover.blp b/src/account_switcher/account_switcher_popover.blp index a617282f..78d05ddf 100644 --- a/src/account_switcher/account_switcher_popover.blp +++ b/src/account_switcher/account_switcher_popover.blp @@ -19,6 +19,11 @@ template $AccountSwitcherPopover: Gtk.Popover { Gtk.Button { action-name: "win.new-session"; + styles [ + "account-switcher-row", + "flat", + ] + child: Gtk.Box { spacing: 10; @@ -35,11 +40,6 @@ template $AccountSwitcherPopover: Gtk.Popover { label: _("_Add Account"); } }; - - styles [ - "account-switcher-row", - "flat", - ] } } } diff --git a/src/components/action_button.blp b/src/components/action_button.blp index b519354d..e25c746c 100644 --- a/src/components/action_button.blp +++ b/src/components/action_button.blp @@ -9,15 +9,15 @@ template $ActionButton: Adw.Bin { name: "default"; child: Gtk.Button button_default { - styles [ - "circular", - ] - valign: center; icon-name: bind template.icon-name; action-name: bind template.action-name; action-target: bind template.action-target; clicked => $button_clicked() swapped; + + styles [ + "circular", + ] }; } @@ -25,17 +25,17 @@ template $ActionButton: Adw.Bin { name: "confirm"; child: Gtk.Button { - styles [ - "circular", - "suggested-action", - ] - tooltip-text: _("Confirm Change"); valign: center; icon-name: "checkmark-symbolic"; action-name: bind template.action-name; action-target: bind template.action-target; clicked => $button_clicked() swapped; + + styles [ + "circular", + "suggested-action", + ] }; } @@ -43,17 +43,17 @@ template $ActionButton: Adw.Bin { name: "retry"; child: Gtk.Button { - styles [ - "circular", - "suggested-action", - ] - tooltip-text: _("Try Again"); valign: center; icon-name: "refresh-symbolic"; action-name: bind template.action-name; action-target: bind template.action-target; clicked => $button_clicked() swapped; + + styles [ + "circular", + "suggested-action", + ] }; } @@ -62,14 +62,14 @@ template $ActionButton: Adw.Bin { title: _("Loading"); child: Gtk.Button { - styles [ - "circular", - ] - focusable: false; can-target: false; valign: center; + styles [ + "circular", + ] + Adw.Spinner { valign: center; halign: center; @@ -84,16 +84,16 @@ template $ActionButton: Adw.Bin { title: _("Success"); child: Gtk.Button { + focusable: false; + can-target: false; + valign: center; + icon-name: "checkmark-symbolic"; + styles [ "suggested-action", "circular", "success", ] - - focusable: false; - can-target: false; - valign: center; - icon-name: "checkmark-symbolic"; }; } @@ -102,15 +102,15 @@ template $ActionButton: Adw.Bin { title: _("Warning"); child: Gtk.Button button_warning { - styles [ - "circular", - "warning", - ] - focusable: false; can-target: false; valign: center; icon-name: "warning-symbolic"; + + styles [ + "circular", + "warning", + ] }; } @@ -119,15 +119,15 @@ template $ActionButton: Adw.Bin { title: _("Error"); child: Gtk.Button { - styles [ - "circular", - "error", - ] - focusable: false; can-target: false; valign: center; icon-name: "error-symbolic"; + + styles [ + "circular", + "error", + ] }; } } diff --git a/src/components/avatar/editable.blp b/src/components/avatar/editable.blp index fd6933c3..02f6e372 100644 --- a/src/components/avatar/editable.blp +++ b/src/components/avatar/editable.blp @@ -33,17 +33,17 @@ template $EditableAvatar: Adw.Bin { [overlay] Gtk.Image error_img { - styles [ - "osd", - "circular", - ] - visible: false; halign: center; valign: center; icon-name: "error-symbolic"; icon-size: large; + styles [ + "osd", + "circular", + ] + layout { measure: true; } @@ -51,13 +51,13 @@ template $EditableAvatar: Adw.Bin { [overlay] Adw.Bin button_remove_bin { + halign: end; + valign: start; + styles [ "cutout", ] - halign: end; - valign: start; - $ActionButton button_remove { icon-name: "remove-symbolic"; action-name: "editable-avatar.remove-avatar"; @@ -67,14 +67,14 @@ template $EditableAvatar: Adw.Bin { [overlay] Adw.Bin { - styles [ - "cutout", - ] - visible: bind template.editable; halign: end; valign: end; + styles [ + "cutout", + ] + $ActionButton button_edit { icon-name: "edit-symbolic"; action-name: "editable-avatar.edit-avatar"; diff --git a/src/components/media/video_player.blp b/src/components/media/video_player.blp index 2d1fd506..b20c8f14 100644 --- a/src/components/media/video_player.blp +++ b/src/components/media/video_player.blp @@ -13,17 +13,17 @@ template $VideoPlayer: Adw.Bin { [overlay] Gtk.Label timestamp { - styles [ - "osd", - "timestamp", - ] - visible: false; halign: start; valign: start; margin-start: 5; margin-top: 5; + styles [ + "osd", + "timestamp", + ] + layout { measure: true; } diff --git a/src/components/power_level_selection/row.blp b/src/components/power_level_selection/row.blp index 8fb6d2fc..6e967b23 100644 --- a/src/components/power_level_selection/row.blp +++ b/src/components/power_level_selection/row.blp @@ -7,16 +7,16 @@ template $PowerLevelSelectionRow: Adw.PreferencesRow { accessible-role: combo_box; action-name: "power-level-selection-row.popup"; + styles [ + "combo", + ] + accessibility { labelled-by: [ title, ]; } - styles [ - "combo", - ] - child: Gtk.Box header { valign: center; hexpand: false; diff --git a/src/components/rows/loading_button_row.blp b/src/components/rows/loading_button_row.blp index 03c29b80..8cf580dc 100644 --- a/src/components/rows/loading_button_row.blp +++ b/src/components/rows/loading_button_row.blp @@ -6,27 +6,27 @@ template $LoadingButtonRow: Adw.PreferencesRow { selectable: false; accessible-role: button; + styles [ + "button", + ] + accessibility { labelled-by: [ title, ]; } - styles [ - "button", - ] - $LoadingBin loading_bin { child: Gtk.Label title { - styles [ - "title", - ] - label: bind template.title; ellipsize: end; mnemonic-widget: template; xalign: 0.5; justify: center; + + styles [ + "title", + ] }; } } diff --git a/src/components/rows/substring_entry_row.blp b/src/components/rows/substring_entry_row.blp index e60b74c4..a0712e53 100644 --- a/src/components/rows/substring_entry_row.blp +++ b/src/components/rows/substring_entry_row.blp @@ -54,17 +54,16 @@ template $SubstringEntryRow: Adw.PreferencesRow { max-length: 0; valign: baseline_fill; accessible-role: text_box; + activate => $add() swapped; + state-flags-changed => $text_state_flags_changed() swapped; + keynav-failed => $text_keynav_failed() swapped; + changed => $update_add_button() swapped; accessibility { labelled-by: [ title, ]; } - - activate => $add() swapped; - state-flags-changed => $text_state_flags_changed() swapped; - keynav-failed => $text_keynav_failed() swapped; - changed => $update_add_button() swapped; } Gtk.Image edit_icon { diff --git a/src/components/user_page.blp b/src/components/user_page.blp index 30eac2d9..392ffac3 100644 --- a/src/components/user_page.blp +++ b/src/components/user_page.blp @@ -70,13 +70,12 @@ template $UserPage: Adw.NavigationPage { Gtk.ListBox direct_chat_box { visible: false; + accessible-role: group; styles [ "boxed-list", ] - accessible-role: group; - $LoadingButtonRow direct_chat_button { is-loading: true; activated => $open_direct_chat() swapped; @@ -131,21 +130,21 @@ template $UserPage: Adw.NavigationPage { } $LoadingButtonRow kick_button { - styles [ - "destructive-action", - ] - activated => $kick_user() swapped; - } - $LoadingButtonRow ban_button { styles [ "destructive-action", ] + } + $LoadingButtonRow ban_button { // Translators: As in, 'Ban room member'. title: _("Ban"); activated => $ban_user() swapped; + + styles [ + "destructive-action", + ] } $LoadingButtonRow unban_button { @@ -155,12 +154,12 @@ template $UserPage: Adw.NavigationPage { } $LoadingButtonRow remove_messages_button { + title: _("Remove Messages"); + activated => $remove_messages() swapped; + styles [ "destructive-action", ] - - title: _("Remove Messages"); - activated => $remove_messages() swapped; } } } diff --git a/src/error_page.blp b/src/error_page.blp index 3fbc7b8e..43960498 100644 --- a/src/error_page.blp +++ b/src/error_page.blp @@ -121,6 +121,12 @@ template $ErrorPage: Adw.Bin { } Gtk.Box { + styles [ + "card", + "linked", + "command", + ] + Gtk.ScrolledWindow { vscrollbar-policy: never; @@ -145,12 +151,6 @@ template $ErrorPage: Adw.Bin { "flat", ] } - - styles [ - "card", - "linked", - "command", - ] } } } diff --git a/src/identity_verification_view/accept_request_page.blp b/src/identity_verification_view/accept_request_page.blp index 9f2e1436..e1515ef4 100644 --- a/src/identity_verification_view/accept_request_page.blp +++ b/src/identity_verification_view/accept_request_page.blp @@ -22,13 +22,13 @@ template $IdentityVerificationAcceptRequestPage: Adw.Bin { justify: center; accessible-role: heading; - accessibility { - level: 1; - } - styles [ "title-1", ] + + accessibility { + level: 1; + } } Gtk.Label instructions { diff --git a/src/identity_verification_view/cancelled_page.blp b/src/identity_verification_view/cancelled_page.blp index f87cf7ad..f0b7c98e 100644 --- a/src/identity_verification_view/cancelled_page.blp +++ b/src/identity_verification_view/cancelled_page.blp @@ -21,13 +21,13 @@ template $IdentityVerificationCancelledPage: Adw.Bin { justify: center; accessible-role: heading; - accessibility { - level: 1; - } - styles [ "title-1", ] + + accessibility { + level: 1; + } } Gtk.Label message { diff --git a/src/identity_verification_view/choose_method_page.blp b/src/identity_verification_view/choose_method_page.blp index c633948e..8eafb4f8 100644 --- a/src/identity_verification_view/choose_method_page.blp +++ b/src/identity_verification_view/choose_method_page.blp @@ -21,13 +21,13 @@ template $IdentityVerificationChooseMethodPage: Adw.Bin { justify: center; accessible-role: heading; - accessibility { - level: 1; - } - styles [ "title-1", ] + + accessibility { + level: 1; + } } Gtk.Label instructions { diff --git a/src/identity_verification_view/completed_page.blp b/src/identity_verification_view/completed_page.blp index c7a722ff..2ce4d947 100644 --- a/src/identity_verification_view/completed_page.blp +++ b/src/identity_verification_view/completed_page.blp @@ -21,13 +21,13 @@ template $IdentityVerificationCompletedPage: Adw.Bin { justify: center; accessible-role: heading; - accessibility { - level: 1; - } - styles [ "title-1", ] + + accessibility { + level: 1; + } } Gtk.Picture { diff --git a/src/identity_verification_view/confirm_qr_code_page.blp b/src/identity_verification_view/confirm_qr_code_page.blp index db2ac35c..1d731558 100644 --- a/src/identity_verification_view/confirm_qr_code_page.blp +++ b/src/identity_verification_view/confirm_qr_code_page.blp @@ -22,13 +22,13 @@ template $IdentityVerificationConfirmQrCodePage: Adw.Bin { justify: center; accessible-role: heading; - accessibility { - level: 1; - } - styles [ "title-1", ] + + accessibility { + level: 1; + } } Gtk.Picture { @@ -56,16 +56,16 @@ template $IdentityVerificationConfirmQrCodePage: Adw.Bin { halign: center; clicked => $cancel() swapped; + styles [ + "destructive-action", + "pill", + ] + accessibility { described-by: [ question, ]; } - - styles [ - "destructive-action", - "pill", - ] } $LoadingButton confirm_btn { @@ -73,16 +73,16 @@ template $IdentityVerificationConfirmQrCodePage: Adw.Bin { halign: center; clicked => $confirm_scanned() swapped; + styles [ + "suggested-action", + "pill", + ] + accessibility { described-by: [ question, ]; } - - styles [ - "suggested-action", - "pill", - ] } } }; diff --git a/src/identity_verification_view/no_supported_methods_page.blp b/src/identity_verification_view/no_supported_methods_page.blp index 832154dd..1c4464cf 100644 --- a/src/identity_verification_view/no_supported_methods_page.blp +++ b/src/identity_verification_view/no_supported_methods_page.blp @@ -22,13 +22,13 @@ template $IdentityVerificationNoSupportedMethodsPage: Adw.Bin { label: _("No Supported Verification Methods"); accessible-role: heading; - accessibility { - level: 1; - } - styles [ "title-1", ] + + accessibility { + level: 1; + } } Gtk.Label message { diff --git a/src/identity_verification_view/qr_code_scanned_page.blp b/src/identity_verification_view/qr_code_scanned_page.blp index feddb409..fee67ccb 100644 --- a/src/identity_verification_view/qr_code_scanned_page.blp +++ b/src/identity_verification_view/qr_code_scanned_page.blp @@ -22,13 +22,13 @@ template $IdentityVerificationQrCodeScannedPage: Adw.Bin { justify: center; accessible-role: heading; - accessibility { - level: 1; - } - styles [ "title-1", ] + + accessibility { + level: 1; + } } Gtk.Picture { diff --git a/src/identity_verification_view/room_left_page.blp b/src/identity_verification_view/room_left_page.blp index f4475ef3..807008d6 100644 --- a/src/identity_verification_view/room_left_page.blp +++ b/src/identity_verification_view/room_left_page.blp @@ -22,13 +22,13 @@ template $IdentityVerificationRoomLeftPage: Adw.Bin { label: _("Verification Cancelled"); accessible-role: heading; - accessibility { - level: 1; - } - styles [ "title-1", ] + + accessibility { + level: 1; + } } Gtk.Label { diff --git a/src/identity_verification_view/sas_emoji.blp b/src/identity_verification_view/sas_emoji.blp index 9457c03a..749fd637 100644 --- a/src/identity_verification_view/sas_emoji.blp +++ b/src/identity_verification_view/sas_emoji.blp @@ -2,6 +2,8 @@ using Gtk 4.0; using Adw 1; template $IdentityVerificationSasEmoji: Adw.Bin { + valign: center; + accessibility { labelled-by: [ emoji, @@ -12,8 +14,6 @@ template $IdentityVerificationSasEmoji: Adw.Bin { ]; } - valign: center; - Gtk.Box { spacing: 6; orientation: vertical; diff --git a/src/identity_verification_view/sas_page.blp b/src/identity_verification_view/sas_page.blp index 13968482..655acd82 100644 --- a/src/identity_verification_view/sas_page.blp +++ b/src/identity_verification_view/sas_page.blp @@ -21,13 +21,13 @@ template $IdentityVerificationSasPage: Adw.Bin { justify: center; accessible-role: heading; - accessibility { - level: 1; - } - styles [ "title-1", ] + + accessibility { + level: 1; + } } Gtk.Label instructions { diff --git a/src/identity_verification_view/scan_qr_code_page.blp b/src/identity_verification_view/scan_qr_code_page.blp index c68e6abe..25cca038 100644 --- a/src/identity_verification_view/scan_qr_code_page.blp +++ b/src/identity_verification_view/scan_qr_code_page.blp @@ -21,13 +21,13 @@ template $IdentityVerificationScanQrCodePage: Adw.Bin { justify: center; accessible-role: heading; - accessibility { - level: 1; - } - styles [ "title-1", ] + + accessibility { + level: 1; + } } Gtk.Label instructions { diff --git a/src/identity_verification_view/wait_for_other_page.blp b/src/identity_verification_view/wait_for_other_page.blp index 3fe22707..e4d4f16f 100644 --- a/src/identity_verification_view/wait_for_other_page.blp +++ b/src/identity_verification_view/wait_for_other_page.blp @@ -22,13 +22,13 @@ template $IdentityVerificationWaitForOtherPage: Adw.Bin { justify: center; accessible-role: heading; - accessibility { - level: 1; - } - styles [ "title-1", ] + + accessibility { + level: 1; + } } Gtk.Label instructions { diff --git a/src/login/greeter.blp b/src/login/greeter.blp index 83b6b710..6740eed5 100644 --- a/src/login/greeter.blp +++ b/src/login/greeter.blp @@ -107,28 +107,28 @@ template $Greeter: Adw.NavigationPage { spacing: 16; Gtk.Button login_button { - styles [ - "pill", - "suggested-action", - ] - can-shrink: true; label: _("_Log In"); use-underline: true; action-name: "navigation.push"; action-target: "'homeserver'"; - } - Gtk.Button { styles [ "pill", + "suggested-action", ] + } + Gtk.Button { visible: false; can-shrink: true; label: _("_Create Account"); use-underline: true; action-name: "app.create-account"; + + styles [ + "pill", + ] } }; } diff --git a/src/login/homeserver_page.blp b/src/login/homeserver_page.blp index cf168270..754ea633 100644 --- a/src/login/homeserver_page.blp +++ b/src/login/homeserver_page.blp @@ -46,13 +46,13 @@ template $LoginHomeserverPage: Adw.NavigationPage { justify: center; accessible-role: heading; - accessibility { - level: 1; - } - styles [ "title-1", ] + + accessibility { + level: 1; + } } Gtk.Picture { @@ -85,17 +85,17 @@ template $LoginHomeserverPage: Adw.NavigationPage { } Gtk.Label homeserver_help { - styles [ - "caption", - "dimmed", - ] - justify: left; xalign: 0.0; margin-start: 6; margin-end: 6; wrap: true; use-markup: true; + + styles [ + "caption", + "dimmed", + ] } } diff --git a/src/login/in_browser_page.blp b/src/login/in_browser_page.blp index b110566a..a14e9ee4 100644 --- a/src/login/in_browser_page.blp +++ b/src/login/in_browser_page.blp @@ -39,13 +39,13 @@ template $LoginInBrowserPage: Adw.NavigationPage { label: _("Authentication"); accessible-role: heading; - accessibility { - level: 1; - } - styles [ "title-1", ] + + accessibility { + level: 1; + } } Gtk.Label instructions { @@ -60,6 +60,9 @@ template $LoginInBrowserPage: Adw.NavigationPage { } Gtk.Button continue_btn { + halign: center; + clicked => $launch_url() swapped; + styles [ "suggested-action", "standalone-button", @@ -83,9 +86,6 @@ template $LoginInBrowserPage: Adw.NavigationPage { valign: center; } }; - - halign: center; - clicked => $launch_url() swapped; } }; }; diff --git a/src/login/method_page.blp b/src/login/method_page.blp index b32c8f6e..35223cd0 100644 --- a/src/login/method_page.blp +++ b/src/login/method_page.blp @@ -50,14 +50,14 @@ template $LoginMethodPage: Adw.NavigationPage { halign: center; Gtk.Label title { - styles [ - "title-1", - ] - wrap: true; justify: center; accessible-role: heading; + styles [ + "title-1", + ] + accessibility { level: 1; } @@ -74,11 +74,11 @@ template $LoginMethodPage: Adw.NavigationPage { } Gtk.Label homeserver_url { + ellipsize: end; + styles [ "body", ] - - ellipsize: end; } } } diff --git a/src/login/mod.blp b/src/login/mod.blp index 16e154c9..def714a6 100644 --- a/src/login/mod.blp +++ b/src/login/mod.blp @@ -54,13 +54,13 @@ template $Login: Adw.Bin { label: _("Login Complete"); accessible-role: heading; - accessibility { - level: 1; - } - styles [ "title-1", ] + + accessibility { + level: 1; + } } Gtk.Picture { diff --git a/src/login/sso_idp_button.blp b/src/login/sso_idp_button.blp index a6c1b9c2..3f85812f 100644 --- a/src/login/sso_idp_button.blp +++ b/src/login/sso_idp_button.blp @@ -1,10 +1,10 @@ using Gtk 4.0; template $SsoIdpButton: Gtk.Button { + action-name: "login.sso"; + styles [ "card", "sso-button", ] - - action-name: "login.sso"; }