GTK cleanups

This commit is contained in:
kramo
2023-05-22 20:25:06 +02:00
parent d6a2108e42
commit 292e1f8f97
4 changed files with 73 additions and 93 deletions

View File

@@ -127,10 +127,7 @@ template $DetailsWindow : Adw.Window {
Gtk.MenuButton exec_info_button { Gtk.MenuButton exec_info_button {
valign: center; valign: center;
icon-name: "help-about-symbolic"; icon-name: "help-about-symbolic";
tooltip-text: _("More Info");
accessibility {
label: _("Info");
}
popover: Popover { popover: Popover {
visible: bind-property exec_info_button.active bidirectional; visible: bind-property exec_info_button.active bidirectional;

View File

@@ -9,55 +9,55 @@ template $Game : Box {
Adw.Clamp { Adw.Clamp {
maximum-size: 200; maximum-size: 200;
Box { Overlay {
orientation: vertical; [overlay]
Revealer play_revealer {
transition-type: crossfade;
valign: start;
halign: start;
Overlay { Box {
[overlay] halign: start;
Revealer play_revealer {
transition-type: crossfade;
valign: end; valign: end;
Box { Button play_button {
halign: start; icon-name: "media-playback-start-symbolic";
valign: end; margin-start: 6;
margin-end: 3;
margin-top: 6;
margin-bottom: 3;
Button play_button { styles [
icon-name: "media-playback-start-symbolic"; "circular",
margin-start: 6; "osd",
margin-bottom: 6; ]
margin-top: 3; }
margin-end: 3;
styles [ MenuButton menu_button {
"circular", icon-name: "view-more-symbolic";
"osd", margin-start: 3;
] margin-end: 3;
} margin-top: 6;
margin-bottom: 3;
MenuButton menu_button { styles [
icon-name: "view-more-symbolic"; "circular",
margin-start: 3; "osd",
margin-bottom: 6; ]
margin-top: 3;
margin-end: 3;
direction: up;
styles [
"circular",
"osd",
]
}
} }
} }
}
Button cover_button { Button cover_button {
name: "cover_button"; name: "cover_button";
overflow: hidden; overflow: hidden;
accessibility { accessibility {
labelled-by: title; labelled-by: title;
} }
Box {
orientation: vertical;
Overlay { Overlay {
[overlay] [overlay]
@@ -74,29 +74,24 @@ template $Game : Box {
} }
} }
styles [ Label title {
"card", label: _("Title");
"flat", ellipsize: end;
] hexpand: true;
halign: start;
margin-top: 14;
margin-bottom: 14;
margin-start: 12;
margin-end: 12;
}
} }
}
Label title { styles [
label: _("Title"); "card",
ellipsize: end; ]
hexpand: true;
halign: start;
margin-top: 14;
margin-bottom: 14;
margin-start: 12;
margin-end: 12;
} }
} }
} }
styles [
"card",
]
} }
menu game_options { menu game_options {

View File

@@ -9,10 +9,4 @@
color: @light_1; color: @light_1;
background-color: @dark_5; background-color: @dark_5;
opacity: 0.8; opacity: 0.8;
}
/* The HIG claims another victim... */
#cover_button {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
} }

View File

@@ -91,6 +91,7 @@ template $CartridgesWindow : Adw.ApplicationWindow {
Adw.Clamp { Adw.Clamp {
maximum-size: 200; maximum-size: 200;
Overlay { Overlay {
[overlay] [overlay]
Spinner details_view_spinner { Spinner details_view_spinner {
@@ -141,7 +142,7 @@ template $CartridgesWindow : Adw.ApplicationWindow {
natural-wrap-mode: word; natural-wrap-mode: word;
styles [ styles [
"heading" "heading",
] ]
} }
@@ -156,6 +157,7 @@ template $CartridgesWindow : Adw.ApplicationWindow {
wrap-mode: word_char; wrap-mode: word_char;
natural-wrap-mode: word; natural-wrap-mode: word;
} }
Label details_view_last_played { Label details_view_last_played {
margin-start: 12; margin-start: 12;
wrap: true; wrap: true;
@@ -163,6 +165,7 @@ template $CartridgesWindow : Adw.ApplicationWindow {
natural-wrap-mode: word; natural-wrap-mode: word;
} }
} }
Box { Box {
hexpand: true; hexpand: true;
vexpand: true; vexpand: true;
@@ -191,44 +194,27 @@ template $CartridgesWindow : Adw.ApplicationWindow {
icon-name: "document-edit-symbolic"; icon-name: "document-edit-symbolic";
action-name: "app.edit_game"; action-name: "app.edit_game";
tooltip-text: _("Edit"); tooltip-text: _("Edit");
styles [
"circular",
]
} }
Button details_view_hide_button { Button details_view_hide_button {
action-name: "app.hide_game"; action-name: "app.hide_game";
styles [
"circular",
]
} }
Button { Button {
icon-name: "user-trash-symbolic"; icon-name: "user-trash-symbolic";
action-name: "app.remove_game"; action-name: "app.remove_game";
tooltip-text: _("Remove"); tooltip-text: _("Remove");
styles [
"circular",
]
} }
styles [
"linked",
]
}
MenuButton { MenuButton {
halign: start;
valign: center;
margin-top: 24;
margin-start: 12;
icon-name: "system-search-symbolic"; icon-name: "system-search-symbolic";
menu-model: search; menu-model: search;
tooltip-text: _("Search"); tooltip-text: _("Search");
always-show-arrow: true;
}
styles [ styles [
"circular", "toolbar",
] ]
} }
} }
@@ -271,6 +257,7 @@ template $CartridgesWindow : Adw.ApplicationWindow {
SearchBar search_bar { SearchBar search_bar {
search-mode-enabled: bind-property search_button.active bidirectional; search-mode-enabled: bind-property search_button.active bidirectional;
key-capture-widget: library_view; key-capture-widget: library_view;
Adw.Clamp { Adw.Clamp {
maximum-size: 500; maximum-size: 500;
tightening-threshold: 500; tightening-threshold: 500;
@@ -336,6 +323,7 @@ template $CartridgesWindow : Adw.ApplicationWindow {
SearchBar hidden_search_bar { SearchBar hidden_search_bar {
search-mode-enabled: bind-property hidden_search_button.active bidirectional; search-mode-enabled: bind-property hidden_search_button.active bidirectional;
key-capture-widget: hidden_library_view; key-capture-widget: hidden_library_view;
Adw.Clamp { Adw.Clamp {
maximum-size: 500; maximum-size: 500;
tightening-threshold: 500; tightening-threshold: 500;
@@ -442,6 +430,7 @@ menu add_games {
action: "app.add_game"; action: "app.add_game";
} }
} }
section { section {
item { item {
label: _("Import"); label: _("Import");
@@ -453,25 +442,30 @@ menu add_games {
menu search { menu search {
section { section {
label: "Search on…"; label: "Search on…";
item { item {
label: "IGDB"; label: "IGDB";
action: "app.igdb_search"; action: "app.igdb_search";
} }
item { item {
label: "SteamGridDB"; label: "SteamGridDB";
action: "app.sgdb_search"; action: "app.sgdb_search";
} }
item { item {
label: "ProtonDB"; label: "ProtonDB";
action: "app.protondb_search"; action: "app.protondb_search";
} }
item { item {
label: "Lutris"; label: "Lutris";
action: "app.lutris_search"; action: "app.lutris_search";
} }
item { item {
label: "HowLongToBeat"; label: "HowLongToBeat";
action: "app.hltb_search"; action: "app.hltb_search";
} }
} }
} }