Skip to content

Commit

Permalink
Improve UI, Fix bugs and Update Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ghost1372 committed Jul 21, 2021
1 parent 6ecb8d1 commit 1f8c0ed
Show file tree
Hide file tree
Showing 20 changed files with 411 additions and 723 deletions.
14 changes: 7 additions & 7 deletions HandyDoc.sln
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30804.86
VisualStudioVersion = 16.0.31507.150
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandyDoc", "HandyDoc\HandyDoc.csproj", "{A1356F3B-6756-42B8-BBBF-F85F076CDE35}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandyDoc", "HandyDoc\HandyDoc.csproj", "{32A8B349-E9CD-4EBA-8B36-EDFA039E5B6F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A1356F3B-6756-42B8-BBBF-F85F076CDE35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A1356F3B-6756-42B8-BBBF-F85F076CDE35}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A1356F3B-6756-42B8-BBBF-F85F076CDE35}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A1356F3B-6756-42B8-BBBF-F85F076CDE35}.Release|Any CPU.Build.0 = Release|Any CPU
{32A8B349-E9CD-4EBA-8B36-EDFA039E5B6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{32A8B349-E9CD-4EBA-8B36-EDFA039E5B6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{32A8B349-E9CD-4EBA-8B36-EDFA039E5B6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{32A8B349-E9CD-4EBA-8B36-EDFA039E5B6F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {65F24549-A006-465D-9677-59D2E794F9ED}
SolutionGuid = {43F6C957-9285-4644-8F52-C72552E55640}
EndGlobalSection
EndGlobal
17 changes: 11 additions & 6 deletions HandyDoc/App.xaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<Application x:Class="HandyDoc.App"
xmlns="http:https://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http:https://schemas.microsoft.com/winfx/2006/xaml"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:ui="http:https://schemas.modernwpf.com/2019"
xmlns:toolkit="http:https://schemas.modernwpf.com/toolkit">
xmlns:x="http:https://schemas.microsoft.com/winfx/2006/xaml" xmlns:toolkit="http:https://schemas.modernwpf.com/toolkit"
xmlns:hc="https://handyorg.github.io/handycontrol" xmlns:ui="http:https://schemas.modernwpf.com/2019"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
Expand All @@ -14,9 +13,15 @@
<ResourceDictionary x:Key="HighContrast" ui:ThemeDictionary.Key="HighContrast" toolkit:ToolkitThemeDictionary.Key="HighContrast" />
</ui:ThemeResources.ThemeDictionaries>
</ui:ThemeResources>
<ui:XamlControlsResources />
<hc:Theme Name="HandyTheme"/>
<ui:XamlControlsResources/>
<hc:ThemeResources/>
<hc:Theme/>
</ResourceDictionary.MergedDictionaries>
<Style TargetType="ui:AutoSuggestBox">
<Style.Resources>
<Style TargetType="ListView" BasedOn="{StaticResource DefaultListViewStyle}"/>
</Style.Resources>
</Style>
<Geometry x:Key="XamlGeometry">M2 4C0.9069372 4 0 4.9069372 0 6L0 17C0 18.093063 0.9069372 19 2 19L22 19C23.093063 19 24 18.093063 24 17L24 6C24 4.9069372 23.093063 4 22 4L2 4 z M 2 6L22 6L22 17L2 17L2 6 z M 3.0253906 9L4.2949219 11.478516L3 14L4.2617188 14L4.9980469 12.251953L5.7382812 14L7 14L5.703125 11.478516L6.9707031 9L5.7246094 9L4.9960938 10.716797L4.2714844 9L3.0253906 9 z M 8.9121094 9L7.5664062 14L8.6191406 14L8.8769531 13L10.246094 13L10.505859 14L11.566406 14L10.214844 9L8.9121094 9 z M 12 9L12 13.976562L13 13.976562L13 11L14.117188 13.976562L14.876953 13.976562L16 11L16 13.976562L16.998047 13.976562L17 13.976562L17 9L15.542969 9L14.501953 12.599609L13.457031 9L12 9 z M 18 9L18 14L21 14L21 13L19 13L19 9L18 9 z M 9.5605469 10.353516L9.9863281 12L9.1347656 12L9.5605469 10.353516 z</Geometry>
<Geometry x:Key="PaletteGeometry">M12 2C6.241 2 1.6193906 6.8668906 2.0253906 12.712891C2.3923906 18.001891 7.0056406 22 12.306641 22L13 22C14.105 22 15 21.105 15 20L15 17C15 15.895 15.895 15 17 15L20 15C21.105 15 22 14.105 22 13L22 12.306641C22 7.0056406 18.002844 2.3923906 12.714844 2.0253906C12.474844 2.0083906 12.236 2 12 2 z M 12 4C12.19 4 12.381219 4.0065313 12.574219 4.0195312C16.738219 4.3085313 20 7.9486406 20 12.306641L20 13L17 13C14.794 13 13 14.794 13 17L13 20L12.306641 20C7.9486406 20 4.3075312 16.737219 4.0195312 12.574219C3.8635312 10.324219 4.6194375 8.1839219 6.1484375 6.5449219C7.6794375 4.9039219 9.758 4 12 4 z M 12.5 5 A 1.5 1.5 0 0 0 11 6.5 A 1.5 1.5 0 0 0 12.5 8 A 1.5 1.5 0 0 0 14 6.5 A 1.5 1.5 0 0 0 12.5 5 z M 8.5 6 A 1.5 1.5 0 0 0 7 7.5 A 1.5 1.5 0 0 0 8.5 9 A 1.5 1.5 0 0 0 10 7.5 A 1.5 1.5 0 0 0 8.5 6 z M 16.5 7 A 1.5 1.5 0 0 0 15 8.5 A 1.5 1.5 0 0 0 16.5 10 A 1.5 1.5 0 0 0 18 8.5 A 1.5 1.5 0 0 0 16.5 7 z M 6.5 10 A 1.5 1.5 0 0 0 5 11.5 A 1.5 1.5 0 0 0 6.5 13 A 1.5 1.5 0 0 0 8 11.5 A 1.5 1.5 0 0 0 6.5 10 z M 10 14 A 2 2 0 0 0 8 16 A 2 2 0 0 0 10 18 A 2 2 0 0 0 12 16 A 2 2 0 0 0 10 14 z</Geometry>
<Geometry x:Key="InterActivityGeometry">M3 3C1.895 3 1 3.895 1 5L1 17C1 18.105 1.895 19 3 19L8 19L8 21L16 21L16 19L21 19C22.105 19 23 18.105 23 17L23 5C23 3.895 22.105 3 21 3L3 3 z M 3 5L21 5L21 17L3 17L3 5 z M 5 7L5 10L11 10L11 7L5 7 z M 13 7L13 10L19 10L19 7L13 7 z M 5 12L5 15L11 15L11 12L5 12 z M 13 12L13 15L19 15L19 12L13 12 z</Geometry>
Expand Down
28 changes: 4 additions & 24 deletions HandyDoc/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,34 +1,14 @@
using HandyControl.Controls;
using HandyControl.Data;
using HandyControl.Themes;
using HandyControl.Tools;
using ModernWpf;
using HandyControl.Themes;
using System.Windows;

namespace HandyDoc
{
public partial class App : Application
{
public App()
internal void UpdateTheme(ApplicationTheme theme)
{
GlobalDataHelper<AppConfig>.Init();
}

protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
var boot = new Bootstrapper();
boot.Run();
UpdateSkin(GlobalDataHelper<AppConfig>.Config.Skin);
}

internal void UpdateSkin(SkinType skin)
{
SharedResourceDictionary.SharedDictionaries.Clear();
ResourceHelper.GetTheme("HandyTheme", Resources).Skin = skin;

ThemeManager.Current.ApplicationTheme = skin == SkinType.Dark ? ApplicationTheme.Dark : ApplicationTheme.Light;
Current.MainWindow?.OnApplyTemplate();
ThemeManager.Current.ApplicationTheme = theme;
ModernWpf.ThemeManager.Current.ApplicationTheme = theme == ApplicationTheme.Light ? ModernWpf.ApplicationTheme.Light : ModernWpf.ApplicationTheme.Dark;
}
}
}
11 changes: 0 additions & 11 deletions HandyDoc/AppConfig.cs

This file was deleted.

28 changes: 0 additions & 28 deletions HandyDoc/Bootstrapper.cs

This file was deleted.

34 changes: 14 additions & 20 deletions HandyDoc/HandyDoc.csproj
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0-windows10.0.18362</TargetFramework>
<UseWPF>true</UseWPF>
<UseWPF>true</UseWPF>
<AssemblyName>HandyDoc</AssemblyName>
<RootNamespace>HandyDoc</RootNamespace>
<Version>1.0.0.0</Version>
<Version>2.0.0.0</Version>
<Configurations>Debug;Release</Configurations>
<Copyright>Copyright © Mahdi 2018-2021</Copyright>
<FileVersion>1.0.0.0</FileVersion>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<SatelliteResourceLanguages>en;fa</SatelliteResourceLanguages>
<LangVersion>latest</LangVersion>
<ApplicationIcon>icon.ico</ApplicationIcon>
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
<Copyright>Copyright © Mahdi Hosseini 2021</Copyright>
<FileVersion>2.0.0.0</FileVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<LangVersion>latest</LangVersion>
<ApplicationIcon>icon.ico</ApplicationIcon>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand All @@ -26,19 +25,14 @@
<None Remove="icon.ico" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="HandyControls" Version="3.0.0" />
<PackageReference Include="ModernWpf.Toolkit.UI.Controls.Markdown" Version="0.1.0" />
<PackageReference Include="ModernWpfUis" Version="1.0.0" />
<PackageReference Include="Prism.DryIoc" Version="8.0.0.1909" />
<PackageReference Include="HandyControls" Version="3.3.7" />
<PackageReference Include="ModernWpfUis" Version="1.2.0" />
<PackageReference Include="ModernWpf.Toolkit.UI.Controls.Markdown" Version="0.1.0" />
</ItemGroup>
<ItemGroup>
<Page Include="Properties\DesignTimeResources.xaml" Condition="'$(DesignTime)'=='true' OR ('$(SolutionPath)'!='' AND Exists('$(SolutionPath)') AND '$(BuildingInsideVisualStudio)'!='true' AND '$(BuildingInsideExpressionBlend)'!='true')">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<ContainsDesignTimeResources>true</ContainsDesignTimeResources>
</Page>
<Folder Include="Resources\" />
</ItemGroup>
<ItemGroup>
<Resource Include="icon.ico" />
</ItemGroup>
</Project>
</Project>
53 changes: 53 additions & 0 deletions HandyDoc/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<hc:GlowWindow x:Class="HandyDoc.MainWindow"
xmlns="http:https://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http:https://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http:https://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http:https://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:ui="http:https://schemas.modernwpf.com/2019" xmlns:controls="http:https://schemas.modernwpf.com/toolkit/controls"
mc:Ignorable="d" Loaded="Window_Loaded"
Title="HandyDoc v2.0" ActiveGlowColor="{DynamicResource PrimaryColor}"
WindowStartupLocation="CenterScreen"
ShowTitle="True"
Height="450"
Width="800">
<hc:GlowWindow.NonClientAreaContent>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Button HorizontalAlignment="Right" Grid.Column="1" Click="ButtonConfig_OnClick" Name="ButtonConfig" Style="{StaticResource ButtonIcon}" Foreground="{DynamicResource PrimaryTextBrush}" hc:IconElement.Geometry="{StaticResource ConfigGeometry}"/>
<Popup AllowsTransparency="True" Grid.Column="1" PlacementTarget="{Binding ElementName=ButtonConfig}" HorizontalOffset="-35" Name="PopupConfig" VerticalOffset="6" StaysOpen="False">
<Border Background="{DynamicResource SecondaryRegionBrush}" CornerRadius="4" Margin="16" Effect="{StaticResource EffectShadow2}">
<StackPanel Margin="10" Button.Click="ButtonSkins_OnClick" HorizontalAlignment="Center">
<Button Tag="{x:Static hc:ApplicationTheme.Light}" Style="{StaticResource ButtonCustom}">
<Border Background="White" Width="32" Height="21" CornerRadius="2" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}"/>
</Button>
<Button Margin="0,10" Tag="{x:Static hc:ApplicationTheme.Dark}" Style="{StaticResource ButtonCustom}">
<Border Background="Black" Width="32" Height="21" CornerRadius="2" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}"/>
</Button>
</StackPanel>
</Border>
</Popup>
</Grid>
</hc:GlowWindow.NonClientAreaContent>
<hc:TransitioningContentControl TransitionMode="Fade">
<ui:NavigationViewNonVirtualizing Name="navView" SelectionChanged="navView_SelectionChanged" IsBackButtonVisible="Collapsed" IsSettingsVisible="False" PaneDisplayMode="Left" >
<ui:NavigationViewNonVirtualizing.AutoSuggestBox>
<ui:AutoSuggestBox x:Name="autoBox" QueryIcon="Find" QuerySubmitted="controlsSearchBox_QuerySubmitted" TextChanged="controlsSearchBox_TextChanged" PlaceholderText="Search..."/>
</ui:NavigationViewNonVirtualizing.AutoSuggestBox>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<ComboBox Name="cmbLang" ui:ControlHelper.PlaceholderText="Default Language is English" SelectionChanged="ComboBox_SelectionChanged" Margin="10" MinWidth="200" Style="{StaticResource DefaultComboBoxStyle}">
<ComboBoxItem Content="English"/>
<ComboBoxItem Content="Chinese"/>
</ComboBox>
<controls:MarkdownTextBlock Grid.Row="1" Name="mdText"/>
</Grid>
</ui:NavigationViewNonVirtualizing>
</hc:TransitioningContentControl>
</hc:GlowWindow>
Loading

0 comments on commit 1f8c0ed

Please sign in to comment.