Skip to content

Commit 2049a49

Browse files
Merge pull request #2 from TheyCallMeErick/wip
feat: consolidate WIP stream into a clean integration commit
2 parents f870c39 + 070e980 commit 2049a49

63 files changed

Lines changed: 5301 additions & 667 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/VisualSqlArchitect.UI/App.axaml.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Avalonia;
22
using Avalonia.Controls.ApplicationLifetimes;
33
using Avalonia.Markup.Xaml;
4+
using VisualSqlArchitect.UI.Services.Theming;
45

56
namespace VisualSqlArchitect.UI;
67

@@ -10,11 +11,46 @@ public partial class App : Application
1011

1112
public override void OnFrameworkInitializationCompleted()
1213
{
14+
ApplyUserThemeIfPresent();
15+
1316
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
1417
desktop.MainWindow = new MainWindow();
1518

1619
base.OnFrameworkInitializationCompleted();
1720
}
21+
22+
private static void ApplyUserThemeIfPresent()
23+
{
24+
string path = ThemeLoader.GetDefaultThemePath();
25+
ThemeLoadResult load = ThemeLoader.LoadFromPath(path);
26+
if (load.Status == ThemeLoadStatus.NotFound)
27+
return;
28+
29+
if (load.Status != ThemeLoadStatus.Loaded || load.Config is null)
30+
{
31+
Console.WriteLine($"[Theme] fallback: {load.Status} - {load.Message}");
32+
return;
33+
}
34+
35+
ThemeValidationResult validation = ThemeValidator.Validate(load.Config);
36+
foreach (string error in validation.Errors)
37+
Console.WriteLine($"[Theme] error: {error}");
38+
foreach (string warning in validation.Warnings)
39+
Console.WriteLine($"[Theme] warning: {warning}");
40+
41+
if (!validation.IsValid)
42+
{
43+
Console.WriteLine("[Theme] fallback: invalid configuration.");
44+
return;
45+
}
46+
47+
ThemeTokenMapResult mapped = ThemeTokenMapper.Map(load.Config);
48+
foreach (string warning in mapped.Warnings)
49+
Console.WriteLine($"[Theme] warning: {warning}");
50+
51+
int applied = ThemeRuntimeApplier.ApplyToCurrentApplication(mapped.TokenOverrides);
52+
Console.WriteLine($"[Theme] loaded: applied {applied} token override(s) from {path}");
53+
}
1854
}
1955

2056
// ── Program entry point ───────────────────────────────────────────────────────

src/VisualSqlArchitect.UI/Assets/Themes/AppStyles.axaml

Lines changed: 176 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,96 @@
11
<Styles xmlns="https://github.com/avaloniaui"
2-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3+
xmlns:start="using:VisualSqlArchitect.UI.Controls.Start">
34

45
<!-- ══════════════════════════════════════════════════════════════════════════
56
GLOBAL DARK OVERRIDES
67
═══════════════════════════════════════════════════════════════════════════ -->
78

