Skip to content

Commit ef5f601

Browse files
committed
Fix UI duplication and scale oversized icons
1 parent 8d70963 commit ef5f601

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

patch_bt_input.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,21 @@ def get_high_low(addr):
126126

127127
with open(target_file, 'wb') as f:
128128
f.write(data)
129-
129+
130130
print("[+] Patch applied successfully!")
131131

132+
# 6. Minimal fix for icon duplication and theme2 oversized icon
133+
import os, glob, re
134+
usr_dir = os.path.dirname(os.path.dirname(os.path.abspath(target_file)))
135+
if os.path.exists(os.path.join(usr_dir, 'resource')):
136+
print("[*] Applying UI alignment and icon scaling fixes...")
137+
for vf in glob.glob(os.path.join(usr_dir, 'resource/layout/**/hiby_bt_input.view'), recursive=True):
138+
with open(vf, 'r') as f: c = f.read()
139+
if '"w":218' not in c:
140+
with open(vf, 'w') as f:
141+
f.write(re.sub(r'("y"\s*:\s*147\s*,)', r'\1\n\t\t\t\t"w":218,\n\t\t\t\t"h":218,', c))
142+
# ImageMagick mogrify natively scales oversized icons to fit bounds without extra large libraries
143+
os.system(f"find {usr_dir}/resource/litegui/ -name 'bt.png' -exec mogrify -resize '218x218>' {{}} + 2>/dev/null")
144+
132145
if __name__ == '__main__':
133146
main()

0 commit comments

Comments
 (0)