🔧 Add support dialog for GTK3 and GTK4

This commit is contained in:
Simon Schneegans
2023-06-05 21:51:33 +02:00
parent 106ed964d5
commit d89be65fe3
3 changed files with 104 additions and 1 deletions
+6 -1
View File
@@ -405,9 +405,14 @@ var PreferencesDialog = class PreferencesDialog {
const dialog = this._builder.get_object('support-dialog'); const dialog = this._builder.get_object('support-dialog');
dialog.set_transient_for(window); dialog.set_transient_for(window);
dialog.connect('response', (dialog, response) => { 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); this._settings.set_boolean('show-support-dialog', false);
} }
if (!utils.isGTK4()) {
dialog.close();
}
}); });
dialog.show(); dialog.show();
} }
+49
View File
@@ -67,6 +67,55 @@ SPDX-License-Identifier: GPL-3.0-or-later
</style> </style>
</object> </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: &lt;a href='https://ko-fi.com/schneegans'&gt;https://ko-fi.com/schneegans&lt;/a&gt;</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: &lt;a href='https://github.com/sponsors/schneegans'&gt;https://github.com/sponsors/schneegans&lt;/a&gt;</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"> <object class="GtkStack" id="general-prefs">
<property name="transition-type">over-down-up</property> <property name="transition-type">over-down-up</property>
+49
View File
@@ -33,6 +33,55 @@ SPDX-License-Identifier: GPL-3.0-or-later
</style> </style>
</object> </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: &lt;a href='https://ko-fi.com/schneegans'&gt;https://ko-fi.com/schneegans&lt;/a&gt;</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: &lt;a href='https://github.com/sponsors/schneegans'&gt;https://github.com/sponsors/schneegans&lt;/a&gt;</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"> <object class="GtkStack" id="general-prefs">
<property name="transition-type">over-down-up</property> <property name="transition-type">over-down-up</property>