Private
Public Access
0
0

feat(theme): fix table row backgrounds and hub text contrast

This commit is contained in:
2026-06-05 00:52:28 -04:00
parent e3f8a2b517
commit 98acc12811
10 changed files with 23 additions and 8 deletions
+9 -8
View File
@@ -4673,15 +4673,16 @@ def render_heavy_text(app: App, label: str, content: str, id_suffix: str = "") -
ctx_id = f"{label}_{id_suffix}"
is_md = label in ('message', 'text', 'content', 'system')
with imscope.indent():
with imscope.child(f"heavy_text_child_{label}_{id_suffix}", imgui.ImVec2(0, 300), imgui.WindowFlags_.always_vertical_scrollbar):
if is_md:
markdown_helper.render(content, context_id=ctx_id)
else:
if app.ui_word_wrap:
with imscope.text_wrap(imgui.get_content_region_avail().x):
imgui.text(content)
with imscope.style_color(imgui.Col_.child_bg, theme.get_table_color(is_alt=True)):
with imscope.child(f"heavy_text_child_{label}_{id_suffix}", imgui.ImVec2(0, 300), imgui.WindowFlags_.always_vertical_scrollbar):
if is_md:
markdown_helper.render(content, context_id=ctx_id)
else:
imgui.text(content)
if app.ui_word_wrap:
with imscope.text_wrap(imgui.get_content_region_avail().x):
imgui.text_colored(theme.get_color("text"), content)
else:
imgui.text_colored(theme.get_color("text"), content)
#endregion: Misc Tools
+6
View File
@@ -139,6 +139,11 @@ def set_child_transparency(val: float) -> None:
_child_transparency = val
apply(_current_palette)
def get_table_color(is_alt: bool = False, alpha: float = 1.0) -> imgui.ImVec4:
"""Returns a tone-mapped table row background color."""
key = "table_row_bg_alt" if is_alt else "table_row_bg"
return get_color(key, alpha=alpha)
def get_color(name: str, alpha: float = 1.0) -> imgui.ImVec4:
"""Return a tone-mapped semantic color from the current palette."""
palette_name = _current_palette
@@ -165,6 +170,7 @@ def get_color(name: str, alpha: float = 1.0) -> imgui.ImVec4:
"diff_added": (51, 230, 51),
"diff_removed": (230, 51, 51),
"diff_header": (77, 178, 255),
"table_header_text": (255, 255, 255),
}
if name in fallbacks:
rgb = fallbacks[name]
+1
View File
@@ -67,6 +67,7 @@ tab_selected_overline = [100, 100, 100]
table_border_light = [ 50, 47, 42]
table_border_strong = [ 70, 65, 55]
table_header_bg = [ 55, 50, 38]
table_header_text = [255, 255, 255]
table_row_bg = [ 0, 0, 0]
table_row_bg_alt = [ 40, 38, 34]
text = [200, 200, 200]
+1
View File
@@ -67,6 +67,7 @@ tab_selected_overline = [100, 100, 100]
table_border_light = [ 40, 40, 40]
table_border_strong = [ 60, 60, 60]
table_header_bg = [ 55, 55, 55]
table_header_text = [ 0, 0, 0]
table_row_bg = [250, 250, 250]
table_row_bg_alt = [235, 235, 235]
text = [ 0, 0, 0]
+1
View File
@@ -67,6 +67,7 @@ tab_selected_overline = [100, 100, 100]
table_border_light = [ 40, 40, 40]
table_border_strong = [ 60, 60, 60]
table_header_bg = [ 60, 56, 54]
table_header_text = [255, 255, 255]
table_row_bg = [ 0, 0, 0]
table_row_bg_alt = [ 10, 10, 10]
text = [251, 241, 199]
+1
View File
@@ -67,6 +67,7 @@ tab_selected_overline = [100, 100, 100]
table_border_light = [ 55, 56, 48]
table_border_strong = [ 73, 72, 62]
table_header_bg = [ 60, 61, 52]
table_header_text = [255, 255, 255]
table_row_bg = [ 0, 0, 0]
table_row_bg_alt = [ 50, 51, 44]
text = [248, 248, 242]
+1
View File
@@ -67,6 +67,7 @@ tab_selected_overline = [100, 100, 100]
table_border_light = [ 40, 40, 40]
table_border_strong = [ 60, 60, 60]
table_header_bg = [ 50, 70, 80]
table_header_text = [255, 255, 255]
table_row_bg = [ 0, 0, 0]
table_row_bg_alt = [ 10, 10, 10]
text = [255, 255, 255]
+1
View File
@@ -67,6 +67,7 @@ tab_selected_overline = [100, 100, 100]
table_border_light = [ 59, 66, 82]
table_border_strong = [ 76, 86, 106]
table_header_bg = [ 59, 66, 82]
table_header_text = [255, 255, 255]
table_row_bg = [ 0, 0, 0]
table_row_bg_alt = [ 46, 52, 64]
text = [216, 222, 233]
+1
View File
@@ -67,6 +67,7 @@ tab_selected_overline = [100, 100, 100]
table_border_light = [ 40, 40, 40]
table_border_strong = [ 60, 60, 60]
table_header_bg = [ 7, 54, 66]
table_header_text = [255, 255, 255]
table_row_bg = [ 0, 0, 0]
table_row_bg_alt = [ 10, 10, 10]
text = [147, 161, 161]
+1
View File
@@ -67,6 +67,7 @@ tab_selected_overline = [100, 100, 100]
table_border_light = [ 40, 40, 40]
table_border_strong = [ 60, 60, 60]
table_header_bg = [238, 232, 213]
table_header_text = [ 0, 0, 0]
table_row_bg = [250, 250, 250]
table_row_bg_alt = [235, 235, 235]
text = [ 7, 54, 66]