Skip to content

Commit 1ee8f97

Browse files
authored
ui: fix continued
1 parent d3a740e commit 1ee8f97

File tree

1 file changed

+24
-29
lines changed

1 file changed

+24
-29
lines changed

yt_audio_backup_gui.py

Lines changed: 24 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,10 @@ def _center_main_on_screen(self):
247247
return
248248
self._did_initial_center = True
249249
self.update_idletasks()
250-
w = self.winfo_width() or self.winfo_reqwidth() or 800
251-
h = self.winfo_height() or self.winfo_reqheight() or 600
252-
sw = self.winfo_screenwidth()
253-
x = int((sw - w) / 2)
254-
y = 0
255-
self.geometry(f"{w}x{h}+{x}+{y}")
250+
w = self.winfo_width() or self.winfo_reqwidth() or 820
251+
h = self.winfo_height() or self.winfo_reqheight() or 780
252+
self.geometry(f"{w}x{h}")
253+
self.state('zoomed')
256254
except Exception:
257255
pass
258256

@@ -508,29 +506,13 @@ def __init__(self) -> None:
508506
except Exception:
509507
pass
510508

511-
self._build_ui()
512-
513-
# Layout → compute size → center → show
514-
515509
try:
516-
self.update_idletasks()
517-
518-
self._center_main_on_screen()
519-
520-
self.deiconify()
521-
522-
except Exception:
523-
try:
524-
self.deiconify()
525-
526-
except Exception:
527-
pass
528-
529-
try:
530-
self.after_idle(self.refresh_i18n_ui)
510+
self._load_config()
531511
except Exception:
532512
pass
533513

514+
self._build_ui()
515+
534516
# Enforce minimum window size (height)
535517
try:
536518
self.update_idletasks()
@@ -544,10 +526,6 @@ def __init__(self) -> None:
544526
self.after(100, self._poll_log)
545527
self.after(100, self._poll_progress)
546528

547-
try:
548-
self._load_config()
549-
except Exception:
550-
pass
551529
# Apply saved locale after config load (reuse existing change_language path)
552530
try:
553531
saved_locale = None
@@ -569,6 +547,23 @@ def __init__(self) -> None:
569547
except Exception:
570548
pass
571549

550+
# Layout → compute size → center → show
551+
552+
try:
553+
self.update_idletasks()
554+
555+
self._center_main_on_screen()
556+
557+
self.deiconify()
558+
559+
except Exception:
560+
try:
561+
self.deiconify()
562+
563+
except Exception:
564+
pass
565+
566+
572567
def _build_ui(self) -> None:
573568
pad = dict(padx=8, pady=6)
574569

0 commit comments

Comments
 (0)