mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
Add spinner to donation page
This commit is contained in:
10
src/prefs.js
10
src/prefs.js
@@ -3506,6 +3506,7 @@ const Preferences = class {
|
|||||||
let revealDonateTimeout = 0
|
let revealDonateTimeout = 0
|
||||||
let donationIconSwitch = this._builder.get_object('donation_icon_switch')
|
let donationIconSwitch = this._builder.get_object('donation_icon_switch')
|
||||||
let donationRevealer = this._builder.get_object('donation_revealer')
|
let donationRevealer = this._builder.get_object('donation_revealer')
|
||||||
|
let donationSpinner = this._builder.get_object('donation_spinner')
|
||||||
let hiddenDonateIcon = !!this._settings.get_string(
|
let hiddenDonateIcon = !!this._settings.get_string(
|
||||||
'hide-donate-icon-unixtime',
|
'hide-donate-icon-unixtime',
|
||||||
)
|
)
|
||||||
@@ -3525,6 +3526,7 @@ const Preferences = class {
|
|||||||
|
|
||||||
donationIconSwitch.set_active(hiddenDonateIcon)
|
donationIconSwitch.set_active(hiddenDonateIcon)
|
||||||
donationRevealer.set_reveal_child(hiddenDonateIcon)
|
donationRevealer.set_reveal_child(hiddenDonateIcon)
|
||||||
|
donationSpinner.set_spinning(!hiddenDonateIcon)
|
||||||
|
|
||||||
donationIconSwitch.connect('notify::active', (widget) =>
|
donationIconSwitch.connect('notify::active', (widget) =>
|
||||||
this._settings.set_string(
|
this._settings.set_string(
|
||||||
@@ -3540,10 +3542,10 @@ const Preferences = class {
|
|||||||
this.notebook.visible_page_name == 'donation' &&
|
this.notebook.visible_page_name == 'donation' &&
|
||||||
!donationRevealer.get_reveal_child()
|
!donationRevealer.get_reveal_child()
|
||||||
)
|
)
|
||||||
revealDonateTimeout = setTimeout(
|
revealDonateTimeout = setTimeout(() => {
|
||||||
() => donationRevealer.set_reveal_child(true),
|
donationRevealer.set_reveal_child(true)
|
||||||
10000,
|
donationSpinner.set_spinning(false)
|
||||||
)
|
}, 20000)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -137,6 +137,11 @@
|
|||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkSpinner" id="donation_spinner">
|
||||||
|
<property name="opacity">0.3</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkRevealer" id="donation_revealer">
|
<object class="GtkRevealer" id="donation_revealer">
|
||||||
<property name="child">
|
<property name="child">
|
||||||
|
|||||||
Reference in New Issue
Block a user