Change the version warning ignore link into a less obtrusive close-button, with a style to make it fit as well as possible.

It still makes the notification bar a bit taller, but it's not too bad.

The warning dialog remains.
This commit is contained in:
Daniel Johnson 2024-04-05 04:54:14 -04:00
parent 3a7fb94df6
commit 50ee3af168
3 changed files with 20 additions and 7 deletions

View file

@ -73,7 +73,6 @@ class LutrisWindow(Gtk.ApplicationWindow, DialogLaunchUIDelegate, DialogInstallU
turn_on_library_sync_label: Gtk.Label = GtkTemplate.Child()
version_notification_revealer: Gtk.Revealer = GtkTemplate.Child()
version_notification_label: Gtk.Revealer = GtkTemplate.Child()
version_ignore_label: Gtk.Label = GtkTemplate.Child()
def __init__(self, application, **kwargs):
width = int(settings.read_setting("width") or self.default_width)
@ -867,7 +866,7 @@ class LutrisWindow(Gtk.ApplicationWindow, DialogLaunchUIDelegate, DialogInstallU
self.sync_library(force=True)
self.update_notification()
def on_version_ignore_label_activate_link(self, _label, _url):
def on_version_notification_close_button_clicked(self, _button):
dialog = QuestionDialog(
{
"title": _("Unsupported Lutris Version"),

View file

@ -186,18 +186,25 @@
</packing>
</child>
<child>
<object class="GtkLabel" id="version_ignore_label">
<object class="GtkButton" id="version_notification_close_button">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="label" translatable="yes">&lt;a href=""&gt;Ignore&lt;/a&gt;</property>
<property name="use-markup">True</property>
<signal name="activate-link" handler="on_version_ignore_label_activate_link" swapped="no"/>
<property name="receives-default">True</property>
<property name="relief">none</property>
<signal name="clicked" handler="on_version_notification_close_button_clicked" swapped="no"/>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">window-close</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack-type">end</property>
<property name="position">2</property>
<property name="position">1</property>
</packing>
</child>
<style>

View file

@ -48,3 +48,10 @@
.in-app-notification label link {
color: unset;
}
.in-app-notification button {
padding: 0px;
min-height: 0px;
min-width: 0px;
border-radius: 0px;
}