Skip to content

Commit

Permalink
Fix Search in SnippetHistory, Remove LeftModernMenu, Separate LocalSn…
Browse files Browse the repository at this point in the history
…ippet and OnlineSnippet
  • Loading branch information
ghost1372 committed Apr 10, 2020
1 parent 3c3b5ea commit 136b668
Show file tree
Hide file tree
Showing 25 changed files with 315 additions and 547 deletions.
8 changes: 3 additions & 5 deletions CodeHubDesktop/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:prism="http://prismlibrary.com/" xmlns:ui="http://schemas.modernwpf.com/2019">
xmlns:prism="http://prismlibrary.com/">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ui:ThemeResources />
<ui:XamlControlsResources />
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml"/>
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/>
<ResourceDictionary Source="/Resources/Font/FontsDictionary.xaml"/>
Expand All @@ -24,11 +22,11 @@
</DrawingBrush.Drawing>
</DrawingBrush>

<Style x:Key="ListBoxItemTransparent" BasedOn="{StaticResource ListBoxItemModernBaseStyle}" TargetType="ListBoxItem">
<Style x:Key="ListBoxItemTransparent" BasedOn="{StaticResource ListBoxItemBaseStyle}" TargetType="ListBoxItem">
<Setter Property="hc:BorderElement.CornerRadius" Value="4"/>
<Setter Property="Background" Value="Transparent"/>
</Style>
<Style x:Key="ListBoxTransparent" BasedOn="{StaticResource ListBoxBaseModernStyle}" TargetType="ListBox">
<Style x:Key="ListBoxTransparent" BasedOn="{StaticResource ListBoxBaseStyle}" TargetType="ListBox">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="ItemContainerStyle" Value="{StaticResource ListBoxItemTransparent}"/>
</Style>
Expand Down
27 changes: 5 additions & 22 deletions CodeHubDesktop/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
using CodeHubDesktop.Views;
using HandyControl.Data;
using HandyControl.Tools;
using ModernWpf;
using Prism.Ioc;
using Prism.Regions;
using System;
using System.Windows;
using System.Windows.Media;

namespace CodeHubDesktop
{
Expand All @@ -17,6 +15,10 @@ public App()
{
GlobalData.Init();
ConfigHelper.Instance.SetLang(GlobalData.Config.Lang);
if (GlobalData.Config.Skin != SkinType.Default)
{
UpdateSkin(GlobalData.Config.Skin);
}
}

protected override void OnStartup(StartupEventArgs e)
Expand All @@ -27,10 +29,6 @@ protected override void OnStartup(StartupEventArgs e)

protected override Window CreateShell()
{
if (GlobalData.Config.Skin != SkinType.Default)
{
UpdateSkin(GlobalData.Config.Skin);
}
return Container.Resolve<MainWindow>();
}

Expand All @@ -43,6 +41,7 @@ protected override void RegisterTypes(IContainerRegistry containerRegistry)
containerRegistry.RegisterForNavigation<Settings>();
containerRegistry.RegisterForNavigation<CreateSnippet>();
containerRegistry.RegisterForNavigation<SnippetHistory>();
containerRegistry.RegisterForNavigation<SnippetOnline>();
containerRegistry.RegisterForNavigation<LeftMainContent>();
}
internal void UpdateSkin(SkinType skin)
Expand All @@ -55,22 +54,6 @@ internal void UpdateSkin(SkinType skin)
{
Source = new Uri("pack://application:,,,/HandyControl;component/Themes/Theme.xaml")
});

if (skin.Equals(SkinType.Dark))
{
ThemeManager.Current.ApplicationTheme = ApplicationTheme.Dark;
}
else if (skin.Equals(SkinType.Default))
{
ThemeManager.Current.ApplicationTheme = ApplicationTheme.Light;
}
else
{
ThemeManager.Current.ApplicationTheme = ApplicationTheme.Light;
ThemeManager.Current.AccentColor = ResourceHelper.GetResource<Color>(ResourceToken.VioletColor);

}

}
}
}
3 changes: 1 addition & 2 deletions CodeHubDesktop/CodeHubDesktop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<AssemblyVersion>1.0.1.0</AssemblyVersion>
<LangVersion>latest</LangVersion>
<SatelliteResourceLanguages>en;fa;en-US;fa-IR</SatelliteResourceLanguages>
<ApplicationIcon>gitbanner_6jm_icon.ico</ApplicationIcon>
<ApplicationIcon>Resources\gitbanner_6jm_icon.ico</ApplicationIcon>
<Authors>Mahdi Hosseini</Authors>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand All @@ -31,7 +31,6 @@
<PackageReference Include="AvalonEdit" Version="6.0.1" />
<PackageReference Include="HandyControls" Version="2.4.9.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.3" />
<PackageReference Include="ModernWpfUI.MahApps" Version="0.8.2-preview.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Prism.DryIoc" Version="7.2.0.1422" />
</ItemGroup>
Expand Down
61 changes: 0 additions & 61 deletions CodeHubDesktop/Controls/MyHamburgerMenu.cs

