feat(settings): add hover_scale entry, fix SettingsEntry float handling

This commit is contained in:
sankalp committed 2026-07-30 22:59:11 +05:45
1 parent 4285c1a0b8
commit 3bc086596a
1 file changed
+10 -4
+10 -4
View File
@@ -1,4 +1,4 @@
from fabric.utils import Gdk, Gtk, logger
from fabric.utils import Gdk, Gtk
from fabric.widgets.box import Box
from fabric.widgets.button import Button
from fabric.widgets.centerbox import CenterBox
@@ -90,12 +90,13 @@ class SettingsEntry(Entry):
def on_change(self, entry, *args):
value = entry.get_text()
# Try to convert to int if possible
try:
if value.isdigit():
value = int(value)
except Exception as e:
logger.error(f"An error occurred: {e}")
else:
value = float(value)
except (ValueError, TypeError):
pass
config().set(self.config_key, value)
config().save()
@@ -400,6 +401,11 @@ class SettingsWindow(Gtk.Window):
SettingsSwitch("dock.hide_special_workspace_apps"),
"Hide apps from special workspace in dock",
),
SettingsRow(
"Hover Scale",
SettingsEntry("dock.hover_scale"),
"Icon scale on hover (1.0 = off, 1.6 = default, 2.0 = max)",
),
],
)