mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-04-28 00:36:00 +00:00
[GUI] Add dark theme (#388)
This commit is contained in:
@@ -48,12 +48,13 @@
|
||||
Margin="8,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="19"
|
||||
FontWeight="Light"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
Visibility="{Binding IsSingleChannel, Converter={x:Static s:BoolToVisibilityConverter.Instance}}">
|
||||
<Run Text="{Binding Channels[0].Category, Mode=OneWay}" ToolTip="{Binding Channels[0].Category, Mode=OneWay}" />
|
||||
<Run Text="/" />
|
||||
<Run
|
||||
Foreground="{DynamicResource PrimaryTextBrush}"
|
||||
FontWeight="DemiBold"
|
||||
Text="{Binding Channels[0].Name, Mode=OneWay}"
|
||||
ToolTip="{Binding Channels[0].Name, Mode=OneWay}" />
|
||||
</TextBlock>
|
||||
@@ -163,18 +164,13 @@
|
||||
<ToggleButton
|
||||
x:Name="AdvancedSectionToggleButton"
|
||||
Grid.Column="0"
|
||||
Margin="8"
|
||||
Width="24"
|
||||
Height="24"
|
||||
Margin="12"
|
||||
Cursor="Hand"
|
||||
Loaded="AdvancedSectionToggleButton_OnLoaded"
|
||||
Style="{DynamicResource MaterialDesignFlatToggleButton}"
|
||||
ToolTip="Show advanced options">
|
||||
<ToggleButton.Content>
|
||||
<materialDesign:PackIcon
|
||||
Width="24"
|
||||
Height="24"
|
||||
Kind="Menu" />
|
||||
</ToggleButton.Content>
|
||||
</ToggleButton>
|
||||
Style="{DynamicResource MaterialDesignHamburgerToggleButton}"
|
||||
ToolTip="Show advanced options" />
|
||||
|
||||
<Button
|
||||
Grid.Column="2"
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
<TextBlock
|
||||
Margin="16"
|
||||
FontSize="17"
|
||||
Foreground="{DynamicResource PrimaryTextBrush}"
|
||||
Text="Settings" />
|
||||
|
||||
<!-- Date format -->
|
||||
@@ -56,11 +55,28 @@
|
||||
IsChecked="{Binding IsTokenPersisted}" />
|
||||
</DockPanel>
|
||||
|
||||
<!-- Dark/Light theme -->
|
||||
<DockPanel
|
||||
Background="Transparent"
|
||||
LastChildFill="False"
|
||||
ToolTip="Persist last used token between sessions">
|
||||
<TextBlock
|
||||
Margin="16,8"
|
||||
DockPanel.Dock="Left"
|
||||
Text="Dark theme" />
|
||||
<ToggleButton
|
||||
Margin="16,8"
|
||||
Checked="ToggleButton_Checked"
|
||||
DockPanel.Dock="Right"
|
||||
IsChecked="{Binding IsDarkThemeEnabled}"
|
||||
Unchecked="ToggleButton_Unchecked" />
|
||||
</DockPanel>
|
||||
|
||||
<!-- Parallel limit -->
|
||||
<StackPanel Background="Transparent" ToolTip="How many channels can be exported at the same time">
|
||||
<TextBlock Margin="16,8">
|
||||
<Run Text="Parallel limit:" />
|
||||
<Run Foreground="{DynamicResource PrimaryTextBrush}" Text="{Binding ParallelLimit, Mode=OneWay}" />
|
||||
<Run Text="{Binding ParallelLimit, Mode=OneWay}" />
|
||||
</TextBlock>
|
||||
<Slider
|
||||
Margin="16,8"
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
namespace DiscordChatExporter.Gui.Views.Dialogs
|
||||
using MaterialDesignThemes;
|
||||
using MaterialDesignThemes.Wpf;
|
||||
using System.Windows.Media.Media3D;
|
||||
|
||||
namespace DiscordChatExporter.Gui.Views.Dialogs
|
||||
{
|
||||
public partial class SettingsView
|
||||
{
|
||||
@@ -6,5 +10,20 @@
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void ToggleButton_Checked(object sender, System.Windows.RoutedEventArgs e)
|
||||
{
|
||||
setBaseTheme(Theme.Dark);
|
||||
}
|
||||
|
||||
private void ToggleButton_Unchecked(object sender, System.Windows.RoutedEventArgs e)
|
||||
{
|
||||
setBaseTheme(Theme.Light);
|
||||
}
|
||||
|
||||
private void setBaseTheme(Theme theme)
|
||||
{
|
||||
Theme.SetCurrent(theme);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user