🔧 Port update notification to GTK4
This commit is contained in:
@@ -345,16 +345,25 @@ var PreferencesDialog = class PreferencesDialog {
|
||||
GLib.timeout_add(GLib.PRIORITY_DEFAULT, 2000, () => {
|
||||
this._showUpdateInfoTimeout = 0;
|
||||
|
||||
const toast = Adw.Toast.new(_('Burn-My-Windows has been updated!'));
|
||||
toast.set_button_label(_('View Changelog'));
|
||||
toast.set_action_name('prefs.changelog');
|
||||
toast.set_timeout(0);
|
||||
|
||||
toast.connect(
|
||||
'dismissed',
|
||||
() => this._settings.set_int('last-version', Me.metadata.version));
|
||||
|
||||
window.add_toast(toast);
|
||||
if (utils.isADW()) {
|
||||
const toast = Adw.Toast.new(_('Burn-My-Windows has been updated!'));
|
||||
toast.set_button_label(_('View Changelog'));
|
||||
toast.set_action_name('prefs.changelog');
|
||||
toast.set_timeout(0);
|
||||
|
||||
toast.connect(
|
||||
'dismissed',
|
||||
() => this._settings.set_int('last-version', Me.metadata.version));
|
||||
|
||||
window.add_toast(toast);
|
||||
}else {
|
||||
const infoBar = this._builder.get_object("update-info");
|
||||
infoBar.connect("response", i => {
|
||||
this._settings.set_int('last-version', Me.metadata.version);
|
||||
i.set_revealed(false);
|
||||
});
|
||||
infoBar.set_revealed(true);
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
+61
-29
@@ -37,50 +37,82 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
<property name="transition-type">over-down-up</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="effect-editor">
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
<property name="child">
|
||||
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin-top">20</property>
|
||||
<property name="margin-bottom">20</property>
|
||||
<property name="margin-start">20</property>
|
||||
<property name="margin-end">20</property>
|
||||
<property name="spacing">5</property>
|
||||
<object class="GtkBox" id="effect-editor">
|
||||
<property name="orientation">vertical</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkInfoBar" id="update-info">
|
||||
<property name="message-type">info</property>
|
||||
<property name="revealed">false</property>
|
||||
<property name="show-close-button">true</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Effect Settings</property>
|
||||
<property name="halign">start</property>
|
||||
<style>
|
||||
<class name="heading" />
|
||||
</style>
|
||||
<property name="label" translatable="yes">Burn-My-Windows has been updated!</property>
|
||||
<property name="margin-start">6</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">If multiple are selected, one is chosen randomly.</property>
|
||||
<property name="halign">start</property>
|
||||
<child type="action">
|
||||
<object class="GtkButton" id="update-info-button">
|
||||
<property name="label" translatable="yes">View Changelog</property>
|
||||
<property name="action-name">prefs.changelog</property>
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="-1">update-info-button</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
<property name="vexpand">true</property>
|
||||
<property name="child">
|
||||
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin-top">20</property>
|
||||
<property name="margin-bottom">20</property>
|
||||
<property name="margin-start">20</property>
|
||||
<property name="margin-end">20</property>
|
||||
<property name="spacing">5</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<child>
|
||||
<object class="GtkListBox" id="effects-group">
|
||||
<property name="selection-mode">none</property>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Effect Settings</property>
|
||||
<property name="halign">start</property>
|
||||
<style>
|
||||
<class name="heading" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">If multiple are selected, one is chosen randomly.</property>
|
||||
<property name="halign">start</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<property name="margin-top">6</property>
|
||||
<child>
|
||||
<object class="GtkListBox" id="effects-group">
|
||||
<property name="selection-mode">none</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</property>
|
||||
|
||||
</object>
|
||||
|
||||
</property>
|
||||
|
||||
</child>
|
||||
</object>
|
||||
|
||||
</child>
|
||||
|
||||
<child>
|
||||
|
||||
Reference in New Issue
Block a user