mirror of
https://git.vladimir.cc/vladimir/ewsdr.git
synced 2026-08-25 20:37:33 +00:00
feat(overlay): flat themed buttons + full theme support for slice flags
Share one button paint routine: extract TFlatButton.Paint into PaintFlatButton(canvas, rect, colors) and call it from both TFlatButton and VfoOverlay.DrawButton — flag buttons now render identically to the left panel (flat fill + border, no gloss), using theme Btn* colors. Theme the whole flag card: the structural CLR_* palette (card bg, border, text, dim, accents, freq, meter bg) is now derived from the active TAppTheme via ApplyThemeColors, so flags follow light/dark like the rest of the UI. Status accents (TX/SPLIT) stay fixed on purpose and use a fixed dark text over their bright badges. Theme is pushed to flags from ApplyDarkTheme and on creation via WireOverlayEvents. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -2853,6 +2853,11 @@ begin
|
||||
FSpecView.SetTheme(T);
|
||||
if Assigned(FWidebandView) then FWidebandView.SetTheme(T);
|
||||
|
||||
// Флаги слайсов (оверлеи) — цвета кнопок из темы, как левая панель.
|
||||
if Assigned(FVfoOverlay) then FVfoOverlay.SetTheme(T);
|
||||
for i := 0 to High(FSliceFlags) do
|
||||
if Assigned(FSliceFlags[i]) then FSliceFlags[i].SetTheme(T);
|
||||
|
||||
// VFO display — вызывает UpdateVfoDisplay, который использует тему
|
||||
UpdateVfoDisplay;
|
||||
end;
|
||||
@@ -5451,6 +5456,8 @@ begin
|
||||
O.OnSliceSelect := OnVfoOverlaySliceSelect;
|
||||
O.OnClose := OnVfoOverlayClose;
|
||||
O.OnInvalidate := OnVfoOverlayInvalidate;
|
||||
// Актуальная тема (цвета кнопок флага = как на левой панели).
|
||||
if FLightTheme then O.SetTheme(LightTheme) else O.SetTheme(DarkTheme);
|
||||
end;
|
||||
|
||||
function TMainForm.FindSliceFlag(SliceId: Integer): TVfoOverlay;
|
||||
|
||||
Reference in New Issue
Block a user