Skip to content

Commit

Permalink
Add About Window
Browse files Browse the repository at this point in the history
  • Loading branch information
ledoge committed Apr 6, 2022
1 parent 22a4cc4 commit 33ddf8b
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 3 deletions.
22 changes: 22 additions & 0 deletions DwmLutGUI/DwmLutGUI/AboutWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Window x:Class="DwmLutGUI.AboutWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
Title="About"
SizeToContent="WidthAndHeight"
ResizeMode="NoResize"
WindowStartupLocation="CenterOwner"
SnapsToDevicePixels="True">
<StackPanel Margin="6">
<TextBlock FontSize="15" HorizontalAlignment="Center" TextAlignment="Center">
dwm_lut v3.6 by ledoge
</TextBlock>
<TextBlock HorizontalAlignment="Center" TextAlignment="Center">
Licensed under GPLv3 <LineBreak /> <LineBreak />
Source code and releases hosted at <LineBreak />
<Hyperlink RequestNavigate="OnRequestNavigate" NavigateUri="https://github.com/ledoge/dwm_lut">https://github.com/ledoge/dwm_lut</Hyperlink>
</TextBlock>
</StackPanel>
</Window>
22 changes: 22 additions & 0 deletions DwmLutGUI/DwmLutGUI/AboutWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System.Windows;
using System.Windows.Navigation;

namespace DwmLutGUI
{
public partial class AboutWindow : Window
{
public AboutWindow()
{
InitializeComponent();
}

private void OnRequestNavigate(object sender, RequestNavigateEventArgs e)
{
var processStartInfo = new System.Diagnostics.ProcessStartInfo(e.Uri.AbsoluteUri)
{
UseShellExecute = true,
};
System.Diagnostics.Process.Start(processStartInfo);
}
}
}
4 changes: 4 additions & 0 deletions DwmLutGUI/DwmLutGUI/DwmLutGUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,14 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="AboutWindow.xaml" />
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="AboutWindow.xaml.cs">
<DependentUpon>AboutWindow.xaml</DependentUpon>
</Compile>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
Expand Down
7 changes: 4 additions & 3 deletions DwmLutGUI/DwmLutGUI/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,14 @@
Width="75" Click="HdrLutClear_Click" />
</Grid>
<Grid DockPanel.Dock="Bottom">
<Button Content="Refresh" Width="75" HorizontalAlignment="Left"
Click="MonitorRefreshButton_Click" />
<Button Content="About" Width="75" HorizontalAlignment="Left" Click="AboutButton_Click" />
<WrapPanel HorizontalAlignment="Right">
<Button IsEnabled="{Binding CanApply}" Content="Apply" Width="75" Margin="0,0,6,0"
Click="Apply_Click" />
<Button Content="Disable" Width="75" IsEnabled="{Binding IsActive}"
<Button Content="Disable" Width="75" IsEnabled="{Binding IsActive}" Margin="0,0,6,0"
Click="Disable_Click" />
<Button Content="Refresh" Width="75" Click="MonitorRefreshButton_Click" />

</WrapPanel>
</Grid>
<DataGrid SelectedItem="{Binding SelectedMonitor}" ItemsSource="{Binding Monitors}" RowHeaderWidth="0"
Expand Down
9 changes: 9 additions & 0 deletions DwmLutGUI/DwmLutGUI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,15 @@ private static string BrowseLuts()

return result == true ? dlg.FileName : null;
}

private void AboutButton_Click(object sender, RoutedEventArgs o)
{
var window = new AboutWindow
{
Owner = this
};
window.ShowDialog();
}

private void MonitorRefreshButton_Click(object sender, RoutedEventArgs e)
{
Expand Down

0 comments on commit 33ddf8b

Please sign in to comment.