From 292e1f8f97f7a71bbc5ff584dce4d19e6736b070 Mon Sep 17 00:00:00 2001 From: kramo <93832451+kra-mo@users.noreply.github.com> Date: Mon, 22 May 2023 20:25:06 +0200 Subject: [PATCH] GTK cleanups --- data/gtk/details_window.blp | 5 +- data/gtk/game.blp | 109 +++++++++++++++++------------------- data/gtk/style.css | 6 -- data/gtk/window.blp | 46 +++++++-------- 4 files changed, 73 insertions(+), 93 deletions(-) diff --git a/data/gtk/details_window.blp b/data/gtk/details_window.blp index 44f1060..8ca1cab 100644 --- a/data/gtk/details_window.blp +++ b/data/gtk/details_window.blp @@ -127,10 +127,7 @@ template $DetailsWindow : Adw.Window { Gtk.MenuButton exec_info_button { valign: center; icon-name: "help-about-symbolic"; - - accessibility { - label: _("Info"); - } + tooltip-text: _("More Info"); popover: Popover { visible: bind-property exec_info_button.active bidirectional; diff --git a/data/gtk/game.blp b/data/gtk/game.blp index 60c3518..cfafcb1 100644 --- a/data/gtk/game.blp +++ b/data/gtk/game.blp @@ -9,55 +9,55 @@ template $Game : Box { Adw.Clamp { maximum-size: 200; - Box { - orientation: vertical; + Overlay { + [overlay] + Revealer play_revealer { + transition-type: crossfade; + valign: start; + halign: start; - Overlay { - [overlay] - Revealer play_revealer { - transition-type: crossfade; + Box { + halign: start; valign: end; - Box { - halign: start; - valign: end; + Button play_button { + icon-name: "media-playback-start-symbolic"; + margin-start: 6; + margin-end: 3; + margin-top: 6; + margin-bottom: 3; - Button play_button { - icon-name: "media-playback-start-symbolic"; - margin-start: 6; - margin-bottom: 6; - margin-top: 3; - margin-end: 3; + styles [ + "circular", + "osd", + ] + } - styles [ - "circular", - "osd", - ] - } + MenuButton menu_button { + icon-name: "view-more-symbolic"; + margin-start: 3; + margin-end: 3; + margin-top: 6; + margin-bottom: 3; - MenuButton menu_button { - icon-name: "view-more-symbolic"; - margin-start: 3; - margin-bottom: 6; - margin-top: 3; - margin-end: 3; - direction: up; - - styles [ - "circular", - "osd", - ] - } + styles [ + "circular", + "osd", + ] } } + } - Button cover_button { - name: "cover_button"; - overflow: hidden; + Button cover_button { + name: "cover_button"; + overflow: hidden; - accessibility { - labelled-by: title; - } + accessibility { + labelled-by: title; + } + + Box { + orientation: vertical; Overlay { [overlay] @@ -74,29 +74,24 @@ template $Game : Box { } } - styles [ - "card", - "flat", - ] + Label title { + label: _("Title"); + ellipsize: end; + hexpand: true; + halign: start; + margin-top: 14; + margin-bottom: 14; + margin-start: 12; + margin-end: 12; + } } - } - Label title { - label: _("Title"); - ellipsize: end; - hexpand: true; - halign: start; - margin-top: 14; - margin-bottom: 14; - margin-start: 12; - margin-end: 12; + styles [ + "card", + ] } } } - - styles [ - "card", - ] } menu game_options { diff --git a/data/gtk/style.css b/data/gtk/style.css index dca178b..72c1868 100644 --- a/data/gtk/style.css +++ b/data/gtk/style.css @@ -9,10 +9,4 @@ color: @light_1; background-color: @dark_5; opacity: 0.8; -} - -/* The HIG claims another victim... */ -#cover_button { - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; } \ No newline at end of file diff --git a/data/gtk/window.blp b/data/gtk/window.blp index 6cdc609..02822c6 100644 --- a/data/gtk/window.blp +++ b/data/gtk/window.blp @@ -91,6 +91,7 @@ template $CartridgesWindow : Adw.ApplicationWindow { Adw.Clamp { maximum-size: 200; + Overlay { [overlay] Spinner details_view_spinner { @@ -141,7 +142,7 @@ template $CartridgesWindow : Adw.ApplicationWindow { natural-wrap-mode: word; styles [ - "heading" + "heading", ] } @@ -156,6 +157,7 @@ template $CartridgesWindow : Adw.ApplicationWindow { wrap-mode: word_char; natural-wrap-mode: word; } + Label details_view_last_played { margin-start: 12; wrap: true; @@ -163,6 +165,7 @@ template $CartridgesWindow : Adw.ApplicationWindow { natural-wrap-mode: word; } } + Box { hexpand: true; vexpand: true; @@ -191,44 +194,27 @@ template $CartridgesWindow : Adw.ApplicationWindow { icon-name: "document-edit-symbolic"; action-name: "app.edit_game"; tooltip-text: _("Edit"); - - styles [ - "circular", - ] } + Button details_view_hide_button { action-name: "app.hide_game"; - - styles [ - "circular", - ] } + Button { icon-name: "user-trash-symbolic"; action-name: "app.remove_game"; tooltip-text: _("Remove"); - - styles [ - "circular", - ] } - - styles [ - "linked", - ] - } - MenuButton { - halign: start; - valign: center; - margin-top: 24; - margin-start: 12; + MenuButton { icon-name: "system-search-symbolic"; menu-model: search; tooltip-text: _("Search"); + always-show-arrow: true; + } - styles [ - "circular", + styles [ + "toolbar", ] } } @@ -271,6 +257,7 @@ template $CartridgesWindow : Adw.ApplicationWindow { SearchBar search_bar { search-mode-enabled: bind-property search_button.active bidirectional; key-capture-widget: library_view; + Adw.Clamp { maximum-size: 500; tightening-threshold: 500; @@ -336,6 +323,7 @@ template $CartridgesWindow : Adw.ApplicationWindow { SearchBar hidden_search_bar { search-mode-enabled: bind-property hidden_search_button.active bidirectional; key-capture-widget: hidden_library_view; + Adw.Clamp { maximum-size: 500; tightening-threshold: 500; @@ -442,6 +430,7 @@ menu add_games { action: "app.add_game"; } } + section { item { label: _("Import"); @@ -453,25 +442,30 @@ menu add_games { menu search { section { label: "Search on…"; + item { label: "IGDB"; action: "app.igdb_search"; } + item { label: "SteamGridDB"; action: "app.sgdb_search"; } + item { label: "ProtonDB"; action: "app.protondb_search"; } + item { label: "Lutris"; action: "app.lutris_search"; } + item { label: "HowLongToBeat"; action: "app.hltb_search"; } } -} \ No newline at end of file +}