Fix theme apply timeout and add full HiDPI scaling for gtkTtk and GTK2
This commit is contained in:
1 parent
983d529ec3
commit
3ea7d35aba
28 files changed
+919
-299
No files matched your search
@@ -168,6 +168,16 @@ def main():
|
||||
with open(os.path.join(theme_root, "gtk-2.0/gtkrc"), encoding="utf-8") as rc2f:
|
||||
rc2_txt = rc2f.read()
|
||||
assert 'engine "' not in rc2_txt, f"External GTK2 engine referenced in {tname}"
|
||||
ui_scale = min(4.0, max(1.0, int(vals["Xft.dpi"]) / 96.0))
|
||||
for prop, base_v in (
|
||||
("GtkCheckButton::indicator-size", 14),
|
||||
("GtkRange::slider-width", 14),
|
||||
("GtkComboBox::arrow-size", 13),
|
||||
):
|
||||
expected_v = max(1, int(base_v * ui_scale + 0.5))
|
||||
assert f"{prop} = {expected_v}" in rc2_txt, (
|
||||
f"Missing HiDPI {prop} = {expected_v} in gtkrc for {tname}"
|
||||
)
|
||||
for ck in ("theme.bgMain", "theme.fgMain", "theme.selBg", "theme.accent"):
|
||||
assert vals[ck] in rc2_txt, f"Missing {ck} in gtkrc for {tname}"
|
||||
|
||||
|
||||
Reference in new issue
Block a user