89
<!-- Window background -->
910
<Style Selector="Window">
10-
<Setter Property="Background" Value="#0D0F14"/>
11-
<Setter Property="FontFamily" Value="Segoe UI,system-ui,sans-serif"/>
12-
<Setter Property="Foreground" Value="#E8EAED"/>
11+
<Setter Property="Background" Value="{StaticResource MacroBg0Brush}"/>
12+
<Setter Property="FontFamily" Value="{StaticResource UIFont}"/>
13+
<Setter Property="Foreground" Value="{StaticResource TextPrimaryBrush}"/>
14+
</Style>
15+
16+
<!-- Semantic text roles -->
17+
<Style Selector="TextBlock.txt-display">
18+
<Setter Property="FontSize" Value="{StaticResource FontSizeDisplay}"/>
19+
<Setter Property="FontWeight" Value="{StaticResource FontWeightStrong}"/>
20+
<Setter Property="Foreground" Value="{StaticResource TextPrimaryBrush}"/>
21+
</Style>
22+
<Style Selector="TextBlock.txt-title">
23+
<Setter Property="FontSize" Value="{StaticResource FontSizeTitle}"/>
24+
<Setter Property="FontWeight" Value="{StaticResource FontWeightStrong}"/>
25+
<Setter Property="Foreground" Value="{StaticResource TextPrimaryBrush}"/>
26+
</Style>
27+
<Style Selector="TextBlock.txt-body">
28+
<Setter Property="FontSize" Value="{StaticResource FontSizeBody}"/>
29+
<Setter Property="Foreground" Value="{StaticResource TextPrimaryBrush}"/>
30+
</Style>
31+
<Style Selector="TextBlock.txt-meta">
32+
<Setter Property="FontSize" Value="{StaticResource FontSizeMeta}"/>
33+
<Setter Property="Foreground" Value="{StaticResource TextSecondaryBrush}"/>
34+
</Style>
35+
36+
<!-- Reusable shell header -->
37+
<Style Selector="Border.app-header-shell">
38+
<Setter Property="Background" Value="{StaticResource MacroBg1Brush}"/>
39+
<Setter Property="BorderBrush" Value="{StaticResource MacroBorderSubtleBrush}"/>
40+
<Setter Property="BorderThickness" Value="0,0,0,1"/>
41+
<Setter Property="Padding" Value="12,6"/>
42+
</Style>
43+
44+
<Style Selector="Button.app-window-btn">
45+
<Setter Property="Background" Value="Transparent"/>
46+
<Setter Property="BorderThickness" Value="0"/>
47+
<Setter Property="Foreground" Value="{StaticResource TextSecondaryBrush}"/>
48+
<Setter Property="CornerRadius" Value="6"/>
49+
<Setter Property="Cursor" Value="Hand"/>
50+
</Style>
51+
<Style Selector="Button.app-window-btn:pointerover">
52+
<Setter Property="Background" Value="{StaticResource MacroBg2Brush}"/>
53+
<Setter Property="Foreground" Value="{StaticResource TextPrimaryBrush}"/>
54+
</Style>
55+
<Style Selector="Button.app-window-btn.app-window-btn-danger:pointerover">
56+
<Setter Property="Background" Value="{StaticResource BtnDangerBgBrush}"/>
57+
<Setter Property="Foreground" Value="{StaticResource BtnDangerFgBrush}"/>
58+
</Style>
59+
60+
<Style Selector="Button.app-header-title-btn">
61+
<Setter Property="Background" Value="Transparent"/>
62+
<Setter Property="BorderThickness" Value="0"/>
63+
<Setter Property="Padding" Value="0"/>
64+
<Setter Property="Foreground" Value="{StaticResource TextPrimaryBrush}"/>
65+
<Setter Property="FontSize" Value="{StaticResource FontSizeTitle}"/>
66+
<Setter Property="FontWeight" Value="{StaticResource FontWeightStrong}"/>
67+
<Setter Property="Cursor" Value="Hand"/>
68+
</Style>
69+
<Style Selector="Button.app-header-title-btn:pointerover">
70+
<Setter Property="Foreground" Value="{StaticResource AccentBlueBrush}"/>
71+
</Style>
72+
73+
<!-- Editor title menu -->
74+
<Style Selector="ContextMenu.app-title-menu">
75+
<Setter Property="Background" Value="{StaticResource MacroBg1Brush}"/>
76+
<Setter Property="BorderBrush" Value="{StaticResource MacroBorderSubtleBrush}"/>
77+
<Setter Property="BorderThickness" Value="1"/>
78+
<Setter Property="Padding" Value="6"/>
79+
</Style>
80+
<Style Selector="MenuItem.app-title-menu-item">
81+
<Setter Property="Background" Value="Transparent"/>
82+
<Setter Property="Foreground" Value="{StaticResource TextPrimaryBrush}"/>
83+
<Setter Property="BorderThickness" Value="0"/>
84+
<Setter Property="Padding" Value="10,8"/>
85+
<Setter Property="FontSize" Value="{StaticResource FontSizeBody}"/>
86+
</Style>
87+
<Style Selector="MenuItem.app-title-menu-item:pointerover">
88+
<Setter Property="Background" Value="{StaticResource MacroBg2Brush}"/>
89+
<Setter Property="Foreground" Value="{StaticResource AccentBlueBrush}"/>
90+
</Style>
91+
<Style Selector="Separator.app-title-menu-sep">
92+
<Setter Property="Background" Value="{StaticResource MacroBorderSubtleBrush}"/>
93+
<Setter Property="Margin" Value="6,4"/>
1394
</Style>
1495

