Set donate icons at the end of taskbar

gh-2259
This commit is contained in:
Charles Gagnon
2025-03-10 16:28:07 -04:00
parent 4e1f85f19b
commit 28b7efe707
3 changed files with 1 additions and 41 deletions

View File

@@ -3648,9 +3648,7 @@ const Preferences = class {
// Donation panel
let revealDonateTimeout = 0
let donationIconSwitch = this._builder.get_object('donation_icon_switch')
let donationSpinner = this._builder.get_object('donation_spinner')
let hiddenDonateIcon = !!this._settings.get_string(
'hide-donate-icon-unixtime',
)
@@ -3669,8 +3667,6 @@ const Preferences = class {
.set_from_file(`${this._path}/img/kofi.png`)
donationIconSwitch.set_active(hiddenDonateIcon)
donationIconSwitch.set_sensitive(hiddenDonateIcon)
donationSpinner.set_visible(!hiddenDonateIcon)
donationIconSwitch.connect('notify::active', (widget) =>
this._settings.set_string(
@@ -3678,33 +3674,6 @@ const Preferences = class {
widget.get_active() ? Date.now().toString() : '',
),
)
this.notebook.connect('notify::visible-page', () => {
if (revealDonateTimeout) {
GLib.Source.remove(revealDonateTimeout)
revealDonateTimeout = 0
}
if (this.notebook.visible_page_name == 'donation' && !hiddenDonateIcon) {
let secs = 5
revealDonateTimeout = GLib.timeout_add(
GLib.PRIORITY_DEFAULT,
1000,
() => {
if (--secs < 1) {
donationIconSwitch.set_sensitive(true)
donationSpinner.set_visible(false)
revealDonateTimeout = 0
return GLib.SOURCE_REMOVE
}
return GLib.SOURCE_CONTINUE
},
)
}
})
}
_setPreviewTitlePosition() {

View File

@@ -1099,12 +1099,12 @@ export const Taskbar = class extends EventEmitter {
if (this._donateApp)
appInfos = [
...appInfos,
{
app: this._donateApp,
isLauncher: true,
windows: [],
},
...appInfos,
]
return appInfos

View File

@@ -158,18 +158,9 @@ If you like, you can now hide the donate icon&lt;/span&gt;</property>
<child>
<object class="GtkSwitch" id="donation_icon_switch">
<property name="halign">end</property>
<property name="sensitive">False</property>
<property name="valign">center</property>
</object>
</child>
<child>
<object class="GtkSpinner" id="donation_spinner">
<property name="halign">end</property>
<property name="margin-start">10</property>
<property name="opacity">0.3</property>
<property name="spinning">True</property>
</object>
</child>
</object>
</child>
</object>