Skip to content

Commit d520163

Browse files
committed
first cut of toolbars
1 parent ddf9eb9 commit d520163

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

MaterialDesignColors.WpfExample/ProvingGround.xaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,6 @@
184184
<ToggleButton>
185185
Switch
186186
</ToggleButton>
187-
<Menu>
188-
<MenuItem>Embedded menu</MenuItem>
189-
</Menu>
190187
</ToolBar>
191188
</ToolBarTray>
192189
</DockPanel>

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.ToolBar.xaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<Setter.Value>
5454
<ControlTemplate TargetType="{x:Type ToggleButton}">
5555
<Border x:Name="Bd" Background="{TemplateBinding Background}" CornerRadius="0,3,3,0" SnapsToDevicePixels="true">
56-
<Viewbox Width="16" Height="16">
56+
<Viewbox Width="16" Height="16" Margin="8 0 8 0">
5757
<Canvas Width="24" Height="24">
5858
<Path Data="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z" Fill="{TemplateBinding Foreground}" />
5959
</Canvas>
@@ -122,8 +122,8 @@
122122
<Setter Property="Template">
123123
<Setter.Value>
124124
<ControlTemplate TargetType="{x:Type ToolBar}">
125-
<Grid x:Name="Grid" Margin="3,1,1,1" SnapsToDevicePixels="true">
126-
<Grid x:Name="OverflowGrid" HorizontalAlignment="Right">
125+
<DockPanel x:Name="Grid" Margin="3,1,1,1" SnapsToDevicePixels="true" Background="{TemplateBinding Background}">
126+
<Grid DockPanel.Dock="Right" x:Name="OverflowGrid" HorizontalAlignment="Right">
127127
<ToggleButton x:Name="OverflowButton" ClickMode="Press" FocusVisualStyle="{x:Null}" IsChecked="{Binding IsOverflowOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" IsEnabled="{TemplateBinding HasOverflowItems}" Style="{StaticResource ToolBarHorizontalOverflowButtonStyle}"
128128
/>
129129
<Popup x:Name="OverflowPopup" AllowsTransparency="true" Focusable="false" IsOpen="{Binding IsOverflowOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom" StaysOpen="false" Margin="1">
@@ -137,14 +137,14 @@
137137
</Border>
138138
</Popup>
139139
</Grid>
140-
<Border x:Name="MainPanelBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="Yellow" Padding="{TemplateBinding Padding}" Style="{StaticResource ToolBarMainPanelBorderStyle}">
140+
<Border x:Name="MainPanelBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" Style="{StaticResource ToolBarMainPanelBorderStyle}">
141141
<DockPanel KeyboardNavigation.TabIndex="1" KeyboardNavigation.TabNavigation="Local">
142142
<Thumb x:Name="ToolBarThumb" Margin="-3,-1,0,0" Padding="6,5,1,6" Style="{StaticResource ToolBarThumbStyle}" Width="10"/>
143143
<ContentPresenter x:Name="ToolBarHeader" ContentSource="Header" HorizontalAlignment="Center" Margin="4,0,4,0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center"/>
144144
<ToolBarPanel x:Name="PART_ToolBarPanel" IsItemsHost="true" Margin="0,1,2,2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
145145
</DockPanel>
146146
</Border>
147-
</Grid>
147+
</DockPanel>
148148
<ControlTemplate.Triggers>
149149
<Trigger Property="IsOverflowOpen" Value="true">
150150
<Setter Property="IsEnabled" TargetName="ToolBarThumb" Value="false"/>

0 commit comments

Comments
 (0)