Details view improvements
This commit is contained in:
@@ -80,7 +80,7 @@ menu game_options {
|
|||||||
section {
|
section {
|
||||||
item {
|
item {
|
||||||
label: _("Edit");
|
label: _("Edit");
|
||||||
action: "app.edit_details";
|
action: "app.edit_game";
|
||||||
}
|
}
|
||||||
|
|
||||||
item {
|
item {
|
||||||
@@ -99,7 +99,7 @@ menu hidden_game_options {
|
|||||||
section {
|
section {
|
||||||
item {
|
item {
|
||||||
label: _("Edit");
|
label: _("Edit");
|
||||||
action: "app.edit_details";
|
action: "app.edit_game";
|
||||||
}
|
}
|
||||||
|
|
||||||
item {
|
item {
|
||||||
|
|||||||
@@ -122,22 +122,24 @@ template CartridgesWindow : Adw.ApplicationWindow {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
Label overview_added {
|
Box {
|
||||||
|
orientation: horizontal;
|
||||||
margin-top: 12;
|
margin-top: 12;
|
||||||
hexpand: true;
|
hexpand: true;
|
||||||
halign: start;
|
halign: start;
|
||||||
|
|
||||||
|
Label overview_added {
|
||||||
wrap: true;
|
wrap: true;
|
||||||
wrap-mode: word_char;
|
wrap-mode: word_char;
|
||||||
natural-wrap-mode: word;
|
natural-wrap-mode: word;
|
||||||
}
|
}
|
||||||
Label overview_last_played {
|
Label overview_last_played {
|
||||||
margin-top: 6;
|
margin-start: 12;
|
||||||
hexpand: true;
|
|
||||||
halign: start;
|
|
||||||
wrap: true;
|
wrap: true;
|
||||||
wrap-mode: word_char;
|
wrap-mode: word_char;
|
||||||
natural-wrap-mode: word;
|
natural-wrap-mode: word;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Box {
|
Box {
|
||||||
hexpand: true;
|
hexpand: true;
|
||||||
vexpand: true;
|
vexpand: true;
|
||||||
@@ -155,19 +157,44 @@ template CartridgesWindow : Adw.ApplicationWindow {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
MenuButton overview_menu_button {
|
Box {
|
||||||
icon-name: "view-more-symbolic";
|
|
||||||
hexpand: true;
|
hexpand: true;
|
||||||
vexpand: true;
|
|
||||||
halign: start;
|
halign: start;
|
||||||
|
vexpand: true;
|
||||||
valign: center;
|
valign: center;
|
||||||
margin-top: 24;
|
margin-top: 24;
|
||||||
margin-start: 6;
|
margin-start: 12;
|
||||||
|
|
||||||
|
Button {
|
||||||
|
icon-name: "document-edit-symbolic";
|
||||||
|
action-name: "app.edit_game";
|
||||||
|
tooltip-text: _("Edit");
|
||||||
|
|
||||||
styles [
|
styles [
|
||||||
"circular",
|
"circular",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Button overview_hide_button {
|
||||||
|
action-name: "app.hide_game";
|
||||||
|
|
||||||
|
styles [
|
||||||
|
"circular",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
Button {
|
||||||
|
icon-name: "user-trash-symbolic";
|
||||||
|
action-name: "app.remove_game";
|
||||||
|
tooltip-text: _("Remove");
|
||||||
|
|
||||||
|
styles [
|
||||||
|
"circular",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
styles [
|
||||||
|
"linked",
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class CartridgesApplication(Adw.Application):
|
|||||||
)
|
)
|
||||||
self.create_action("launch_game", self.on_launch_game_action)
|
self.create_action("launch_game", self.on_launch_game_action)
|
||||||
self.create_action("hide_game", self.on_hide_game_action)
|
self.create_action("hide_game", self.on_hide_game_action)
|
||||||
self.create_action("edit_details", self.on_edit_details_action)
|
self.create_action("edit_game", self.on_edit_game_action)
|
||||||
self.create_action("add_game", self.on_add_game_action, ["<primary>n"])
|
self.create_action("add_game", self.on_add_game_action, ["<primary>n"])
|
||||||
self.create_action("import", self.on_import_action, ["<primary>i"])
|
self.create_action("import", self.on_import_action, ["<primary>i"])
|
||||||
self.create_action(
|
self.create_action(
|
||||||
@@ -64,7 +64,6 @@ class CartridgesApplication(Adw.Application):
|
|||||||
self.win = None
|
self.win = None
|
||||||
|
|
||||||
def do_activate(self): # pylint: disable=arguments-differ
|
def do_activate(self): # pylint: disable=arguments-differ
|
||||||
|
|
||||||
# Create the main window
|
# Create the main window
|
||||||
self.win = self.props.active_window # pylint: disable=no-member
|
self.win = self.props.active_window # pylint: disable=no-member
|
||||||
if not self.win:
|
if not self.win:
|
||||||
@@ -184,7 +183,7 @@ class CartridgesApplication(Adw.Application):
|
|||||||
self.win.toasts[(game_id, "hide")] = toast
|
self.win.toasts[(game_id, "hide")] = toast
|
||||||
self.win.toast_overlay.add_toast(toast)
|
self.win.toast_overlay.add_toast(toast)
|
||||||
|
|
||||||
def on_edit_details_action(self, _widget, _callback=None):
|
def on_edit_game_action(self, _widget, _callback=None):
|
||||||
create_details_window(self.win, self.win.active_game_id)
|
create_details_window(self.win, self.win.active_game_id)
|
||||||
|
|
||||||
def on_add_game_action(self, _widget, _callback=None):
|
def on_add_game_action(self, _widget, _callback=None):
|
||||||
|
|||||||
@@ -54,10 +54,10 @@ class CartridgesWindow(Adw.ApplicationWindow):
|
|||||||
overview_header_bar_title = Gtk.Template.Child()
|
overview_header_bar_title = Gtk.Template.Child()
|
||||||
overview_launch = Gtk.Template.Child()
|
overview_launch = Gtk.Template.Child()
|
||||||
overview_blurred_cover = Gtk.Template.Child()
|
overview_blurred_cover = Gtk.Template.Child()
|
||||||
overview_menu_button = Gtk.Template.Child()
|
|
||||||
overview_developer = Gtk.Template.Child()
|
overview_developer = Gtk.Template.Child()
|
||||||
overview_added = Gtk.Template.Child()
|
overview_added = Gtk.Template.Child()
|
||||||
overview_last_played = Gtk.Template.Child()
|
overview_last_played = Gtk.Template.Child()
|
||||||
|
overview_hide_button = Gtk.Template.Child()
|
||||||
|
|
||||||
hidden_library = Gtk.Template.Child()
|
hidden_library = Gtk.Template.Child()
|
||||||
hidden_library_view = Gtk.Template.Child()
|
hidden_library_view = Gtk.Template.Child()
|
||||||
@@ -267,9 +267,12 @@ class CartridgesWindow(Adw.ApplicationWindow):
|
|||||||
else:
|
else:
|
||||||
self.overview_developer.set_visible(False)
|
self.overview_developer.set_visible(False)
|
||||||
|
|
||||||
self.overview_menu_button.set_menu_model(
|
if current_game.hidden:
|
||||||
current_game.menu_button.get_menu_model()
|
self.overview_hide_button.set_icon_name("view-reveal-symbolic")
|
||||||
)
|
self.overview_hide_button.set_tooltip_text(_("Unhide"))
|
||||||
|
else:
|
||||||
|
self.overview_hide_button.set_icon_name("view-conceal-symbolic")
|
||||||
|
self.overview_hide_button.set_tooltip_text(_("Hide"))
|
||||||
|
|
||||||
if self.stack.get_visible_child() != self.overview:
|
if self.stack.get_visible_child() != self.overview:
|
||||||
self.stack.set_transition_type(Gtk.StackTransitionType.OVER_LEFT)
|
self.stack.set_transition_type(Gtk.StackTransitionType.OVER_LEFT)
|
||||||
@@ -338,7 +341,7 @@ class CartridgesWindow(Adw.ApplicationWindow):
|
|||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
self.overview_blurred_cover.set_opacity(
|
self.overview_blurred_cover.set_opacity(
|
||||||
0.2 + (sum(luminances) / len(luminances) + min(luminances)) / 2
|
0.1 + (sum(luminances) / len(luminances) + min(luminances)) / 2
|
||||||
)
|
)
|
||||||
|
|
||||||
def a_z_sort(self, child1, child2):
|
def a_z_sort(self, child1, child2):
|
||||||
@@ -497,5 +500,3 @@ class CartridgesWindow(Adw.ApplicationWindow):
|
|||||||
def on_open_menu_action(self, _widget, _unused):
|
def on_open_menu_action(self, _widget, _unused):
|
||||||
if self.stack.get_visible_child() != self.overview:
|
if self.stack.get_visible_child() != self.overview:
|
||||||
self.primary_menu_button.set_active(True)
|
self.primary_menu_button.set_active(True)
|
||||||
else:
|
|
||||||
self.overview_menu_button.set_active(True)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user