mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
Set donate icons at the end of taskbar
gh-2259
This commit is contained in:
31
src/prefs.js
31
src/prefs.js
@@ -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() {
|
||||
|
||||
@@ -1099,12 +1099,12 @@ export const Taskbar = class extends EventEmitter {
|
||||
|
||||
if (this._donateApp)
|
||||
appInfos = [
|
||||
...appInfos,
|
||||
{
|
||||
app: this._donateApp,
|
||||
isLauncher: true,
|
||||
windows: [],
|
||||
},
|
||||
...appInfos,
|
||||
]
|
||||
|
||||
return appInfos
|
||||
|
||||
@@ -158,18 +158,9 @@ If you like, you can now hide the donate icon</span></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>
|
||||
|
||||
Reference in New Issue
Block a user