diff --git a/Control/Other/CustomIconUrlDialog.xaml b/Control/Other/CustomIconUrlDialog.xaml
new file mode 100644
index 0000000..46e2147
--- /dev/null
+++ b/Control/Other/CustomIconUrlDialog.xaml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Control/Other/CustomIconUrlDialog.xaml.cs b/Control/Other/CustomIconUrlDialog.xaml.cs
new file mode 100644
index 0000000..9f97e14
--- /dev/null
+++ b/Control/Other/CustomIconUrlDialog.xaml.cs
@@ -0,0 +1,30 @@
+using GeekDesk.Util;
+using GeekDesk.ViewModel;
+using Microsoft.Win32;
+using System;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media.Imaging;
+
+
+namespace GeekDesk.Control.Other
+{
+ ///
+ /// TextDialog.xaml 的交互逻辑
+ ///
+ public partial class CustomIconUrlDialog
+ {
+
+ public CustomIconUrlDialog(AppConfig appConfig)
+ {
+ this.DataContext = appConfig;
+ InitializeComponent();
+ }
+
+ public CustomIconUrlDialog()
+ {
+ InitializeComponent();
+ }
+
+ }
+}
diff --git a/Control/Other/IconInfoDialog.xaml b/Control/Other/IconInfoDialog.xaml
index 59e7403..c54364f 100644
--- a/Control/Other/IconInfoDialog.xaml
+++ b/Control/Other/IconInfoDialog.xaml
@@ -19,12 +19,6 @@
-
-
-
-
-
-
diff --git a/Control/UserControls/Config/MotionControl.xaml b/Control/UserControls/Config/MotionControl.xaml
index 77c7aec..a8f70da 100644
--- a/Control/UserControls/Config/MotionControl.xaml
+++ b/Control/UserControls/Config/MotionControl.xaml
@@ -4,7 +4,6 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:cvt="clr-namespace:GeekDesk.Converts"
- xmlns:local="clr-namespace:GeekDesk.Control.UserControls"
xmlns:hc="https://handyorg.github.io/handycontrol"
mc:Ignorable="d"
Background="AliceBlue"
diff --git a/Control/UserControls/IconFont/IconPannel.xaml b/Control/UserControls/IconFont/IconPannel.xaml
index 8f7e0ed..9a28711 100644
--- a/Control/UserControls/IconFont/IconPannel.xaml
+++ b/Control/UserControls/IconFont/IconPannel.xaml
@@ -8,7 +8,7 @@
mc:Ignorable="d"
>
-
+
diff --git a/Control/UserControls/IconFont/IconPannel.xaml.cs b/Control/UserControls/IconFont/IconPannel.xaml.cs
index ace800e..93b80a4 100644
--- a/Control/UserControls/IconFont/IconPannel.xaml.cs
+++ b/Control/UserControls/IconFont/IconPannel.xaml.cs
@@ -23,6 +23,7 @@ namespace GeekDesk.Control.UserControls.IconFont
{
public IconPannel()
{
+ //DataContext = this;
InitializeComponent();
}
diff --git a/Control/UserControls/PannelCard/LeftCardControl.xaml b/Control/UserControls/PannelCard/LeftCardControl.xaml
index 4c44424..2862ced 100644
--- a/Control/UserControls/PannelCard/LeftCardControl.xaml
+++ b/Control/UserControls/PannelCard/LeftCardControl.xaml
@@ -107,7 +107,7 @@
-
+
-
-
-
-
+
+
diff --git a/Control/UserControls/PannelCard/LeftCardControl.xaml.cs b/Control/UserControls/PannelCard/LeftCardControl.xaml.cs
index 23f38f3..0ec26e1 100644
--- a/Control/UserControls/PannelCard/LeftCardControl.xaml.cs
+++ b/Control/UserControls/PannelCard/LeftCardControl.xaml.cs
@@ -3,21 +3,14 @@ using GeekDesk.Control.Windows;
using GeekDesk.Util;
using GeekDesk.ViewModel;
using System;
-using System.Collections.Generic;
+
using System.Collections.ObjectModel;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
+
using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Effects;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
+
namespace GeekDesk.Control.UserControls.PannelCard
{
diff --git a/Control/Windows/IconfontWindow.xaml b/Control/Windows/IconfontWindow.xaml
index c1a7d41..a6a0b57 100644
--- a/Control/Windows/IconfontWindow.xaml
+++ b/Control/Windows/IconfontWindow.xaml
@@ -15,25 +15,45 @@
MouseDown="DragMove"
>
+
+
+
+
+
-
+
-
+
+
-
+
-
+
+
-
-
+
+
+
diff --git a/Control/Windows/IconfontWindow.xaml.cs b/Control/Windows/IconfontWindow.xaml.cs
index 99c4a64..ef77f24 100644
--- a/Control/Windows/IconfontWindow.xaml.cs
+++ b/Control/Windows/IconfontWindow.xaml.cs
@@ -1,5 +1,7 @@
-using GeekDesk.Util;
+using GeekDesk.Control.Other;
+using GeekDesk.Util;
using GeekDesk.ViewModel;
+
using System;
using System.Collections.Generic;
using System.Linq;
@@ -23,14 +25,15 @@ namespace GeekDesk.Control.Windows
{
private static MenuInfo menuInfo;
- private DataContextInfo dataContextInfo = new DataContextInfo();
-
- private IconfontWindow(List listInfo, MenuInfo menuInfo)
+ private static List systemIcons;
+ private static List customIcons;
+ private IconfontWindow(List icons, MenuInfo menuInfo)
{
- InitializeComponent();
- dataContextInfo.iconListSystem = listInfo;
- this.DataContext = dataContextInfo;
+ systemIcons = icons;
+ this.DataContext = systemIcons;
+ this.Topmost = true;
IconfontWindow.menuInfo = menuInfo;
+ InitializeComponent();
}
@@ -55,25 +58,42 @@ namespace GeekDesk.Control.Windows
private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
- //this.DataContext = listInfo;
+ TabItem ti = this.MyTabControl.SelectedItem as TabItem;
+
+ switch (ti.Tag.ToString())
+ {
+ case "Custom":
+ CustomButton.IsEnabled = true;
+ this.DataContext = customIcons;
+ break;
+ default:
+ if (CustomButton != null)
+ {
+ CustomButton.IsEnabled = false;
+ }
+ this.DataContext = systemIcons;
+ break;
+ }
}
private void Confirm_Click(object sender, RoutedEventArgs e)
{
- string tag = (MyTabControl.SelectedContent as TabItem).Tag.ToString();
-
- switch (tag)
+ TabItem ti = this.MyTabControl.SelectedItem as TabItem;
+ int index;
+ switch (ti.Tag.ToString())
{
case "Custom":
- if (dataContextInfo.iconInfoCustom != null)
+ index = this.CustomIcon.IconListBox.SelectedIndex;
+ if (index != -1)
{
- menuInfo.MenuGeometry = dataContextInfo.iconInfoCustom.Text;
+ menuInfo.MenuGeometry = customIcons[index].Text;
}
break;
default:
- if (dataContextInfo.iconInfoSystem != null)
+ index = this.SystemIcon.IconListBox.SelectedIndex;
+ if (index != -1)
{
- menuInfo.MenuGeometry = dataContextInfo.iconInfoSystem.Text;
+ menuInfo.MenuGeometry = systemIcons[index].Text;
}
break;
}
@@ -91,14 +111,9 @@ namespace GeekDesk.Control.Windows
window.Show();
}
-
- private class DataContextInfo
+ private void CustomButton_Click(object sender, RoutedEventArgs e)
{
- public List iconListSystem;
- public List iconListCustom;
- public IconfontInfo iconInfoSystem;
- public IconfontInfo iconInfoCustom;
-
+
}
}
diff --git a/GeekDesk.csproj b/GeekDesk.csproj
index efa91aa..b60c0cd 100644
--- a/GeekDesk.csproj
+++ b/GeekDesk.csproj
@@ -113,6 +113,9 @@
BacklogNotificatin.xaml
+
+ CustomIconUrlDialog.xaml
+
BacklogControl.xaml
@@ -167,6 +170,7 @@
+
@@ -185,6 +189,10 @@
Designer
MSBuild:Compile
+
+ MSBuild:Compile
+ Designer
+
Designer
MSBuild:Compile
@@ -257,6 +265,10 @@
Designer
MSBuild:Compile
+
+ MSBuild:Compile
+ Designer
+
diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs
index 3aaf2b3..78cac80 100644
--- a/MainWindow.xaml.cs
+++ b/MainWindow.xaml.cs
@@ -79,9 +79,6 @@ namespace GeekDesk
{
HandyControl.Controls.Growl.WarningGlobal("启动快捷键已被其它程序占用(" + appData.AppConfig.HotkeyStr + ")!");
}
- //AeroGlassHelper.ExtendGlass(this);
- //AeroGlassHelper.ExtendGlass(BBB, (int)this.Margin.Left, (int)this.Margin.Right, (int)this.Margin.Top, (int)this.Margin.Bottom);
-
}
diff --git a/Themes/Generic.xaml b/Themes/Generic.xaml
new file mode 100644
index 0000000..55a6d42
--- /dev/null
+++ b/Themes/Generic.xaml
@@ -0,0 +1,7 @@
+
+
+
+
diff --git a/Util/HttpUtil.cs b/Util/HttpUtil.cs
new file mode 100644
index 0000000..78852a6
--- /dev/null
+++ b/Util/HttpUtil.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Text;
+using System.Web;
+
+namespace GeekDesk.Util
+{
+ public class HttpUtil
+ {
+ #region Get请求
+ public string Get(string url)
+ {
+ //创建Web访问对 象
+ HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(url);
+ //通过Web访问对象获取响应内容
+ HttpWebResponse myResponse = (HttpWebResponse)myRequest.GetResponse();
+ //通过响应内容流创建StreamReader对象,因为StreamReader更高级更快
+ StreamReader reader = new StreamReader(myResponse.GetResponseStream(), Encoding.UTF8);
+ string returnStr = reader.ReadToEnd();//利用StreamReader就可以从响应内容从头读到尾
+ reader.Close();
+ myResponse.Close();
+ return returnStr;
+ }
+ #endregion
+ }
+}
diff --git a/ViewModel/AppConfig.cs b/ViewModel/AppConfig.cs
index 9b4ca23..2f92144 100644
--- a/ViewModel/AppConfig.cs
+++ b/ViewModel/AppConfig.cs
@@ -4,7 +4,6 @@ using GeekDesk.Util;
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
-using System.Drawing;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media.Imaging;
@@ -38,11 +37,38 @@ namespace GeekDesk.ViewModel
private int pannelCornerRadius = 4; //面板圆角 默认4
[field: NonSerialized]
private ObservableCollection selectedMenuIcons;
- private string hotkeyStr = "Ctrl + Q";
- private HotkeyModifiers hotkeyModifiers = HotkeyModifiers.MOD_CONTROL;
- private Key hotkey = Key.Q;
+ private string hotkeyStr = "Ctrl + Q"; //默认启动面板快捷键
+ private HotkeyModifiers hotkeyModifiers = HotkeyModifiers.MOD_CONTROL; //默认启动面板快捷键
+ private Key hotkey = Key.Q; //默认启动面板快捷键
+
+ private string customIconUrl; //自定义图标url
+ private string customIconJsonUrl; //自定义图标json信息url
#region GetSet
+ public string CustomIconUrl
+ {
+ get
+ {
+ return customIconUrl;
+ }
+ set
+ {
+ customIconUrl = value;
+ OnPropertyChanged("CustomIconUrl");
+ }
+ }
+ public string CustomIconJsonUrl
+ {
+ get
+ {
+ return customIconJsonUrl;
+ }
+ set
+ {
+ customIconJsonUrl = value;
+ OnPropertyChanged("CustomIconJsonUrl");
+ }
+ }
public Key Hotkey
{
get