-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#8 Basic UI and functionality implemented for accent picker
Still need to add to all windows (currently only library until 100% flushed out). Fix conflicts with dark mode swap (causes accent to reset). And implement saving color after closing.
- Loading branch information
Showing
6 changed files
with
99 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<mah:MetroWindow x:Class="WordByWord.Colors" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:mah="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro" | ||
xmlns:local="clr-namespace:WordByWord" | ||
xmlns:dialog="clr-namespace:MahApps.Metro.Controls.Dialogs;assembly=MahApps.Metro" | ||
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks" | ||
dialog:DialogParticipation.Register="{Binding}" | ||
mc:Ignorable="d" | ||
Title="Info" Height="200" Width="400"> | ||
<DockPanel> | ||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="1*" /> | ||
<RowDefinition Height="1*" /> | ||
<RowDefinition Height="1*" /> | ||
</Grid.RowDefinitions> | ||
<TextBlock Text="Accent color:" FontWeight="Bold" FontSize="30" VerticalAlignment="Center" Grid.Row="0" Margin="5"/> | ||
|
||
<ComboBox x:Name="ColorsComboBox" FontWeight="Bold" FontSize="20" SelectionChanged="ColorsComboBox_SelectionChanged" Grid.Row="1" Margin="5" BorderBrush="Black" BorderThickness="2"> | ||
<ComboBoxItem>Blue</ComboBoxItem> | ||
<ComboBoxItem>Red</ComboBoxItem> | ||
<ComboBoxItem>Green</ComboBoxItem> | ||
</ComboBox> | ||
|
||
<Button x:Name="ColorsClose" IsCancel="True" Content="Close" Grid.Row="2" Height="30" Width="100" HorizontalAlignment="Right" Margin="0 0 5 0" BorderThickness="2" BorderBrush="Black"/> | ||
|
||
</Grid> | ||
</DockPanel> | ||
</mah:MetroWindow> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using MahApps.Metro; | ||
using MahApps.Metro.Controls; | ||
using System; | ||
using System.Drawing; | ||
using System.Reflection; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
|
||
namespace WordByWord | ||
{ | ||
/// <summary> | ||
/// Interaction logic for Colors.xaml | ||
/// </summary> | ||
public partial class Colors : MetroWindow | ||
{ | ||
public Colors() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void ColorsComboBox_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e) | ||
{ | ||
Tuple<AppTheme, Accent> theme = ThemeManager.DetectAppStyle(Application.Current); | ||
string selectedColor = (ColorsComboBox.SelectedItem as ComboBoxItem).Content.ToString(); | ||
|
||
if (Application.Current != null) | ||
ThemeManager.ChangeAppStyle(Application.Current, ThemeManager.GetAccent(selectedColor), theme.Item1); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters