feat(theme): Integrate NERV theme and visual effects into main GUI

This commit is contained in:
2026-03-09 00:58:22 -04:00
parent d9495f6e23
commit afcb1bf758
2 changed files with 18 additions and 0 deletions

View File

@@ -15,6 +15,7 @@ from src import session_logger
from src import project_manager from src import project_manager
from src import paths from src import paths
from src import theme_2 as theme from src import theme_2 as theme
from src import theme_nerv_fx as theme_fx
from src import api_hooks from src import api_hooks
import numpy as np import numpy as np
from src import log_registry from src import log_registry
@@ -130,6 +131,9 @@ class App:
self._token_stats: dict[str, Any] = {} self._token_stats: dict[str, Any] = {}
self._token_stats_dirty: bool = True self._token_stats_dirty: bool = True
self.perf_history: dict[str, list] = {"frame_time": [0.0] * 100, "fps": [0.0] * 100} self.perf_history: dict[str, list] = {"frame_time": [0.0] * 100, "fps": [0.0] * 100}
self._nerv_scanlines = theme_fx.ScanlineOverlay()
self._nerv_alert = theme_fx.AlertPulsing()
self._nerv_flicker = theme_fx.StatusFlicker()
def _handle_approve_tool(self, user_data=None) -> None: def _handle_approve_tool(self, user_data=None) -> None:
"""UI-level wrapper for approving a pending tool execution ask.""" """UI-level wrapper for approving a pending tool execution ask."""
@@ -294,6 +298,12 @@ class App:
ws = imgui.get_io().display_size ws = imgui.get_io().display_size
bg.render(ws.x, ws.y) bg.render(ws.x, ws.y)
if theme.is_nerv_active():
ws = imgui.get_io().display_size
self._nerv_alert.update(self.ai_status)
self._nerv_alert.render(ws.x, ws.y)
self._nerv_scanlines.render(ws.x, ws.y)
pushed_prior_tint = False pushed_prior_tint = False
if self.perf_profiling_enabled: self.perf_monitor.start_component("_gui_func") if self.perf_profiling_enabled: self.perf_monitor.start_component("_gui_func")
if self.is_viewing_prior_session: if self.is_viewing_prior_session:

View File

@@ -10,6 +10,7 @@ Scale uses imgui.get_style().font_scale_main.
from imgui_bundle import imgui, hello_imgui from imgui_bundle import imgui, hello_imgui
from typing import Any, Optional from typing import Any, Optional
import src.theme_nerv
# ------------------------------------------------------------------ palettes # ------------------------------------------------------------------ palettes
@@ -22,6 +23,7 @@ def _c(r: int, g: int, b: int, a: int = 255) -> tuple[float, float, float, float
_PALETTES: dict[str, dict[int, tuple]] = { _PALETTES: dict[str, dict[int, tuple]] = {
"ImGui Dark": {}, # empty = use imgui dark defaults "ImGui Dark": {}, # empty = use imgui dark defaults
"NERV": {},
"10x Dark": { "10x Dark": {
imgui.Col_.window_bg: _c( 34, 32, 28), imgui.Col_.window_bg: _c( 34, 32, 28),
imgui.Col_.child_bg: _c( 30, 28, 24), imgui.Col_.child_bg: _c( 30, 28, 24),
@@ -239,6 +241,9 @@ _child_transparency: float = 1.0
def get_current_palette() -> str: def get_current_palette() -> str:
return _current_palette return _current_palette
def is_nerv_active() -> bool:
return _current_palette == "NERV"
def get_current_font_path() -> str: def get_current_font_path() -> str:
return _current_font_path return _current_font_path
@@ -270,6 +275,9 @@ def apply(palette_name: str) -> None:
""" """
global _current_palette global _current_palette
_current_palette = palette_name _current_palette = palette_name
if palette_name == 'NERV':
src.theme_nerv.apply_nerv()
return
# 1. Apply base colors # 1. Apply base colors
if palette_name in _PALETTES: if palette_name in _PALETTES: