From f4b44477e9380cb112b28560ef4ee0258e504a2a Mon Sep 17 00:00:00 2001 From: kramo Date: Sat, 30 Mar 2024 13:43:54 +0100 Subject: [PATCH] Update blueprint-compiler, format .blp files --- data/gtk/details-dialog.blp | 273 +++++++++++----------- data/gtk/game.blp | 2 +- data/gtk/preferences.blp | 74 +++--- data/gtk/window.blp | 306 +++++++++++++------------ flatpak/hu.kramo.Cartridges.Devel.json | 2 +- subprojects/blueprint-compiler.wrap | 4 +- 6 files changed, 345 insertions(+), 316 deletions(-) diff --git a/data/gtk/details-dialog.blp b/data/gtk/details-dialog.blp index add24a6..a5a5cc8 100644 --- a/data/gtk/details-dialog.blp +++ b/data/gtk/details-dialog.blp @@ -1,143 +1,146 @@ using Gtk 4.0; using Adw 1; -template $DetailsDialog : Adw.Dialog { - content-width: 480; +template $DetailsDialog: Adw.Dialog { + content-width: 480; - Adw.ToolbarView { + Adw.ToolbarView { + [top] + Adw.HeaderBar HeaderBar { + show-start-title-buttons: false; + show-end-title-buttons: false; - [top] - Adw.HeaderBar HeaderBar { - show-start-title-buttons: false; - show-end-title-buttons: false; + [start] + Button cancel_button { + label: _("Cancel"); + action-name: "window.close"; + } - [start] - Button cancel_button { - label: _("Cancel"); - action-name: "window.close"; - } - - [end] - Button apply_button { - styles [ - "suggested-action" - ] - } - } - - Adw.PreferencesPage { - Adw.PreferencesGroup cover_group { - Adw.Clamp cover_clamp { - maximum-size: 200; - Overlay { - [overlay] - Spinner spinner { - margin-start: 72; - margin-end: 72; - } - - Overlay cover_overlay { - halign: center; - valign: center; - - [overlay] - Button cover_button_edit { - icon-name: "document-edit-symbolic"; - tooltip-text: _("New Cover"); - halign: end; - valign: end; - margin-bottom: 6; - margin-end: 6; - - styles [ - "circular", "osd" - ] - } - - [overlay] - Revealer cover_button_delete_revealer { - transition-type: crossfade; - margin-end: 40; - - Button cover_button_delete { - icon-name: "user-trash-symbolic"; - tooltip-text: _("Delete Cover"); - halign: end; - valign: end; - margin-bottom: 6; - margin-end: 6; - - styles [ - "circular", "osd" - ] - } - } - - Picture cover { - width-request: 200; - height-request: 300; - - styles [ - "card" - ] - } - } - } - } - } - - Adw.PreferencesGroup { - Adw.EntryRow name { - title: _("Title"); - } - Adw.EntryRow developer { - title: _("Developer (optional)"); - } - } - Adw.PreferencesGroup { - Adw.EntryRow executable { - title: _("Executable"); - - [suffix] - Button file_chooser_button { - valign: center; - icon-name: "document-open-symbolic"; - tooltip-text: _("Select File"); - - styles [ - "flat", - ] - } - - [suffix] - MenuButton exec_info_button { - valign: center; - icon-name: "help-about-symbolic"; - tooltip-text: _("More Info"); - - popover: Popover exec_info_popover { - focusable: true; - - Label exec_info_label { - use-markup: true; - wrap: true; - max-width-chars: 50; - halign: center; - valign: center; - margin-top: 6; - margin-bottom: 6; - margin-start: 6; - margin-end: 6; - } - }; - - styles [ - "flat" - ] - } - - } - } - } + [end] + Button apply_button { + styles [ + "suggested-action" + ] + } } + + Adw.PreferencesPage { + Adw.PreferencesGroup cover_group { + Adw.Clamp cover_clamp { + maximum-size: 200; + + Overlay { + [overlay] + Spinner spinner { + margin-start: 72; + margin-end: 72; + } + + Overlay cover_overlay { + halign: center; + valign: center; + + [overlay] + Button cover_button_edit { + icon-name: "document-edit-symbolic"; + tooltip-text: _("New Cover"); + halign: end; + valign: end; + margin-bottom: 6; + margin-end: 6; + + styles [ + "circular", + "osd" + ] + } + + [overlay] + Revealer cover_button_delete_revealer { + transition-type: crossfade; + margin-end: 40; + + Button cover_button_delete { + icon-name: "user-trash-symbolic"; + tooltip-text: _("Delete Cover"); + halign: end; + valign: end; + margin-bottom: 6; + margin-end: 6; + + styles [ + "circular", + "osd" + ] + } + } + + Picture cover { + width-request: 200; + height-request: 300; + + styles [ + "card" + ] + } + } + } + } + } + + Adw.PreferencesGroup { + Adw.EntryRow name { + title: _("Title"); + } + + Adw.EntryRow developer { + title: _("Developer (optional)"); + } + } + + Adw.PreferencesGroup { + Adw.EntryRow executable { + title: _("Executable"); + + [suffix] + Button file_chooser_button { + valign: center; + icon-name: "document-open-symbolic"; + tooltip-text: _("Select File"); + + styles [ + "flat", + ] + } + + [suffix] + MenuButton exec_info_button { + valign: center; + icon-name: "help-about-symbolic"; + tooltip-text: _("More Info"); + + popover: Popover exec_info_popover { + focusable: true; + + Label exec_info_label { + use-markup: true; + wrap: true; + max-width-chars: 50; + halign: center; + valign: center; + margin-top: 6; + margin-bottom: 6; + margin-start: 6; + margin-end: 6; + } + }; + + styles [ + "flat" + ] + } + } + } + } + } } diff --git a/data/gtk/game.blp b/data/gtk/game.blp index d198bc5..204fb63 100644 --- a/data/gtk/game.blp +++ b/data/gtk/game.blp @@ -1,7 +1,7 @@ using Gtk 4.0; using Adw 1; -template $Game : Box { +template $Game: Box { orientation: vertical; halign: center; valign: start; diff --git a/data/gtk/preferences.blp b/data/gtk/preferences.blp index 30e1907..81f8be8 100644 --- a/data/gtk/preferences.blp +++ b/data/gtk/preferences.blp @@ -1,7 +1,7 @@ using Gtk 4.0; using Adw 1; -template $CartridgesPreferences : Adw.PreferencesDialog { +template $CartridgesPreferences: Adw.PreferencesDialog { search-enabled: true; Adw.PreferencesPage general_page { @@ -36,28 +36,28 @@ template $CartridgesPreferences : Adw.PreferencesDialog { ListBox remove_all_games_list_box { Adw.PreferencesRow { - activatable: true; - selectable: false; + activatable: true; + selectable: false; - Box { - spacing: 6; - valign: center; - halign: center; + Box { + spacing: 6; + valign: center; + halign: center; - Label { - label: _("Remove All Games"); - ellipsize: end; + Label { + label: _("Remove All Games"); + ellipsize: end; + + styles [ + "heading", + ] + } styles [ - "heading", + "header", ] } - styles [ - "header", - ] - } - styles [ "error", ] @@ -74,28 +74,28 @@ template $CartridgesPreferences : Adw.PreferencesDialog { ListBox reset_list_box { Adw.PreferencesRow { - activatable: true; - selectable: false; + activatable: true; + selectable: false; - Box { - spacing: 6; - valign: center; - halign: center; + Box { + spacing: 6; + valign: center; + halign: center; - Label { - label: "Reset App"; - ellipsize: end; + Label { + label: "Reset App"; + ellipsize: end; + + styles [ + "heading", + ] + } styles [ - "heading", + "header", ] } - styles [ - "header", - ] - } - styles [ "error", ] @@ -139,6 +139,7 @@ template $CartridgesPreferences : Adw.PreferencesDialog { Button steam_data_file_chooser_button { icon-name: "folder-symbolic"; valign: center; + styles [ "flat" ] @@ -161,6 +162,7 @@ template $CartridgesPreferences : Adw.PreferencesDialog { Button lutris_data_file_chooser_button { icon-name: "folder-symbolic"; valign: center; + styles [ "flat" ] @@ -191,6 +193,7 @@ template $CartridgesPreferences : Adw.PreferencesDialog { Button heroic_config_file_chooser_button { icon-name: "folder-symbolic"; valign: center; + styles [ "flat" ] @@ -205,7 +208,7 @@ template $CartridgesPreferences : Adw.PreferencesDialog { title: _("Import GOG Games"); } - Adw.SwitchRow heroic_import_amazon_switch { + Adw.SwitchRow heroic_import_amazon_switch { title: _("Import Amazon Games"); } @@ -229,6 +232,7 @@ template $CartridgesPreferences : Adw.PreferencesDialog { Button bottles_data_file_chooser_button { icon-name: "folder-symbolic"; valign: center; + styles [ "flat" ] @@ -251,6 +255,7 @@ template $CartridgesPreferences : Adw.PreferencesDialog { Button itch_config_file_chooser_button { icon-name: "folder-symbolic"; valign: center; + styles [ "flat" ] @@ -273,6 +278,7 @@ template $CartridgesPreferences : Adw.PreferencesDialog { Button legendary_config_file_chooser_button { icon-name: "folder-symbolic"; valign: center; + styles [ "flat" ] @@ -295,6 +301,7 @@ template $CartridgesPreferences : Adw.PreferencesDialog { Button retroarch_config_file_chooser_button { icon-name: "folder-symbolic"; valign: center; + styles [ "flat" ] @@ -318,6 +325,7 @@ template $CartridgesPreferences : Adw.PreferencesDialog { Button flatpak_system_data_file_chooser_button { icon-name: "folder-symbolic"; valign: center; + styles [ "flat" ] @@ -331,6 +339,7 @@ template $CartridgesPreferences : Adw.PreferencesDialog { Button flatpak_user_data_file_chooser_button { icon-name: "folder-symbolic"; valign: center; + styles [ "flat" ] @@ -394,6 +403,7 @@ template $CartridgesPreferences : Adw.PreferencesDialog { label: _("Update"); valign: center; } + Spinner sgdb_spinner { valign: center; } diff --git a/data/gtk/window.blp b/data/gtk/window.blp index 7d78347..af4c458 100644 --- a/data/gtk/window.blp +++ b/data/gtk/window.blp @@ -43,13 +43,14 @@ Adw.StatusPage hidden_notice_empty { valign: center; } -template $CartridgesWindow : Adw.ApplicationWindow { +template $CartridgesWindow: Adw.ApplicationWindow { title: _("Cartridges"); width-request: 360; height-request: 100; Adw.Breakpoint { condition ("max-width: 564px") + setters { overlay_split_view.collapsed: true; details_view_box.orientation: vertical; @@ -71,161 +72,178 @@ template $CartridgesWindow : Adw.ApplicationWindow { Adw.ToastOverlay toast_overlay { Adw.NavigationView navigation_view { - Adw.NavigationPage library_page { - title: _("All Games"); + Adw.NavigationPage library_page { + title: _("All Games"); - Adw.OverlaySplitView overlay_split_view { - sidebar-width-fraction: .2; + Adw.OverlaySplitView overlay_split_view { + sidebar-width-fraction: .2; - [sidebar] - Adw.NavigationPage { - title: _("Cartridges"); - Adw.ToolbarView { - [top] - Adw.HeaderBar { - [start] - Button { - icon-name: "sidebar-show-symbolic"; - action-name: "win.show_sidebar"; - tooltip-text: _("Toggle Sidebar"); - } + [sidebar] + Adw.NavigationPage { + title: _("Cartridges"); + + Adw.ToolbarView { + [top] + Adw.HeaderBar { + [start] + Button { + icon-name: "sidebar-show-symbolic"; + action-name: "win.show_sidebar"; + tooltip-text: _("Toggle Sidebar"); } + } - ScrolledWindow { - ListBox sidebar { - Box all_games_row_box { - margin-top: 12; - margin-bottom: 12; - margin-start: 6; + ScrolledWindow { + ListBox sidebar { + Box all_games_row_box { + margin-top: 12; + margin-bottom: 12; + margin-start: 6; + margin-end: 6; + spacing: 12; + + Image { + icon-name: "view-grid-symbolic"; + } + + Label { + halign: start; + label: _("All Games"); + } + + Label all_games_no_label { + hexpand: true; + halign: end; + + styles [ + "dim-label" + ] + } + } + + Box added_row_box { + margin-top: 12; + margin-bottom: 12; + margin-start: 6; + spacing: 12; + + Image { + icon-name: "list-add-symbolic"; + } + + Label { + halign: start; + label: _("Added"); margin-end: 6; - spacing: 12; - - Image { - icon-name: "view-grid-symbolic"; - } - Label { - halign: start; - label: _("All Games"); - } - Label all_games_no_label { - hexpand: true; - halign: end; - - styles ["dim-label"] - } } - Box added_row_box { - margin-top: 12; - margin-bottom: 12; - margin-start: 6; - spacing: 12; - Image { - icon-name: "list-add-symbolic"; - } - Label { - halign: start; - label: _("Added"); - margin-end: 6; - } - Label added_games_no_label { - hexpand: true; - halign: end; - margin-end: 6; + Label added_games_no_label { + hexpand: true; + halign: end; + margin-end: 6; - styles ["dim-label"] - } + styles [ + "dim-label" + ] } - ListBoxRow { - selectable: false; - activatable: false; - Label { - label: _("Imported"); - styles ["heading"] - halign: start; - } + } + + ListBoxRow { + selectable: false; + activatable: false; + + Label { + label: _("Imported"); + + styles [ + "heading" + ] + + halign: start; + } + } + + styles [ + "navigation-sidebar" + ] + } + } + } + } + + Adw.ToolbarView library_view { + [top] + Adw.HeaderBar header_bar { + [start] + Revealer { + transition-type: slide_right; + reveal-child: bind overlay_split_view.show-sidebar inverted; + + Button show_sidebar_button { + icon-name: "sidebar-show-symbolic"; + action-name: "win.show_sidebar"; + tooltip-text: _("Toggle Sidebar"); + } + } + + [start] + MenuButton { + tooltip-text: _("Add Game"); + icon-name: "list-add-symbolic"; + menu-model: add_games; + } + + [end] + MenuButton primary_menu_button { + tooltip-text: _("Main Menu"); + icon-name: "open-menu-symbolic"; + menu-model: primary_menu; + } + + [end] + ToggleButton search_button { + tooltip-text: _("Search"); + icon-name: "system-search-symbolic"; + action-name: "win.toggle_search"; + } + } + + [top] + SearchBar search_bar { + search-mode-enabled: bind search_button.active bidirectional; + key-capture-widget: navigation_view; + + Adw.Clamp { + maximum-size: 500; + tightening-threshold: 500; + + SearchEntry search_entry { + placeholder-text: _("Search"); + hexpand: true; + + ShortcutController { + Shortcut { + trigger: "Escape"; + action: "action(win.toggle_search)"; } - styles ["navigation-sidebar"] } } } } - Adw.ToolbarView library_view { - - [top] - Adw.HeaderBar header_bar { - - [start] - Revealer { - transition-type: slide_right; - reveal-child: bind overlay_split_view.show-sidebar inverted; - Button show_sidebar_button { - icon-name: "sidebar-show-symbolic"; - action-name: "win.show_sidebar"; - tooltip-text: _("Toggle Sidebar"); - } - } - - [start] - MenuButton { - tooltip-text: _("Add Game"); - icon-name: "list-add-symbolic"; - menu-model: add_games; - } - - [end] - MenuButton primary_menu_button { - tooltip-text: _("Main Menu"); - icon-name: "open-menu-symbolic"; - menu-model: primary_menu; - } - - [end] - ToggleButton search_button { - tooltip-text: _("Search"); - icon-name: "system-search-symbolic"; - action-name: "win.toggle_search"; - } - } - - [top] - SearchBar search_bar { - search-mode-enabled: bind search_button.active bidirectional; - key-capture-widget: navigation_view; - - Adw.Clamp { - maximum-size: 500; - tightening-threshold: 500; - - SearchEntry search_entry { - placeholder-text: _("Search"); - hexpand: true; - - ShortcutController { - Shortcut { - trigger: "Escape"; - action: "action(win.toggle_search)"; - } - } - } - } - } - - Overlay library_overlay { - ScrolledWindow scrolledwindow { - FlowBox library { - homogeneous: true; - halign: center; - valign: start; - column-spacing: 12; - row-spacing: 12; - margin-top: 15; - margin-bottom: 15; - margin-start: 15; - margin-end: 15; - selection-mode: none; - } + Overlay library_overlay { + ScrolledWindow scrolledwindow { + FlowBox library { + homogeneous: true; + halign: center; + valign: start; + column-spacing: 12; + row-spacing: 12; + margin-top: 15; + margin-bottom: 15; + margin-start: 15; + margin-end: 15; + selection-mode: none; } } } @@ -234,6 +252,7 @@ template $CartridgesWindow : Adw.ApplicationWindow { } } } +} Adw.NavigationPage hidden_library_page { title: _("Hidden Games"); @@ -303,10 +322,8 @@ Adw.NavigationPage details_page { [overlay] Adw.ToolbarView details_view_toolbar_view { - [top] - Adw.HeaderBar { - } + Adw.HeaderBar {} ScrolledWindow { Box details_view_box { @@ -541,7 +558,6 @@ menu add_games { menu search { section { label: "Search on…"; - item (_("IGDB"), "app.igdb_search") item (_("SteamGridDB"), "app.sgdb_search") item (_("ProtonDB"), "app.protondb_search") diff --git a/flatpak/hu.kramo.Cartridges.Devel.json b/flatpak/hu.kramo.Cartridges.Devel.json index 581fa5e..2173f4d 100644 --- a/flatpak/hu.kramo.Cartridges.Devel.json +++ b/flatpak/hu.kramo.Cartridges.Devel.json @@ -112,7 +112,7 @@ { "type" : "git", "url" : "https://gitlab.gnome.org/jwestman/blueprint-compiler", - "tag" : "v0.10.0" + "tag" : "v0.12.0" } ], "cleanup" : [ diff --git a/subprojects/blueprint-compiler.wrap b/subprojects/blueprint-compiler.wrap index 521d368..25ef549 100644 --- a/subprojects/blueprint-compiler.wrap +++ b/subprojects/blueprint-compiler.wrap @@ -1,8 +1,8 @@ [wrap-git] directory = blueprint-compiler url = https://gitlab.gnome.org/jwestman/blueprint-compiler.git -revision = v0.10.0 +revision = v0.12.0 depth = 1 [provide] -program_names = blueprint-compiler \ No newline at end of file +program_names = blueprint-compiler