Skip to content

Commit ed80d96

Browse files
committed
apply theme editor colors to mainwindow while adjust colors
1 parent 45f3b4e commit ed80d96

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

UnityLauncherPro/MainWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@
948948
<CheckBox x:Name="chkHumanFriendlyDateTime" Content="Use human friendly last modified" Foreground="{DynamicResource ThemeButtonForeground}" Margin="0,0,0,4" ToolTip="Last modified date format" HorizontalAlignment="Left" Checked="ChkHumanFriendlyDateTime_Checked" Unchecked="ChkHumanFriendlyDateTime_Checked"/>
949949
<Label Foreground="{DynamicResource ThemeButtonForeground}">Project name:</Label>
950950
<StackPanel Orientation="Horizontal">
951-
<RadioButton x:Name="radioProjNameFolder" Content="Folder or ProjectName.txt" Foreground="{DynamicResource ThemeButtonForeground}" Margin="4,0,0,0" GroupName="toggleGroupProjectName" IsChecked="True" Checked="RadioProjNameFolder_Checked" ToolTip="Take project name from project folder name OR ProjectName.txt if file exists in ProjectSettings/ folder"/>
951+
<RadioButton x:Name="radioProjNameFolder" Content="ProjectName.txt or Folder" Foreground="{DynamicResource ThemeButtonForeground}" Margin="4,0,0,0" GroupName="toggleGroupProjectName" IsChecked="True" Checked="RadioProjNameFolder_Checked" ToolTip="Take project name from project folder name OR ProjectName.txt if file exists in ProjectSettings/ folder"/>
952952
<RadioButton x:Name="radioProjNameProductName" Content="Settings ProductName" Foreground="{DynamicResource ThemeButtonForeground}" Margin="5,0,0,0" GroupName="toggleGroupProjectName" Checked="RadioProjNameProductName_Checked" ToolTip="Take project name from player settings ProductName field"/>
953953
</StackPanel>
954954
</StackPanel>

UnityLauncherPro/ThemeEditor.xaml.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public partial class ThemeEditor : Window
1414
// TODO take from mainwindow?
1515
//Dictionary<string, SolidColorBrush> origResourceColors = new Dictionary<string, SolidColorBrush>();
1616
//public static List<ThemeColor> themeColors;
17-
public static ObservableCollection<ThemeColor> themeColors = new ObservableCollection<ThemeColor>();
17+
public static ObservableCollection<ThemeColor> themeColors = new ObservableCollection<ThemeColor>();
1818

1919
public ThemeEditor()
2020
{
@@ -105,11 +105,13 @@ void UpdateColorPreview()
105105

106106
//themeColors[gridThemeColors.SelectedIndex].Key = "asdf";
107107
themeColors[gridThemeColors.SelectedIndex].Brush = newColorBrush;
108-
108+
109109
// NOTE slow but works..
110110
gridThemeColors.Items.Refresh();
111111

112-
// TODO apply color changes to mainwindow
112+
// apply color changes to mainwindow
113+
var item = gridThemeColors.SelectedItem as ThemeColor;
114+
Application.Current.Resources[item.Key] = newColorBrush;
113115
}
114116

115117
private void SliderRed_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
@@ -154,6 +156,6 @@ private void BtnSaveTheme_Click(object sender, RoutedEventArgs e)
154156
Console.WriteLine("TODO save theme to file..");
155157
}
156158

157-
159+
158160
}
159161
}

0 commit comments

Comments
 (0)