Skip to content

Commit

Permalink
fix set_scale function
Browse files Browse the repository at this point in the history
  • Loading branch information
sulincix committed Nov 26, 2024
1 parent 6bfecbd commit 228ce61
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ def _(msg):
else:
settings.set_property("gtk-icon-theme-name", "Adwaita")

def set_scale(scale=0):
if scale <= 0:
def set_scale(new_scale=0):
global scale
scale = new_scale
if scale < 1:
scale = 1
os.environ["GDK_SCALE"] = str(int(scale))
#os.environ["GDK_DPI_SCALE"] = str(1/scale)
Expand All @@ -67,8 +69,8 @@ def set_scale(scale=0):
settings.set_property("gtk-xft-dpi", 1024*96*scale)
settings.set_property("gtk-xft-antialias", True)

scale = float(get("scale", "0"))
set_scale(scale)

set_scale(float(get("scale", "0")))

loaded_modules = []
base_modules = ["lightdm.py", "gtkwindow.py", "monitor.py"]
Expand Down

0 comments on commit 228ce61

Please sign in to comment.