Cleanups
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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",
|
||||
]
|
||||
}
|
||||
|
||||
10
src/game.py
10
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":
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user