Skip to content

Commit e780db6

Browse files
NeverMorewdclaude
andcommitted
feat: move TitleBarContent to its own Grid column for right-alignment
TitleBarContent was inside the drag area StackPanel, making HorizontalAlignment="Right" ineffective. Restructured the title bar Grid from 2 columns (*,Auto) to 3 columns (*,Auto,Auto), giving TitleBarContent its own Auto column between the title and system buttons so it naturally sits flush against the minimize button. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 3dbad66 commit e780db6

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

src/Pipboy.Avalonia/Styles/Controls/Window.axaml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@
137137
Background="{DynamicResource PipboyPrimaryDarkBrush}"
138138
BorderBrush="{DynamicResource PipboyBorderBrush}"
139139
BorderThickness="0,0,0,1">
140-
<Grid ColumnDefinitions="*,Auto">
140+
<Grid ColumnDefinitions="*,Auto,Auto">
141141

142-
<!-- Drag area -->
142+
<!-- Drag area (icon + title) -->
143143
<Border
144144
Name="PART_TitleDragArea"
145145
Grid.Column="0"
@@ -152,6 +152,7 @@
152152
Spacing="10">
153153
<!-- Title bar icon: shows window icon when set, else Pip-Boy green square -->
154154
<Image
155+
Name="PART_TitleBarIcon"
155156
VerticalAlignment="Stretch"
156157
Margin="0,6"
157158
Stretch="Uniform"
@@ -170,24 +171,20 @@
170171
FontWeight="Bold"
171172
Foreground="{DynamicResource PipboyTextBrush}"
172173
Text="{TemplateBinding Title}" />
173-
<!-- Separator -->
174-
<TextBlock
175-
VerticalAlignment="Center"
176-
Classes="dim"
177-
FontSize="{DynamicResource PipboyFontSizeXSmall}"
178-
IsVisible="{TemplateBinding TitleBarContent, Converter={x:Static ObjectConverters.IsNotNull}}"
179-
Text=" ·" />
180-
<!-- Extra title bar content -->
181-
<ContentPresenter
182-
VerticalAlignment="Center"
183-
Content="{TemplateBinding TitleBarContent}"
184-
IsVisible="{TemplateBinding TitleBarContent, Converter={x:Static ObjectConverters.IsNotNull}}" />
185174
</StackPanel>
186175
</Border>
187176

177+
<!-- Extra title bar content — right-aligned, beside system buttons -->
178+
<ContentPresenter
179+
Grid.Column="1"
180+
VerticalAlignment="Center"
181+
Margin="0,0,4,0"
182+
Content="{TemplateBinding TitleBarContent}"
183+
IsVisible="{TemplateBinding TitleBarContent, Converter={x:Static ObjectConverters.IsNotNull}}" />
184+
188185
<!-- System buttons -->
189186
<StackPanel
190-
Grid.Column="1"
187+
Grid.Column="2"
191188
VerticalAlignment="Stretch"
192189
Orientation="Horizontal">
193190
<Button

0 commit comments

Comments
 (0)