This file was deleted.

1 change: 0 additions & 1 deletion CodeHubDesktop/Data/AppConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ internal class AppConfig

public string Lang { get; set; } = "fa-IR";
public string APIBaseAddress { get; set; } = "http://codehub.pythonanywhere.com/api/v1/snippet/";
public bool IsModernStyle { get; set; } = false;
public bool StoreSnippet { get; set; } = false;
public SkinType Skin { get; set; } = SkinType.Default;
}
Expand Down
1 change: 0 additions & 1 deletion CodeHubDesktop/Data/Services/GenericDataService.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using CodeHubDesktop.Models;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
Expand Down
38 changes: 10 additions & 28 deletions CodeHubDesktop/MultiLanguage/Language/Lang.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 4 additions & 10 deletions CodeHubDesktop/MultiLanguage/Language/Lang.fa-IR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,6 @@
<data name="GithubOrg" xml:space="preserve">
<value>کدهاب</value>
</data>
<data name="HamburgerMenuHeaderItem" xml:space="preserve">
<value>منو</value>
</data>
<data name="HistoryDate" xml:space="preserve">
<value>تاریخ انتشار</value>
</data>
Expand Down Expand Up @@ -274,20 +271,17 @@
<value>لینک به حافظه کپی شد</value>
</data>
<data name="SnippetHistory" xml:space="preserve">
<value>اسنیپت های قبلی</value>
<value>اسنیپت های ذخیره شده</value>
</data>
<data name="SnippetOnline" xml:space="preserve">
<value>خواندن اسنیپت های انلاین</value>
</data>
<data name="Subject" xml:space="preserve">
<value>عنوان...</value>
</data>
<data name="SubjectTitle" xml:space="preserve">
<value>عنوان اسنیپت</value>
</data>
<data name="TabLocal" xml:space="preserve">
<value>اسنیپت های شما</value>
</data>
<data name="TabOther" xml:space="preserve">
<value>اسنیپت های دیگران</value>
</data>
<data name="Update" xml:space="preserve">
<value>بروزرسانی</value>
</data>
Expand Down
14 changes: 4 additions & 10 deletions CodeHubDesktop/MultiLanguage/Language/Lang.resx
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,6 @@ Desktop Version Work with CodeHub API.</value>
<data name="GithubOrg" xml:space="preserve">
<value>CodeHub</value>
</data>
<data name="HamburgerMenuHeaderItem" xml:space="preserve">
<value>Menu</value>
</data>
<data name="HistoryDate" xml:space="preserve">
<value>Publish Date</value>
</data>
Expand Down Expand Up @@ -275,20 +272,17 @@ Desktop Version Work with CodeHub API.</value>
<value>Link Copied to Clipborad</value>
</data>
<data name="SnippetHistory" xml:space="preserve">
<value>Snippet History</value>
<value>Stored Snippet</value>
</data>
<data name="SnippetOnline" xml:space="preserve">
<value>Read Online Snippet</value>
</data>
<data name="Subject" xml:space="preserve">
<value>Subject...</value>
</data>
<data name="SubjectTitle" xml:space="preserve">
<value>Snippet Title</value>
</data>
<data name="TabLocal" xml:space="preserve">
<value>Your Snippets</value>
</data>
<data name="TabOther" xml:space="preserve">
<value>Others Snippets</value>
</data>
<data name="Update" xml:space="preserve">
<value>Update</value>
</data>
Expand Down
File renamed without changes.
38 changes: 0 additions & 38 deletions CodeHubDesktop/ViewModels/LeftMainContent2ViewModel.cs

This file was deleted.

Loading

0 comments on commit 136b668

Please sign in to comment.