🔧 Add support dialog for GTK3 and GTK4
This commit is contained in:
@@ -405,9 +405,14 @@ var PreferencesDialog = class PreferencesDialog {
|
||||
const dialog = this._builder.get_object('support-dialog');
|
||||
dialog.set_transient_for(window);
|
||||
dialog.connect('response', (dialog, response) => {
|
||||
if (response === 'never') {
|
||||
if ((utils.isADW() && response === 'never') ||
|
||||
(!utils.isADW() && response === 2)) {
|
||||
this._settings.set_boolean('show-support-dialog', false);
|
||||
}
|
||||
|
||||
if (!utils.isGTK4()) {
|
||||
dialog.close();
|
||||
}
|
||||
});
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
@@ -67,6 +67,55 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
</style>
|
||||
</object>
|
||||
|
||||
<!-- This dialog is occasionaly shown to ask the user for support. -->
|
||||
<object class="GtkMessageDialog" id="support-dialog">
|
||||
<property name="text">Do you want to support Burn-My-Windows?</property>
|
||||
<property name="secondary-text">If only one out of ten users would support this project with 1$ / month, I could work full-time on open-source projects!</property>
|
||||
<property name="modal">true</property>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox">
|
||||
<child internal-child="message_area">
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="hexpand">true</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="use-markup">true</property>
|
||||
<property name="label">Support me on Ko-fi: <a href='https://ko-fi.com/schneegans'>https://ko-fi.com/schneegans</a></property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="hexpand">true</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="use-markup">true</property>
|
||||
<property name="label">Support me on GitHub: <a href='https://github.com/sponsors/schneegans'>https://github.com/sponsors/schneegans</a></property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkHButtonBox">
|
||||
<child>
|
||||
<object class="GtkButton" id="support_never_button">
|
||||
<property name="label">Do not show this again!</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="support_later_button">
|
||||
<property name="label">Maybe later...</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="1" default="true">support_later_button</action-widget>
|
||||
<action-widget response="2">support_never_button</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
|
||||
<object class="GtkStack" id="general-prefs">
|
||||
<property name="transition-type">over-down-up</property>
|
||||
|
||||
|
||||
@@ -33,6 +33,55 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
</style>
|
||||
</object>
|
||||
|
||||
<!-- This dialog is occasionaly shown to ask the user for support. -->
|
||||
<object class="GtkMessageDialog" id="support-dialog">
|
||||
<property name="text">Do you want to support Burn-My-Windows?</property>
|
||||
<property name="secondary-text">If only one out of ten users would support this project with 1$ / month, I could work full-time on open-source projects!</property>
|
||||
<property name="modal">true</property>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox">
|
||||
<child internal-child="message_area">
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="hexpand">true</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="use-markup">true</property>
|
||||
<property name="label">Support me on Ko-fi: <a href='https://ko-fi.com/schneegans'>https://ko-fi.com/schneegans</a></property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="hexpand">true</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="use-markup">true</property>
|
||||
<property name="label">Support me on GitHub: <a href='https://github.com/sponsors/schneegans'>https://github.com/sponsors/schneegans</a></property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkHButtonBox">
|
||||
<child>
|
||||
<object class="GtkButton" id="support_never_button">
|
||||
<property name="label">Do not show this again!</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="support_later_button">
|
||||
<property name="label">Maybe later...</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="1" default="true">support_later_button</action-widget>
|
||||
<action-widget response="2">support_never_button</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
|
||||
<object class="GtkStack" id="general-prefs">
|
||||
<property name="transition-type">over-down-up</property>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user