Use crossfade for button revealers

This commit is contained in:
kramo
2023-05-20 08:29:40 +02:00
parent 0e79f07d72
commit 0715c77c06
2 changed files with 5 additions and 12 deletions

View File

@@ -14,12 +14,12 @@ template $Game : Box {
Overlay { Overlay {
[overlay] [overlay]
Box { Revealer play_revealer {
halign: start; transition-type: crossfade;
valign: end; valign: end;
Revealer play_revealer { Box {
transition-type: slide_up; halign: start;
valign: end; valign: end;
Button play_button { Button play_button {
@@ -34,11 +34,6 @@ template $Game : Box {
"osd", "osd",
] ]
} }
}
Revealer menu_revealer {
transition-type: slide_up;
valign: end;
MenuButton menu_button { MenuButton menu_button {
icon-name: "view-more-symbolic"; icon-name: "view-more-symbolic";
@@ -136,4 +131,4 @@ menu hidden_game_options {
action: "app.remove_game"; action: "app.remove_game";
} }
} }
} }

View File

@@ -37,7 +37,6 @@ 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()
@@ -227,7 +226,6 @@ 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)
GLib.timeout_add(40, self.menu_revealer.set_reveal_child, not state)
def main_button_clicked(self, _widget, button): def main_button_clicked(self, _widget, button):
if self.win.schema.get_boolean("cover-launches-game") ^ button: if self.win.schema.get_boolean("cover-launches-game") ^ button: