Fix element position combo sensitivity

This commit is contained in:
Charles Gagnon
2025-02-23 10:14:00 -05:00
parent 3733d0bd02
commit 17c49a3c46
2 changed files with 47 additions and 10 deletions

View File

@@ -277,6 +277,9 @@ const Preferences = class {
) )
this._displayPanelPositionsForMonitor(this._currentMonitorIndex) this._displayPanelPositionsForMonitor(this._currentMonitorIndex)
this._setPanelLenghtWidgetSensitivity(
PanelSettings.getPanelLength(this._settings, this._currentMonitorIndex),
)
} }
_maybeDisableTopPosition() { _maybeDisableTopPosition() {
@@ -3666,7 +3669,10 @@ 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 donationCountdown = this._builder.get_object('donation_countdown')
let donationCountdownLabel = this._builder.get_object(
'donation_countdown_label',
)
let hiddenDonateIcon = !!this._settings.get_string( let hiddenDonateIcon = !!this._settings.get_string(
'hide-donate-icon-unixtime', 'hide-donate-icon-unixtime',
) )
@@ -3686,7 +3692,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) donationCountdown.set_visible(!hiddenDonateIcon)
donationIconSwitch.connect('notify::active', (widget) => donationIconSwitch.connect('notify::active', (widget) =>
this._settings.set_string( this._settings.set_string(
@@ -3696,22 +3702,37 @@ const Preferences = class {
) )
this.notebook.connect('notify::visible-page', () => { this.notebook.connect('notify::visible-page', () => {
if (revealDonateTimeout) GLib.Source.remove(revealDonateTimeout) if (revealDonateTimeout) {
GLib.Source.remove(revealDonateTimeout)
revealDonateTimeout = 0
}
if ( if (
this.notebook.visible_page_name == 'donation' && this.notebook.visible_page_name == 'donation' &&
!donationRevealer.get_reveal_child() !donationRevealer.get_reveal_child()
) ) {
let secs = 20
donationCountdownLabel.set_label(secs.toString())
revealDonateTimeout = GLib.timeout_add( revealDonateTimeout = GLib.timeout_add(
GLib.PRIORITY_DEFAULT, GLib.PRIORITY_DEFAULT,
15000, 1000,
() => { () => {
donationRevealer.set_reveal_child(true) donationCountdownLabel.set_label((--secs).toString())
donationSpinner.set_spinning(false)
return GLib.SOURCE_REMOVE if (secs < 1) {
donationRevealer.set_reveal_child(true)
donationCountdown.set_visible(false)
revealDonateTimeout = 0
return GLib.SOURCE_REMOVE
}
return GLib.SOURCE_CONTINUE
}, },
) )
}
}) })
} }

View File

@@ -138,8 +138,24 @@
</object> </object>
</child> </child>
<child> <child>
<object class="GtkSpinner" id="donation_spinner"> <object class="GtkBox" id="donation_countdown">
<property name="opacity">0.3</property> <property name="halign">center</property>
<property name="spacing">6</property>
<child>
<object class="GtkSpinner" id="donation_spinner">
<property name="halign">end</property>
<property name="opacity">0.3</property>
<property name="spinning">True</property>
</object>
</child>
<child>
<object class="GtkLabel" id="donation_countdown_label">
<attributes>
<attribute name="size" value="8000"/>
<attribute name="style" value="italic"/>
</attributes>
</object>
</child>
</object> </object>
</child> </child>
<child> <child>