From 0fb7c859d208b1017d00391cec2a38edbdc8d2ca Mon Sep 17 00:00:00 2001 From: kramo <93832451+kra-mo@users.noreply.github.com> Date: Mon, 10 Apr 2023 16:34:03 +0200 Subject: [PATCH] Cleanups --- data/gtk/game.blp | 2 +- data/gtk/style-dark.css | 2 +- data/gtk/style.css | 2 +- data/gtk/window.blp | 5 +++-- src/game.py | 10 +++++----- src/window.py | 2 +- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/data/gtk/game.blp b/data/gtk/game.blp index 16add80..2f17aa6 100644 --- a/data/gtk/game.blp +++ b/data/gtk/game.blp @@ -30,7 +30,7 @@ template game : Box { reveal-child: false; transition-type: crossfade; Box { - Button button_play { + Button play_button { halign: start; margin-start: 6; margin-end: 6; diff --git a/data/gtk/style-dark.css b/data/gtk/style-dark.css index a757489..c9a8430 100644 --- a/data/gtk/style-dark.css +++ b/data/gtk/style-dark.css @@ -1,7 +1,7 @@ @define-color accent_color @purple_1; @define-color accent_bg_color @purple_4; -#overview_launch { +#overview_play_button { color: @dark_5; background-color: @light_1; } \ No newline at end of file diff --git a/data/gtk/style.css b/data/gtk/style.css index 8f69dec..53a8a60 100644 --- a/data/gtk/style.css +++ b/data/gtk/style.css @@ -1,7 +1,7 @@ @define-color accent_color @purple_5; @define-color accent_bg_color @purple_3; -#overview_launch { +#overview_play_button { color: @light_1; background-color: @dark_5; opacity: 0.8; diff --git a/data/gtk/window.blp b/data/gtk/window.blp index 9b61684..b9df1aa 100644 --- a/data/gtk/window.blp +++ b/data/gtk/window.blp @@ -145,14 +145,15 @@ template CartridgesWindow : Adw.ApplicationWindow { vexpand: true; valign: center; - Button overview_launch { - name: "overview_launch"; + Button overview_play_button { + name: "overview_play_button"; action-name: "app.launch_game"; label: _("Play"); halign: start; margin-top: 24; styles [ + "opaque", "pill", ] } diff --git a/src/game.py b/src/game.py index a505f8c..10999a4 100644 --- a/src/game.py +++ b/src/game.py @@ -34,7 +34,7 @@ class game(Gtk.Box): # pylint: disable=invalid-name overlay = Gtk.Template.Child() title = Gtk.Template.Child() - button_play = Gtk.Template.Child() + play_button = Gtk.Template.Child() cover = Gtk.Template.Child() cover_button = Gtk.Template.Child() menu_button = Gtk.Template.Child() @@ -69,7 +69,7 @@ class game(Gtk.Box): # pylint: disable=invalid-name self.set_play_label() self.cover_button.connect("clicked", self.cover_button_clicked) - self.button_play.connect("clicked", self.button_play_clicked) + self.play_button.connect("clicked", self.play_button_clicked) self.event_contoller_motion.connect("enter", self.show_play) self.event_contoller_motion.connect("leave", self.hide_play) @@ -154,7 +154,7 @@ class game(Gtk.Box): # pylint: disable=invalid-name else: self.parent_widget.show_overview(None, self.game_id) - def button_play_clicked(self, _widget): + def play_button_clicked(self, _widget): if self.parent_widget.schema.get_boolean("cover-launches-game"): self.parent_widget.show_overview(None, self.game_id) else: @@ -162,9 +162,9 @@ class game(Gtk.Box): # pylint: disable=invalid-name def set_play_label(self): if self.parent_widget.schema.get_boolean("cover-launches-game"): - self.button_play.set_label(_("Details")) + self.play_button.set_label(_("Details")) else: - self.button_play.set_label(_("Play")) + self.play_button.set_label(_("Play")) def schema_changed(self, _settings, key): if key == "cover-launches-game": diff --git a/src/window.py b/src/window.py index 6be7a05..65ba66d 100644 --- a/src/window.py +++ b/src/window.py @@ -52,7 +52,7 @@ class CartridgesWindow(Adw.ApplicationWindow): overview_spinner = Gtk.Template.Child() overview_title = Gtk.Template.Child() overview_header_bar_title = Gtk.Template.Child() - overview_launch = Gtk.Template.Child() + overview_play_button = Gtk.Template.Child() overview_blurred_cover = Gtk.Template.Child() overview_developer = Gtk.Template.Child() overview_added = Gtk.Template.Child()