mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-15 00:34:05 +09:00
Merge branch 'master' of https://github.com/home-sweet-gnome/dash-to-panel into beautify
This commit is contained in:
42
prefs.js
42
prefs.js
@@ -204,6 +204,10 @@ const Preferences = class {
|
||||
let pageFineTune = this._builder.get_object('finetune');
|
||||
window.add(pageFineTune);
|
||||
|
||||
this._builder.add_from_file(this._path + '/ui/SettingsDonation.ui');
|
||||
let pageDonation = this._builder.get_object('donation');
|
||||
window.add(pageDonation);
|
||||
|
||||
this._builder.add_from_file(this._path + '/ui/SettingsAbout.ui');
|
||||
let pageAbout = this._builder.get_object('about');
|
||||
window.add(pageAbout);
|
||||
@@ -232,6 +236,19 @@ const Preferences = class {
|
||||
this._leftbox_padding_timeout = 0;
|
||||
this._addFormatValueCallbacks();
|
||||
this._bindSettings();
|
||||
|
||||
let maybeGoToPage = () => {
|
||||
let targetPageName = settings.get_string('target-prefs-page')
|
||||
|
||||
if (targetPageName) {
|
||||
window.set_visible_page_name(targetPageName)
|
||||
settings.set_string('target-prefs-page', '')
|
||||
}
|
||||
}
|
||||
|
||||
settings.connect('changed::target-prefs-page', maybeGoToPage);
|
||||
|
||||
maybeGoToPage();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2212,6 +2229,31 @@ const Preferences = class {
|
||||
);
|
||||
});
|
||||
|
||||
// Donation panel
|
||||
|
||||
let revealDonateTimeout = 0;
|
||||
let donationIconSwitch = this._builder.get_object('donation_icon_switch')
|
||||
let donationRevealer = this._builder.get_object('donation_revealer');
|
||||
let hiddenDonateIcon = !!this._settings.get_string('hide-donate-icon-unixtime')
|
||||
|
||||
this._builder.get_object('donation_logo').set_from_file(`${this._path}/img/dash-to-panel-logo-light.svg`)
|
||||
this._builder.get_object('paypal_logo').set_from_file(`${this._path}/img/paypal.png`)
|
||||
this._builder.get_object('stripe_logo').set_from_file(`${this._path}/img/stripe.png`)
|
||||
this._builder.get_object('kofi_logo').set_from_file(`${this._path}/img/kofi.png`)
|
||||
|
||||
donationIconSwitch.set_active(hiddenDonateIcon)
|
||||
donationRevealer.set_reveal_child(hiddenDonateIcon)
|
||||
|
||||
donationIconSwitch.connect('notify::active', (widget) =>
|
||||
this._settings.set_string('hide-donate-icon-unixtime', widget.get_active() ? Date.now().toString() : '')
|
||||
)
|
||||
|
||||
this.notebook.connect('notify::visible-page', () => {
|
||||
clearTimeout(revealDonateTimeout)
|
||||
|
||||
if (this.notebook.visible_page_name == 'donation' && !donationRevealer.get_reveal_child())
|
||||
revealDonateTimeout = setTimeout(() => donationRevealer.set_reveal_child(true), 10000)
|
||||
})
|
||||
}
|
||||
|
||||
_setPreviewTitlePosition() {
|
||||
|
||||
Reference in New Issue
Block a user