1596
<!-- ── TextBox ─────────────────────────────────────────────────────────── -->
@@ -28,6 +109,23 @@
28109
<Setter Property="Foreground" Value="#4A5568"/>
29110
</Style>
30111

112+
<Style Selector="TextBox.sidebar-input">
113+
<Setter Property="VerticalContentAlignment" Value="Center"/>
114+
<Setter Property="FontSize" Value="{StaticResource FontSizeBody}"/>
115+
<Setter Property="Foreground" Value="{StaticResource TextPrimaryBrush}"/>
116+
<Setter Property="Padding" Value="6,0,0,0"/>
117+
<Setter Property="MinHeight" Value="24"/>
118+
</Style>
119+
<Style Selector="TextBox.sidebar-input /template/ TextBlock#PART_Watermark">
120+
<Setter Property="Foreground" Value="{StaticResource TextSecondaryBrush}"/>
121+
<Setter Property="VerticalAlignment" Value="Center"/>
122+
</Style>
123+
<Style Selector="TextBox.sidebar-input:focus-visible /template/ Border#PART_BorderElement">
124+
<Setter Property="BorderBrush" Value="{StaticResource BorderActiveBrush}"/>
125+
<Setter Property="BorderThickness" Value="1"/>
126+
<Setter Property="Background" Value="{StaticResource MacroBg3Brush}"/>
127+
</Style>
128+
31129
<!-- ── Button ─────────────────────────────────────────────────────────── -->
32130
<Style Selector="Button">
33131
<Setter Property="CornerRadius" Value="7"/>
@@ -38,6 +136,66 @@
38136
</Setter>
39137
</Style>
40138

