Skip to content

Commit

Permalink
Add logo 256 and settings view
Browse files Browse the repository at this point in the history
  • Loading branch information
dogzz9445 committed Jun 6, 2024
1 parent a89146f commit 05098f3
Show file tree
Hide file tree
Showing 10 changed files with 543 additions and 331 deletions.
Binary file added docs/images/logo_256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Apps/Corathing.Organizer/Assets/logo_256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 9 additions & 6 deletions src/Apps/Corathing.Organizer/Controls/BaseWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
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:ui="http://schemas.lepo.co/wpfui/2022/xaml"
xmlns:local="clr-namespace:Corathing.Organizer.Controls"
mc:Ignorable="d"
Title="BaseWindow"
ShowTitleBar="False"
Height="1000"
Width="1600">
<Grid>

</Grid>
ShowCloseButton="False"
IsWindowDraggable="False"
Background="{DynamicResource ApplicationBackgroundBrush}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
WindowStartupLocation="CenterOwner"
ResizeMode="NoResize"
Height="800"
Width="1280">
</mah:MetroWindow>
9 changes: 9 additions & 0 deletions src/Apps/Corathing.Organizer/Corathing.Organizer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
<Page Remove="Properties\**" />
</ItemGroup>

<ItemGroup>
<None Remove="Assets\logo_256.png" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="MahApps.Metro" Version="2.4.10" />
<PackageReference Include="MaterialDesignThemes" Version="5.0.0" />
Expand All @@ -27,11 +31,16 @@
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="WPF-UI" Version="3.0.4" />
<PackageReference Include="WPF-UI.Tray" Version="3.0.4" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Shared\Corathing.Contracts\Corathing.Contracts.csproj" />
<ProjectReference Include="..\..\Shared\Corathing.Dashboards.WPF\Corathing.Dashboards.WPF.csproj" />
</ItemGroup>

<ItemGroup>
<Resource Include="Assets\logo_256.png" />
</ItemGroup>

</Project>
41 changes: 30 additions & 11 deletions src/Apps/Corathing.Organizer/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
<metro:MetroWindow x:Class="Corathing.Organizer.MainWindow"
xmlns:metro="http://metro.mahapps.com/winfx/xaml/controls"
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:local="clr-namespace:Corathing.Organizer"
xmlns:views="clr-namespace:Corathing.Organizer.Views"
mc:Ignorable="d"
Title="MainWindow"
Height="1000"
Width="1600">
<views:DashboardView DockPanel.Dock="Bottom" />
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:local="clr-namespace:Corathing.Organizer"
xmlns:views="clr-namespace:Corathing.Organizer.Views"
xmlns:tray="http://schemas.lepo.co/wpfui/2022/xaml/tray"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
mc:Ignorable="d"
ShowTitleBar="False"
ShowMinButton="False"
ShowMaxRestoreButton="False"
ShowCloseButton="False"
IsWindowDraggable="True"
Height="1000"
Width="1600">

<Grid>
<views:DashboardView DockPanel.Dock="Bottom" />

<tray:NotifyIcon Grid.Row="0"
FocusOnLeftClick="True"
Icon="pack://application:,,,/Assets/logo_256.png"
MenuOnRightClick="True"
TooltipText="WPF UI Gallery">
<tray:NotifyIcon.Menu>
<ContextMenu ItemsSource="{Binding ViewModel.TrayMenuItems, Mode=OneWay}" />
</tray:NotifyIcon.Menu>
</tray:NotifyIcon>
</Grid>
</metro:MetroWindow>
24 changes: 23 additions & 1 deletion src/Apps/Corathing.Organizer/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,38 @@

using MahApps.Metro.Controls;

using Wpf.Ui.Controls;

namespace Corathing.Organizer
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
/// </summary>
public partial class MainWindow : MetroWindow
{
public MainWindow()
{
InitializeComponent();

MouseDown += Window_MouseDown;
MouseDoubleClick += Window_MouseDoubleClick;
}

private void Window_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
if (e.ChangedButton == MouseButton.Left)
{
if (WindowState == WindowState.Normal)
WindowState = WindowState.Maximized;
else
WindowState = WindowState.Normal;
}
}

private void Window_MouseDown(object sender, MouseButtonEventArgs e)
{
if (e.ChangedButton == MouseButton.Left)
this.DragMove();
}
}
}
2 changes: 2 additions & 0 deletions src/Apps/Corathing.Organizer/ViewModels/DashboardViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ public void OpenOrganizerSettings()
var window = new BaseWindow();
window.Content = new OrganizerSettingsView();
window.Owner = Application.Current.MainWindow;
Application.Current.MainWindow.Effect = new BlurEffect();
window.ShowDialog();
Application.Current.MainWindow.Effect = null;
}

[RelayCommand]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;

using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;

using Corathing.Contracts.Services;

Expand Down Expand Up @@ -63,6 +65,12 @@ private void OnThemeChanged(ApplicationTheme currentApplicationTheme, Color syst
}
}

[RelayCommand]
public void Close(Window window)
{
window.Close();
}

private static string GetAssemblyVersion()
{
return Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? string.Empty;
Expand Down
Loading

0 comments on commit 05098f3

Please sign in to comment.