GTK cleanups 2

This commit is contained in:
kramo
2023-05-22 20:47:14 +02:00
parent f041598629
commit acb2924602
3 changed files with 37 additions and 26 deletions

View File

@@ -16,10 +16,6 @@ template $Game : Box {
valign: start; valign: start;
halign: start; halign: start;
Box {
halign: start;
valign: end;
Button play_button { Button play_button {
icon-name: "media-playback-start-symbolic"; icon-name: "media-playback-start-symbolic";
margin-start: 6; margin-start: 6;
@@ -32,11 +28,18 @@ template $Game : Box {
"osd", "osd",
] ]
} }
}
[overlay]
Revealer menu_revealer {
transition-type: crossfade;
valign: start;
halign: end;
MenuButton menu_button { MenuButton menu_button {
icon-name: "view-more-symbolic"; icon-name: "view-more-symbolic";
margin-start: 3; margin-start: 3;
margin-end: 3; margin-end: 6;
margin-top: 6; margin-top: 6;
margin-bottom: 3; margin-bottom: 3;
@@ -46,7 +49,6 @@ template $Game : Box {
] ]
} }
} }
}
Button cover_button { Button cover_button {
name: "cover_button"; name: "cover_button";

View File

@@ -194,23 +194,30 @@ 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 ["raised", "circular"]
} }
Button details_view_hide_button { Button details_view_hide_button {
action-name: "app.hide_game"; action-name: "app.hide_game";
styles ["raised", "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 ["raised", "circular"]
} }
MenuButton { MenuButton {
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 ["raised", "circular"]
} }
styles [ styles [

View File

@@ -41,6 +41,7 @@ class Game(Gtk.Box):
cover_button = Gtk.Template.Child() cover_button = Gtk.Template.Child()
menu_button = Gtk.Template.Child() menu_button = Gtk.Template.Child()
play_revealer = Gtk.Template.Child() play_revealer = Gtk.Template.Child()
menu_revealer = Gtk.Template.Child()
game_options = Gtk.Template.Child() game_options = Gtk.Template.Child()
hidden_game_options = Gtk.Template.Child() hidden_game_options = Gtk.Template.Child()
@@ -252,6 +253,7 @@ class Game(Gtk.Box):
def toggle_play(self, _widget, _prop1, _prop2, state=True): def toggle_play(self, _widget, _prop1, _prop2, state=True):
if not self.menu_button.get_active(): if not self.menu_button.get_active():
self.play_revealer.set_reveal_child(not state) self.play_revealer.set_reveal_child(not state)
self.menu_revealer.set_reveal_child(not state)
def main_button_clicked(self, _widget, button): def main_button_clicked(self, _widget, button):
if shared.schema.get_boolean("cover-launches-game") ^ button: if shared.schema.get_boolean("cover-launches-game") ^ button: