Skip to content

Commit 136b668

Browse files
committed
Fix Search in SnippetHistory, Remove LeftModernMenu, Separate LocalSnippet and OnlineSnippet
1 parent 3c3b5ea commit 136b668

25 files changed

+315
-547
lines changed

CodeHubDesktop/App.xaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:hc="https://handyorg.github.io/handycontrol"
5-
xmlns:prism="http://prismlibrary.com/" xmlns:ui="http://schemas.modernwpf.com/2019">
5+
xmlns:prism="http://prismlibrary.com/">
66
<Application.Resources>
77
<ResourceDictionary>
88
<ResourceDictionary.MergedDictionaries>
9-
<ui:ThemeResources />
10-
<ui:XamlControlsResources />
119
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml"/>
1210
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/>
1311
<ResourceDictionary Source="/Resources/Font/FontsDictionary.xaml"/>
@@ -24,11 +22,11 @@
2422
</DrawingBrush.Drawing>
2523
</DrawingBrush>
2624

27-
<Style x:Key="ListBoxItemTransparent" BasedOn="{StaticResource ListBoxItemModernBaseStyle}" TargetType="ListBoxItem">
25+
<Style x:Key="ListBoxItemTransparent" BasedOn="{StaticResource ListBoxItemBaseStyle}" TargetType="ListBoxItem">
2826
<Setter Property="hc:BorderElement.CornerRadius" Value="4"/>
2927
<Setter Property="Background" Value="Transparent"/>
3028
</Style>
31-
<Style x:Key="ListBoxTransparent" BasedOn="{StaticResource ListBoxBaseModernStyle}" TargetType="ListBox">
29+
<Style x:Key="ListBoxTransparent" BasedOn="{StaticResource ListBoxBaseStyle}" TargetType="ListBox">
3230
<Setter Property="Background" Value="Transparent"/>
3331
<Setter Property="ItemContainerStyle" Value="{StaticResource ListBoxItemTransparent}"/>
3432
</Style>

CodeHubDesktop/App.xaml.cs

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22
using CodeHubDesktop.Views;
33
using HandyControl.Data;
44
using HandyControl.Tools;
5-
using ModernWpf;
65
using Prism.Ioc;
76
using Prism.Regions;
87
using System;
98
using System.Windows;
10-
using System.Windows.Media;
119

1210
namespace CodeHubDesktop
1311
{
@@ -17,6 +15,10 @@ public App()
1715
{
1816
GlobalData.Init();
1917
ConfigHelper.Instance.SetLang(GlobalData.Config.Lang);
18+
if (GlobalData.Config.Skin != SkinType.Default)
19+
{
20+
UpdateSkin(GlobalData.Config.Skin);
21+
}
2022
}
2123

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

2830
protected override Window CreateShell()
2931
{
30-
if (GlobalData.Config.Skin != SkinType.Default)
31-
{
32-
UpdateSkin(GlobalData.Config.Skin);
33-
}
3432
return Container.Resolve<MainWindow>();
3533
}
3634

@@ -43,6 +41,7 @@ protected override void RegisterTypes(IContainerRegistry containerRegistry)
4341
containerRegistry.RegisterForNavigation<Settings>();
4442
containerRegistry.RegisterForNavigation<CreateSnippet>();
4543
containerRegistry.RegisterForNavigation<SnippetHistory>();
44+
containerRegistry.RegisterForNavigation<SnippetOnline>();
4645
containerRegistry.RegisterForNavigation<LeftMainContent>();
4746
}
4847
internal void UpdateSkin(SkinType skin)
@@ -55,22 +54,6 @@ internal void UpdateSkin(SkinType skin)
5554
{
5655
Source = new Uri("pack://application:,,,/HandyControl;component/Themes/Theme.xaml")
5756
});
58-
59-
if (skin.Equals(SkinType.Dark))
60-
{
61-
ThemeManager.Current.ApplicationTheme = ApplicationTheme.Dark;
62-
}
63-
else if (skin.Equals(SkinType.Default))
64-
{
65-
ThemeManager.Current.ApplicationTheme = ApplicationTheme.Light;
66-
}
67-
else
68-
{
69-
ThemeManager.Current.ApplicationTheme = ApplicationTheme.Light;
70-
ThemeManager.Current.AccentColor = ResourceHelper.GetResource<Color>(ResourceToken.VioletColor);
71-
72-
}
73-
7457
}
7558
}
7659
}

CodeHubDesktop/CodeHubDesktop.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<AssemblyVersion>1.0.1.0</AssemblyVersion>
1313
<LangVersion>latest</LangVersion>
1414
<SatelliteResourceLanguages>en;fa;en-US;fa-IR</SatelliteResourceLanguages>
15-
<ApplicationIcon>gitbanner_6jm_icon.ico</ApplicationIcon>
15+
<ApplicationIcon>Resources\gitbanner_6jm_icon.ico</ApplicationIcon>
1616
<Authors>Mahdi Hosseini</Authors>
1717
</PropertyGroup>
1818
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -31,7 +31,6 @@
3131
<PackageReference Include="AvalonEdit" Version="6.0.1" />
3232
<PackageReference Include="HandyControls" Version="2.4.9.2" />
3333
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.3" />
34-
<PackageReference Include="ModernWpfUI.MahApps" Version="0.8.2-preview.1" />
3534
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
3635
<PackageReference Include="Prism.DryIoc" Version="7.2.0.1422" />
3736
</ItemGroup>

CodeHubDesktop/Controls/MyHamburgerMenu.cs

Lines changed: 0 additions & 61 deletions
This file was deleted.

CodeHubDesktop/Data/AppConfig.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ internal class AppConfig
99

1010
public string Lang { get; set; } = "fa-IR";
1111
public string APIBaseAddress { get; set; } = "http://codehub.pythonanywhere.com/api/v1/snippet/";
12-
public bool IsModernStyle { get; set; } = false;
1312
public bool StoreSnippet { get; set; } = false;
1413
public SkinType Skin { get; set; } = SkinType.Default;
1514
}

CodeHubDesktop/Data/Services/GenericDataService.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using CodeHubDesktop.Models;
22
using Microsoft.EntityFrameworkCore;
33
using Microsoft.EntityFrameworkCore.ChangeTracking;
4-
using System;
54
using System.Collections.Generic;
65
using System.Linq;
76
using System.Threading.Tasks;

CodeHubDesktop/MultiLanguage/Language/Lang.Designer.cs

Lines changed: 10 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CodeHubDesktop/MultiLanguage/Language/Lang.fa-IR.resx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,6 @@
216216
<data name="GithubOrg" xml:space="preserve">
217217
<value>کدهاب</value>
218218
</data>
219-
<data name="HamburgerMenuHeaderItem" xml:space="preserve">
220-
<value>منو</value>
221-
</data>
222219
<data name="HistoryDate" xml:space="preserve">
223220
<value>تاریخ انتشار</value>
224221
</data>
@@ -274,20 +271,17 @@
274271
<value>لینک به حافظه کپی شد</value>
275272
</data>
276273
<data name="SnippetHistory" xml:space="preserve">
277-
<value>اسنیپت های قبلی</value>
274+
<value>اسنیپت های ذخیره شده</value>
275+
</data>
276+
<data name="SnippetOnline" xml:space="preserve">
277+
<value>خواندن اسنیپت های انلاین</value>
278278
</data>
279279
<data name="Subject" xml:space="preserve">
280280
<value>عنوان...</value>
281281
</data>
282282
<data name="SubjectTitle" xml:space="preserve">
283283
<value>عنوان اسنیپت</value>
284284
</data>
285-
<data name="TabLocal" xml:space="preserve">
286-
<value>اسنیپت های شما</value>
287-
</data>
288-
<data name="TabOther" xml:space="preserve">
289-
<value>اسنیپت های دیگران</value>
290-
</data>
291285
<data name="Update" xml:space="preserve">
292286
<value>بروزرسانی</value>
293287
</data>

CodeHubDesktop/MultiLanguage/Language/Lang.resx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,6 @@ Desktop Version Work with CodeHub API.</value>
217217
<data name="GithubOrg" xml:space="preserve">
218218
<value>CodeHub</value>
219219
</data>
220-
<data name="HamburgerMenuHeaderItem" xml:space="preserve">
221-
<value>Menu</value>
222-
</data>
223220
<data name="HistoryDate" xml:space="preserve">
224221
<value>Publish Date</value>
225222
</data>
@@ -275,20 +272,17 @@ Desktop Version Work with CodeHub API.</value>
275272
<value>Link Copied to Clipborad</value>
276273
</data>
277274
<data name="SnippetHistory" xml:space="preserve">
278-
<value>Snippet History</value>
275+
<value>Stored Snippet</value>
276+
</data>
277+
<data name="SnippetOnline" xml:space="preserve">
278+
<value>Read Online Snippet</value>
279279
</data>
280280
<data name="Subject" xml:space="preserve">
281281
<value>Subject...</value>
282282
</data>
283283
<data name="SubjectTitle" xml:space="preserve">
284284
<value>Snippet Title</value>
285285
</data>
286-
<data name="TabLocal" xml:space="preserve">
287-
<value>Your Snippets</value>
288-
</data>
289-
<data name="TabOther" xml:space="preserve">
290-
<value>Others Snippets</value>
291-
</data>
292286
<data name="Update" xml:space="preserve">
293287
<value>Update</value>
294288
</data>
File renamed without changes.

0 commit comments

Comments
 (0)