aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorblasty <blasty@local>2026-07-25 11:58:09 +0200
committerblasty <blasty@local>2026-07-25 11:58:09 +0200
commit3c1b95985cab0cd840aee32856fa45a84cc7f7e6 (patch)
tree8990cd8dc01a7ff107596195498aca7fd0413d76
parentui: centre the strings and project palettes (were clamped top-left) (diff)
downloadida-tui-3c1b95985cab0cd840aee32856fa45a84cc7f7e6.tar.gz
ida-tui-3c1b95985cab0cd840aee32856fa45a84cc7f7e6.tar.xz
ida-tui-3c1b95985cab0cd840aee32856fa45a84cc7f7e6.zip
ui: horizontally centre the splash logo in the loading dialog
The art rendered flush against the left of the box (inset 3, with 9 to spare on the right). #loading-box's align-horizontal couldn't fix it: the 1fr title/note siblings make the child group span the full content width, so container alignment has nothing left to centre. Text justify="center" doesn't do it either — no_wrap bypasses the justification pass. Wrap the logo in rich.align.Align.center and give the widget width: 100%. Measured: the strip is now the full 66-cell content width with the 60-wide art padded 3/3.
-rw-r--r--idatui/app.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/idatui/app.py b/idatui/app.py
index 568601e..813a774 100644
--- a/idatui/app.py
+++ b/idatui/app.py
@@ -22,6 +22,7 @@ import re
import subprocess
from dataclasses import dataclass, field
+from rich.align import Align
from rich.segment import Segment
from rich.style import Style
from rich.text import Text
@@ -2388,7 +2389,10 @@ class LoadingScreen(ModalScreen):
sz = self.app.size
n = len(logo.split("\n"))
if sz.height >= n + 9 and sz.width >= 64:
- yield Static(logo, id="loading-logo")
+ # Align.center, not the box's align-horizontal: the 1fr
+ # title/note siblings make the child group span the full
+ # width, so container alignment has nothing left to centre.
+ yield Static(Align.center(logo), id="loading-logo")
yield Static(f"\u23f3 loading {self._title}", id="loading-title")
yield Static(self._note, id="loading-note")
yield Static("first open of a big binary can take a while \u00b7 "
@@ -2802,8 +2806,8 @@ class IdaTui(App):
#confirm-help { height: 1; color: $text-muted; margin-top: 1; }
LoadingScreen { align: center middle; }
#loading-box { width: 72; height: auto; border: thick $accent;
- background: $panel; padding: 1 2; align-horizontal: center; }
- #loading-logo { width: auto; height: auto; margin-bottom: 1; }
+ background: $panel; padding: 1 2; }
+ #loading-logo { width: 100%; height: auto; margin-bottom: 1; }
#loading-title { width: 1fr; height: 1; text-style: bold; }
#loading-note { height: auto; color: $text-muted; margin-top: 1; }
#loading-help { height: auto; color: $text-muted; margin-top: 1; }