Skip to content

Commit de988d6

Browse files
committed
* Added theme settings design
* Added functionality behind theme settings
1 parent bb8748c commit de988d6

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

MemPlus/Windows/SettingsWindow.xaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,38 @@
130130
<syncfusion:TabItemExt Header="Theme"
131131
Image="../Resources/Images/home.png"
132132
ImageWidth="16" ImageHeight="16">
133+
<Grid VerticalAlignment="Center" HorizontalAlignment="Center">
134+
<Grid.RowDefinitions>
135+
<RowDefinition Height="Auto"></RowDefinition>
136+
<RowDefinition Height="Auto"></RowDefinition>
137+
<RowDefinition Height="Auto"></RowDefinition>
138+
</Grid.RowDefinitions>
139+
<Grid.ColumnDefinitions>
140+
<ColumnDefinition></ColumnDefinition>
141+
<ColumnDefinition></ColumnDefinition>
142+
</Grid.ColumnDefinitions>
143+
<Label Margin="3" Content="Style:"></Label>
144+
<ComboBox Margin="3" x:Name="CboStyle" SelectedValuePath="Content" Grid.Row="0" Grid.Column="1" IsReadOnly="True">
145+
<ComboBoxItem>Metro</ComboBoxItem>
146+
<ComboBoxItem>Blend</ComboBoxItem>
147+
<ComboBoxItem>VS2010</ComboBoxItem>
148+
<ComboBoxItem>Office2003</ComboBoxItem>
149+
<ComboBoxItem>Office2007Blue</ComboBoxItem>
150+
<ComboBoxItem>Office2007Black</ComboBoxItem>
151+
<ComboBoxItem>Office2007Silver</ComboBoxItem>
152+
<ComboBoxItem>Office2010Blue</ComboBoxItem>
153+
<ComboBoxItem>Office2010Black</ComboBoxItem>
154+
<ComboBoxItem>Office2010Silver</ComboBoxItem>
155+
<ComboBoxItem>ShinyRed</ComboBoxItem>
156+
<ComboBoxItem>ShinyBlue</ComboBoxItem>
157+
<ComboBoxItem>SyncOrange</ComboBoxItem>
158+
<ComboBoxItem>Transparent</ComboBoxItem>
159+
</ComboBox>
160+
<Label Margin="3" Grid.Row="1" Grid.Column="0" Content="Metro brush:"></Label>
161+
<syncfusion:ColorPicker Margin="3" x:Name="CpMetroBrush" Grid.Row="1" Grid.Column="1" />
162+
<Label Margin="3" Grid.Row="2" Grid.Column="0" Content="Border thickness:"></Label>
163+
<syncfusion:IntegerTextBox Margin="3" x:Name="IntBorderThickness" Grid.Row="2" Grid.Column="1" MinValue="0"></syncfusion:IntegerTextBox>
164+
</Grid>
133165

134166
</syncfusion:TabItemExt>
135167
</syncfusion:TabControlExt>

MemPlus/Windows/SettingsWindow.xaml.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ private void LoadProperties()
6363
ChbFileSystemCache.IsChecked = Properties.Settings.Default.FileSystemCache;
6464
ChbStandByCache.IsChecked = Properties.Settings.Default.StandByCache;
6565

66+
//Theme
67+
CboStyle.Text = Properties.Settings.Default.VisualStyle;
68+
CpMetroBrush.Color = Properties.Settings.Default.MetroColor;
69+
IntBorderThickness.Value = Properties.Settings.Default.BorderThickness;
70+
6671
_logController.AddLog(new ApplicationLog("Done loading SettingsWindow properties"));
6772
}
6873

@@ -82,10 +87,17 @@ private void SaveProperties()
8287
if (ChbFileSystemCache.IsChecked != null) Properties.Settings.Default.FileSystemCache = ChbFileSystemCache.IsChecked.Value;
8388
if (ChbStandByCache.IsChecked != null) Properties.Settings.Default.StandByCache = ChbStandByCache.IsChecked.Value;
8489

90+
//Theme
91+
Properties.Settings.Default.VisualStyle = CboStyle.Text;
92+
93+
Properties.Settings.Default.MetroColor = CpMetroBrush.Color;
94+
if (IntBorderThickness.Value != null) Properties.Settings.Default.BorderThickness = (int)IntBorderThickness.Value;
95+
8596
Properties.Settings.Default.Save();
8697

8798
_mainWindow.ChangeVisualStyle();
8899
_mainWindow.LoadProperties();
100+
ChangeVisualStyle();
89101

90102
_logController.AddLog(new ApplicationLog("Properties have been saved"));
91103

0 commit comments

Comments
 (0)