Skip to content

Commit

Permalink
css pixel scale feature
Browse files Browse the repository at this point in the history
  • Loading branch information
sulincix committed Aug 5, 2024
1 parent 421fe93 commit 9167448
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/module/gtkwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,16 @@ def load_css(self):
css += open("/usr/share/pardus/pardus-lightdm-greeter/data/colors-dark.css").read()
else:
css += open("/usr/share/pardus/pardus-lightdm-greeter/data/colors.css").read()
cssprovider.load_from_data(bytes(css, "UTF-8"))

cssprovider.load_from_data(bytes(self.scale_css(css, scale), "UTF-8"))

def scale_css(self, ctx, ratio):
ret = ""
for token in ctx.split(" "):
if "px" in token:
pix = int(token.split("px")[0].strip())
token = str(ratio*pix)+"px"+token.split("px")[1]
ret += (token+" ")
return ret.strip()

############### logo update ###############

Expand Down

0 comments on commit 9167448

Please sign in to comment.