Cleanups
This commit is contained in:
@@ -30,7 +30,7 @@ template game : Box {
|
|||||||
reveal-child: false;
|
reveal-child: false;
|
||||||
transition-type: crossfade;
|
transition-type: crossfade;
|
||||||
Box {
|
Box {
|
||||||
Button button_play {
|
Button play_button {
|
||||||
halign: start;
|
halign: start;
|
||||||
margin-start: 6;
|
margin-start: 6;
|
||||||
margin-end: 6;
|
margin-end: 6;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
@define-color accent_color @purple_1;
|
@define-color accent_color @purple_1;
|
||||||
@define-color accent_bg_color @purple_4;
|
@define-color accent_bg_color @purple_4;
|
||||||
|
|
||||||
#overview_launch {
|
#overview_play_button {
|
||||||
color: @dark_5;
|
color: @dark_5;
|
||||||
background-color: @light_1;
|
background-color: @light_1;
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
@define-color accent_color @purple_5;
|
@define-color accent_color @purple_5;
|
||||||
@define-color accent_bg_color @purple_3;
|
@define-color accent_bg_color @purple_3;
|
||||||
|
|
||||||
#overview_launch {
|
#overview_play_button {
|
||||||
color: @light_1;
|
color: @light_1;
|
||||||
background-color: @dark_5;
|
background-color: @dark_5;
|
||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
|
|||||||
@@ -145,14 +145,15 @@ template CartridgesWindow : Adw.ApplicationWindow {
|
|||||||
vexpand: true;
|
vexpand: true;
|
||||||
valign: center;
|
valign: center;
|
||||||
|
|
||||||
Button overview_launch {
|
Button overview_play_button {
|
||||||
name: "overview_launch";
|
name: "overview_play_button";
|
||||||
action-name: "app.launch_game";
|
action-name: "app.launch_game";
|
||||||
label: _("Play");
|
label: _("Play");
|
||||||
halign: start;
|
halign: start;
|
||||||
margin-top: 24;
|
margin-top: 24;
|
||||||
|
|
||||||
styles [
|
styles [
|
||||||
|
"opaque",
|
||||||
"pill",
|
"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()
|
overlay = Gtk.Template.Child()
|
||||||
title = Gtk.Template.Child()
|
title = Gtk.Template.Child()
|
||||||
button_play = Gtk.Template.Child()
|
play_button = Gtk.Template.Child()
|
||||||
cover = Gtk.Template.Child()
|
cover = Gtk.Template.Child()
|
||||||
cover_button = Gtk.Template.Child()
|
cover_button = Gtk.Template.Child()
|
||||||
menu_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.set_play_label()
|
||||||
|
|
||||||
self.cover_button.connect("clicked", self.cover_button_clicked)
|
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("enter", self.show_play)
|
||||||
self.event_contoller_motion.connect("leave", self.hide_play)
|
self.event_contoller_motion.connect("leave", self.hide_play)
|
||||||
@@ -154,7 +154,7 @@ class game(Gtk.Box): # pylint: disable=invalid-name
|
|||||||
else:
|
else:
|
||||||
self.parent_widget.show_overview(None, self.game_id)
|
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"):
|
if self.parent_widget.schema.get_boolean("cover-launches-game"):
|
||||||
self.parent_widget.show_overview(None, self.game_id)
|
self.parent_widget.show_overview(None, self.game_id)
|
||||||
else:
|
else:
|
||||||
@@ -162,9 +162,9 @@ class game(Gtk.Box): # pylint: disable=invalid-name
|
|||||||
|
|
||||||
def set_play_label(self):
|
def set_play_label(self):
|
||||||
if self.parent_widget.schema.get_boolean("cover-launches-game"):
|
if self.parent_widget.schema.get_boolean("cover-launches-game"):
|
||||||
self.button_play.set_label(_("Details"))
|
self.play_button.set_label(_("Details"))
|
||||||
else:
|
else:
|
||||||
self.button_play.set_label(_("Play"))
|
self.play_button.set_label(_("Play"))
|
||||||
|
|
||||||
def schema_changed(self, _settings, key):
|
def schema_changed(self, _settings, key):
|
||||||
if key == "cover-launches-game":
|
if key == "cover-launches-game":
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ class CartridgesWindow(Adw.ApplicationWindow):
|
|||||||
overview_spinner = Gtk.Template.Child()
|
overview_spinner = Gtk.Template.Child()
|
||||||
overview_title = Gtk.Template.Child()
|
overview_title = Gtk.Template.Child()
|
||||||
overview_header_bar_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_blurred_cover = Gtk.Template.Child()
|
||||||
overview_developer = Gtk.Template.Child()
|
overview_developer = Gtk.Template.Child()
|
||||||
overview_added = Gtk.Template.Child()
|
overview_added = Gtk.Template.Child()
|
||||||
|
|||||||
Reference in New Issue
Block a user