139+
<!-- Semantic button variants -->
140+
<Style Selector="Button.primary">
141+
<Setter Property="Background" Value="{StaticResource BtnPrimaryBgBrush}"/>
142+
<Setter Property="Foreground" Value="{StaticResource BtnPrimaryFgBrush}"/>
143+
<Setter Property="BorderBrush" Value="{StaticResource AccentBlueBrush}"/>
144+
<Setter Property="BorderThickness" Value="1"/>
145+
<Setter Property="FontWeight" Value="{StaticResource FontWeightAction}"/>
146+
</Style>
147+
<Style Selector="Button.secondary">
148+
<Setter Property="Background" Value="{StaticResource BtnSecondaryBgBrush}"/>
149+
<Setter Property="Foreground" Value="{StaticResource BtnSecondaryFgBrush}"/>
150+
<Setter Property="BorderBrush" Value="{StaticResource MacroBorderSubtleBrush}"/>
151+
<Setter Property="BorderThickness" Value="1"/>
152+
</Style>
153+
<Style Selector="Button.info">
154+
<Setter Property="Background" Value="{StaticResource BtnInfoBgBrush}"/>
155+
<Setter Property="Foreground" Value="{StaticResource BtnInfoFgBrush}"/>
156+
<Setter Property="BorderBrush" Value="{StaticResource AccentBlueBrush}"/>
157+
<Setter Property="BorderThickness" Value="1"/>
158+
</Style>
159+
<Style Selector="Button.success">
160+
<Setter Property="Background" Value="{StaticResource BtnSuccessBgBrush}"/>
161+
<Setter Property="Foreground" Value="{StaticResource BtnSuccessFgBrush}"/>
162+
<Setter Property="BorderBrush" Value="#22C55E"/>
163+
<Setter Property="BorderThickness" Value="1"/>
164+
</Style>
165+
<Style Selector="Button.warning">
166+
<Setter Property="Background" Value="{StaticResource BtnWarningBgBrush}"/>
167+
<Setter Property="Foreground" Value="{StaticResource BtnWarningFgBrush}"/>
168+
<Setter Property="BorderBrush" Value="#F97316"/>
169+
<Setter Property="BorderThickness" Value="1"/>
170+
</Style>
171+
<Style Selector="Button.danger">
172+
<Setter Property="Background" Value="{StaticResource BtnDangerBgBrush}"/>
173+
<Setter Property="Foreground" Value="{StaticResource BtnDangerFgBrush}"/>
174+
<Setter Property="BorderBrush" Value="#FB7185"/>
175+
<Setter Property="BorderThickness" Value="1"/>
176+
</Style>
177+
<Style Selector="Button.ghost">
178+
<Setter Property="Background" Value="{StaticResource BtnGhostBgBrush}"/>
179+
<Setter Property="Foreground" Value="{StaticResource BtnGhostFgBrush}"/>
180+
<Setter Property="BorderBrush" Value="{StaticResource MacroBorderSubtleBrush}"/>
181+
<Setter Property="BorderThickness" Value="1"/>
182+
</Style>
183+
184+
<!-- Disabled state baseline for contrast/readability in dark shell -->
185+
<Style Selector="Button:disabled">
186+
<Setter Property="Opacity" Value="0.62"/>
187+
<Setter Property="Background" Value="{StaticResource MacroBg1Brush}"/>
188+
<Setter Property="Foreground" Value="{StaticResource TextSecondaryBrush}"/>
189+
<Setter Property="BorderBrush" Value="{StaticResource MacroBorderSubtleBrush}"/>
190+
<Setter Property="BorderThickness" Value="1"/>
191+
</Style>
192+
193+
<Style Selector="ToggleButton:disabled">
194+
<Setter Property="Opacity" Value="0.62"/>
195+
<Setter Property="Foreground" Value="{StaticResource TextSecondaryBrush}"/>
196+
<Setter Property="BorderBrush" Value="{StaticResource MacroBorderSubtleBrush}"/>
197+
</Style>
198+
41199
<!-- ── Keyboard focus ring ─────────────────────────────────────────────── -->
42200
<!-- Shown only when focused via keyboard (:focus-visible), not mouse click -->
43201
<Style Selector="Button:focus-visible">
@@ -58,6 +216,11 @@
58216
<Setter Property="BorderThickness" Value="1"/>
59217
</Style>
60218

219+
<Style Selector="ToggleButton:focus-visible">
220+
<Setter Property="BorderBrush" Value="{StaticResource BorderActiveBrush}"/>
221+
<Setter Property="BorderThickness" Value="1"/>
222+
</Style>
223+
61224
<!-- ── ScrollBar (minimal) ─────────────────────────────────────────────── -->
62225
<Style Selector="ScrollBar">
63226
<Setter Property="Background" Value="Transparent"/>
@@ -146,4 +309,13 @@
146309
<Setter Property="Background" Value="#252C3F"/>
147310
</Style>
148311

312+
<!-- ── Start Menu typography consistency ─────────────────────────────── -->
313+
<Style Selector="start|StartMenuControl TextBlock">
314+
<Setter Property="FontFamily" Value="{StaticResource UIFont}"/>
315+
</Style>
316+
317+
<Style Selector="start|RecentProjectCard TextBlock, start|TemplateCard TextBlock, start|ConnectionStatusCard TextBlock">
318+
<Setter Property="FontFamily" Value="{StaticResource UIFont}"/>
319+
</Style>
320+
149321
</Styles>

0 commit comments

Comments
 (0)