Skip to content

Commit 718c056

Browse files
committed
Use SharedSizeGroup in settings
1 parent f98aa57 commit 718c056

File tree

3 files changed

+20
-63
lines changed

3 files changed

+20
-63
lines changed

RetailCoder.VBE/Rubberduck.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,6 @@
554554
<DependentUpon>SearchView.xaml</DependentUpon>
555555
</Compile>
556556
<Compile Include="UI\FolderBrowser.cs" />
557-
<Compile Include="UI\GeneralConverters\EqualWidthConverter.cs" />
558557
<Compile Include="UI\IMessageBox.cs" />
559558
<Compile Include="UI\ParserErrors\ParseErrorListItem.cs" />
560559
<Compile Include="UI\Refactorings\EncapsulateFieldDialog.cs">

RetailCoder.VBE/UI/GeneralConverters/EqualWidthConverter.cs

Lines changed: 0 additions & 20 deletions
This file was deleted.

RetailCoder.VBE/UI/Settings/SettingsControl.xaml

Lines changed: 20 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,10 @@
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66
xmlns:settings="clr-namespace:Rubberduck.UI.Settings"
77
xmlns:converters="clr-namespace:Rubberduck.UI.Settings.Converters"
8-
xmlns:generalConverters="clr-namespace:Rubberduck.UI.GeneralConverters"
98
mc:Ignorable="d"
109
d:DesignHeight="300" d:DesignWidth="600"
1110
d:DataContext="{d:DesignInstance {x:Type settings:SettingsControlViewModel}, IsDesignTimeCreatable=False}">
1211
<UserControl.Resources>
13-
<generalConverters:EqualWidthConverter x:Key="EqualWidthConverter" />
14-
1512
<LinearGradientBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" EndPoint="0,1" StartPoint="0,0">
1613
<GradientStop Color="#FFD9F4FF" Offset="0"/>
1714
<GradientStop Color="#FF9BDDFB" Offset="1"/>
@@ -95,52 +92,33 @@
9592
BorderThickness="0, 1, 0, 0">
9693
<DockPanel VerticalAlignment="Center"
9794
Height="40"
98-
Background="{x:Static SystemColors.ControlDarkBrush}">
99-
<StackPanel Orientation="Horizontal"
100-
HorizontalAlignment="Right">
101-
<Button Name="ResetButton"
102-
Content="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=Settings_ResetSettings}"
95+
Background="{x:Static SystemColors.ControlDarkBrush}"
96+
Grid.IsSharedSizeScope="True">
97+
<Grid HorizontalAlignment="Right"
98+
Margin="5,0">
99+
<Grid.ColumnDefinitions>
100+
<ColumnDefinition SharedSizeGroup="SettingsButtons" />
101+
<ColumnDefinition SharedSizeGroup="SettingsButtons" />
102+
<ColumnDefinition SharedSizeGroup="SettingsButtons" />
103+
</Grid.ColumnDefinitions>
104+
<Button Content="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=Settings_ResetSettings}"
103105
Height="20"
104-
HorizontalAlignment="Right"
105-
Margin="20,0"
106-
Padding="10,0"
107-
Command="{Binding ResetButtonCommand}">
108-
<Button.MinWidth>
109-
<MultiBinding Converter="{StaticResource EqualWidthConverter}">
110-
<Binding ElementName="OkButton" Path="ActualWidth" />
111-
<Binding ElementName="CancelButton" Path="ActualWidth" />
112-
</MultiBinding>
113-
</Button.MinWidth>
114-
</Button>
115-
<Button Name="OkButton"
116-
Content="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=OK}"
106+
Margin="10,0"
107+
Padding="5,0"
108+
Command="{Binding ResetButtonCommand}" />
109+
<Button Content="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=OK}"
110+
Grid.Column="1"
117111
Height="20"
118-
HorizontalAlignment="Left"
119112
Margin="5,0"
120113
Padding="10,0"
121-
Command="{Binding OKButtonCommand}">
122-
<Button.MinWidth>
123-
<MultiBinding Converter="{StaticResource EqualWidthConverter}">
124-
<Binding ElementName="CancelButton" Path="ActualWidth" />
125-
<Binding ElementName="ResetButton" Path="ActualWidth" />
126-
</MultiBinding>
127-
</Button.MinWidth>
128-
</Button>
129-
<Button Name="CancelButton"
130-
Content="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=CancelButtonText}"
114+
Command="{Binding OKButtonCommand}" />
115+
<Button Content="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=CancelButtonText}"
116+
Grid.Column="2"
131117
Height="20"
132-
HorizontalAlignment="Right"
133118
Margin="5,0"
134119
Padding="10,0"
135-
Command="{Binding CancelButtonCommand}">
136-
<Button.MinWidth>
137-
<MultiBinding Converter="{StaticResource EqualWidthConverter}">
138-
<Binding ElementName="OkButton" Path="ActualWidth" />
139-
<Binding ElementName="ResetButton" Path="ActualWidth" />
140-
</MultiBinding>
141-
</Button.MinWidth>
142-
</Button>
143-
</StackPanel>
120+
Command="{Binding CancelButtonCommand}" />
121+
</Grid>
144122
</DockPanel>
145123
</Border>
146124
</Grid>

0 commit comments

Comments
 (0)