|
133 | 133 | <!-- ── Inline title bar ── --> |
134 | 134 | <Border |
135 | 135 | DockPanel.Dock="Top" |
136 | | - Height="32" |
| 136 | + Height="{TemplateBinding TitleBarHeight}" |
137 | 137 | Background="{DynamicResource PipboyPrimaryDarkBrush}" |
138 | 138 | BorderBrush="{DynamicResource PipboyBorderBrush}" |
139 | 139 | BorderThickness="0,0,0,1"> |
140 | | - <Grid ColumnDefinitions="*,Auto"> |
| 140 | + <Grid ColumnDefinitions="*,Auto,Auto"> |
141 | 141 |
|
142 | | - <!-- Drag area --> |
| 142 | + <!-- Drag area (icon + title) --> |
143 | 143 | <Border |
144 | 144 | Name="PART_TitleDragArea" |
145 | 145 | Grid.Column="0" |
|
150 | 150 | VerticalAlignment="Center" |
151 | 151 | Orientation="Horizontal" |
152 | 152 | Spacing="10"> |
153 | | - <!-- Pip-Boy icon square --> |
| 153 | + <!-- Title bar icon: shows window icon when set, else Pip-Boy green square --> |
| 154 | + <Image |
| 155 | + Name="PART_TitleBarIcon" |
| 156 | + VerticalAlignment="Stretch" |
| 157 | + Margin="0,6" |
| 158 | + Stretch="Uniform" |
| 159 | + Source="{TemplateBinding TitleBarIcon}" |
| 160 | + IsVisible="{TemplateBinding TitleBarIcon, Converter={x:Static ObjectConverters.IsNotNull}}" |
| 161 | + RenderOptions.BitmapInterpolationMode="HighQuality" /> |
154 | 162 | <Border |
155 | 163 | Width="8" |
156 | 164 | Height="8" |
157 | | - Background="{DynamicResource PipboyPrimaryBrush}" /> |
| 165 | + Background="{DynamicResource PipboyPrimaryBrush}" |
| 166 | + IsVisible="{TemplateBinding TitleBarIcon, Converter={x:Static ObjectConverters.IsNull}}" /> |
158 | 167 | <!-- Title --> |
159 | 168 | <TextBlock |
160 | 169 | VerticalAlignment="Center" |
161 | 170 | FontSize="{DynamicResource PipboyFontSizeSmall}" |
162 | 171 | FontWeight="Bold" |
163 | 172 | Foreground="{DynamicResource PipboyTextBrush}" |
164 | 173 | Text="{TemplateBinding Title}" /> |
165 | | - <!-- Separator --> |
166 | | - <TextBlock |
167 | | - VerticalAlignment="Center" |
168 | | - Classes="dim" |
169 | | - FontSize="{DynamicResource PipboyFontSizeXSmall}" |
170 | | - IsVisible="{TemplateBinding TitleBarContent, Converter={x:Static ObjectConverters.IsNotNull}}" |
171 | | - Text=" ·" /> |
172 | | - <!-- Extra title bar content --> |
173 | | - <ContentPresenter |
174 | | - VerticalAlignment="Center" |
175 | | - Content="{TemplateBinding TitleBarContent}" |
176 | | - IsVisible="{TemplateBinding TitleBarContent, Converter={x:Static ObjectConverters.IsNotNull}}" /> |
177 | 174 | </StackPanel> |
178 | 175 | </Border> |
179 | 176 |
|
| 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 | + |
180 | 185 | <!-- System buttons --> |
181 | 186 | <StackPanel |
182 | | - Grid.Column="1" |
| 187 | + Grid.Column="2" |
183 | 188 | VerticalAlignment="Stretch" |
184 | 189 | Orientation="Horizontal"> |
185 | 190 | <Button |
186 | 191 | Name="PART_MinimizeButton" |
187 | 192 | Theme="{StaticResource ChromeButtonTheme}" |
| 193 | + Height="{TemplateBinding TitleBarHeight}" |
188 | 194 | Content="─" /> |
189 | 195 | <Button |
190 | 196 | Name="PART_MaxRestoreButton" |
191 | 197 | Theme="{StaticResource ChromeButtonTheme}" |
| 198 | + Height="{TemplateBinding TitleBarHeight}" |
192 | 199 | Content="□" /> |
193 | 200 | <Button |
194 | 201 | Name="PART_CloseButton" |
195 | 202 | Theme="{StaticResource ChromeCloseButtonTheme}" |
| 203 | + Height="{TemplateBinding TitleBarHeight}" |
196 | 204 | Content="✕" /> |
197 | 205 | </StackPanel> |
198 | 206 |
|
|
0 commit comments