Improve a11y and consistency for info popover

This commit is contained in:
kramo
2023-06-19 19:31:27 +02:00
parent 6ff9039064
commit 9f582dfa3e
2 changed files with 12 additions and 4 deletions

View File

@@ -129,17 +129,19 @@ template $DetailsWindow : Adw.Window {
icon-name: "help-about-symbolic";
tooltip-text: _("More Info");
popover: Popover {
visible: bind-property exec_info_button.active bidirectional;
popover: Popover exec_info_popover {
Label exec_info_label {
use-markup: true;
wrap: true;
max-width-chars: 30;
max-width-chars: 50;
halign: center;
valign: center;
margin-top: 6;
margin-bottom: 12;
margin-bottom: 6;
margin-start: 6;
margin-end: 6;
selectable: true;
}
};

View File

@@ -48,6 +48,7 @@ class DetailsWindow(Adw.Window):
executable = Gtk.Template.Child()
exec_info_label = Gtk.Template.Child()
exec_info_popover = Gtk.Template.Child()
apply_button = Gtk.Template.Child()
@@ -112,6 +113,11 @@ class DetailsWindow(Adw.Window):
self.exec_info_label.set_label(exec_info_text)
def clear_info_selection(*_args):
self.exec_info_label.select_region(0, 0)
self.exec_info_popover.connect("show", clear_info_selection)
self.cover_button_delete.connect("clicked", self.delete_pixbuf)
self.cover_button_edit.connect("clicked", self.choose_cover)
self.apply_button.connect("clicked", self.apply_preferences)