Fix secondary shortcut overlay active when disabling while shown

This commit is contained in:
Charles Gagnon
2025-02-15 22:13:46 -05:00
parent 55ee9d0fff
commit f330ea2122
3 changed files with 10 additions and 7 deletions

View File

@@ -871,7 +871,7 @@
<summary>Prefix to use for hotkeys</summary>
<description>You can choose between Super or SuperAlt as the prefix for hotkeys.</description>
</key>
<key type="b" name="overlay-on-secondary-switch">
<key type="b" name="shortcut-overlay-on-secondary">
<default>false</default>
<summary>Show overlay on secondary monitors</summary>
</key>

View File

@@ -430,14 +430,17 @@ export const Overview = class {
[SETTINGS, 'changed::hot-keys', this._checkHotkeysOptions.bind(this)],
[
SETTINGS,
'changed::hotkeys-overlay-combo',
[
'changed::hotkeys-overlay-combo',
'changed::shortcut-overlay-on-secondary',
],
() => {
if (
SETTINGS.get_boolean('hot-keys') &&
SETTINGS.get_string('hotkeys-overlay-combo') === 'ALWAYS'
)
this._toggleHotkeysNumberOverlay(true)
else this._toggleHotkeysNumberOverlay(false)
else this._toggleHotkeysNumberOverlay(false, true)
},
],
[SETTINGS, 'changed::shortcut-num-keys', () => this._resetHotkeys()],
@@ -493,11 +496,11 @@ export const Overview = class {
])
}
_toggleHotkeysNumberOverlay(show) {
_toggleHotkeysNumberOverlay(show, reset) {
// this.taskbar is the primary taskbar
this.taskbar.toggleHotkeysNumberOverlay(show)
if (SETTINGS.get_boolean('overlay-on-secondary-switch')) {
if (reset || SETTINGS.get_boolean('shortcut-overlay-on-secondary')) {
// on secondary panels, show the overlay on icons matching the ones
// found on the primary panel (see Taksbar.hotkeyAppNumbers)
this._panelManager.allPanels.forEach((p) => {

View File

@@ -2789,7 +2789,7 @@ const Preferences = class {
})
this._settings.bind(
'overlay-on-secondary-switch',
'shortcut-overlay-on-secondary',
this._builder.get_object('overlay_on_secondary_switch'),
'active',
Gio.SettingsBindFlags.DEFAULT,
@@ -3075,7 +3075,7 @@ const Preferences = class {
if (!scaleInfo.manualConnect) connectValueChanged(scaleObj, scaleInfo)
scaleObj.set_format_value_func((scale, value) => {
return `${value} ${scaleInfo.unit || 'px'}`
return `${value * (factor || 1)} ${scaleInfo.unit || 'px'}`
})
// Corrent for rtl languages