Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d67d32b29 | ||
|
|
53481bf907 | ||
|
|
2673b9862c | ||
|
|
4c0a97b7b1 | ||
|
|
0a89255ad2 | ||
|
|
3c78b058cf | ||
|
|
9a5882ff98 | ||
|
|
0107ac8317 |
17
App.config
17
App.config
@@ -24,12 +24,23 @@
|
|||||||
</assemblyBinding>
|
</assemblyBinding>
|
||||||
</runtime>
|
</runtime>
|
||||||
<appSettings>
|
<appSettings>
|
||||||
<add key="Version" value="2.0" />
|
<add key="Version" value="2.1" />
|
||||||
|
|
||||||
<add key="GitHubUrl" value="https://github.com/Demo-Liu/GeekDesk" />
|
<add key="GitHubUrl" value="https://github.com/Demo-Liu/GeekDesk" />
|
||||||
<add key="GiteeUrl" value="https://gitee.com/demo_liu/GeekDesk/tree/master" />
|
<add key="GiteeUrl" value="https://gitee.com/demo_liu/GeekDesk/tree/master" />
|
||||||
|
|
||||||
<add key="GitHubUpdateUrl" value="https://demo-liu.github.io/GeekDesk/Update.json" />
|
<add key="GitHubUpdateUrl" value="https://demo-liu.github.io/GeekDesk/Update.json" />
|
||||||
<add key="GiteeUpdateUrl" value="https://demo-liu.github.io/GeekDesk/Update.json" />
|
<add key="GiteeUpdateUrl" value="https://demo-liu.github.io/GeekDesk/Update.json" />
|
||||||
|
<add key="ClientSettingsProvider.ServiceUri" value="" />
|
||||||
</appSettings>
|
</appSettings>
|
||||||
|
<system.web>
|
||||||
|
<membership defaultProvider="ClientAuthenticationMembershipProvider">
|
||||||
|
<providers>
|
||||||
|
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
|
||||||
|
</providers>
|
||||||
|
</membership>
|
||||||
|
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
|
||||||
|
<providers>
|
||||||
|
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
|
||||||
|
</providers>
|
||||||
|
</roleManager>
|
||||||
|
</system.web>
|
||||||
</configuration>
|
</configuration>
|
||||||
18
Constant/CommonEnum.cs
Normal file
18
Constant/CommonEnum.cs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/// <summary>
|
||||||
|
/// 默认参数
|
||||||
|
/// </summary>
|
||||||
|
namespace GeekDesk.Constant
|
||||||
|
{
|
||||||
|
public enum CommonEnum
|
||||||
|
{
|
||||||
|
WINDOW_WIDTH = 666, //默认窗体宽度
|
||||||
|
WINDOW_HEIGHT = 500, //默认窗体高度
|
||||||
|
MENU_CARD_WIDHT = 165, //默认菜单栏宽度
|
||||||
|
IMAGE_WIDTH = 45, //默认图标宽度
|
||||||
|
IMAGE_HEIGHT = 45, //默认图标高度
|
||||||
|
IMAGE_WIDTH_AM = 52, //动画变换宽度
|
||||||
|
IMAGE_HEIGHT_AM = 52, //动画变换高度
|
||||||
|
IMAGE_PANEL_WIDTH = 110, //图标容器宽度
|
||||||
|
IMAGE_PANEL_HEIGHT = 90, //图标容器高度
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
14
Constant/IconType.cs
Normal file
14
Constant/IconType.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace GeekDesk.Constant
|
||||||
|
{
|
||||||
|
public enum IconType
|
||||||
|
{
|
||||||
|
OTHER = 1, //直接打开
|
||||||
|
URL = 2 //调用浏览器打开
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
/// <summary>
|
|
||||||
/// 默认参数
|
|
||||||
/// </summary>
|
|
||||||
namespace GeekDesk.Constant
|
|
||||||
{
|
|
||||||
public enum MainWindowEnum
|
|
||||||
{
|
|
||||||
WINDOW_WIDTH = 666, //默认窗体宽度
|
|
||||||
WINDOW_HEIGHT = 500, //默认窗体高度
|
|
||||||
MENU_CARD_WIDHT = 165, //默认菜单栏宽度
|
|
||||||
IMAGE_WIDTH = 50, //默认图标宽度
|
|
||||||
IMAGE_HEIGHT = 50, //默认图标高度
|
|
||||||
IMAGE_WIDTH_AM = 60, //动画变换宽度
|
|
||||||
IMAGE_HEIGHT_AM = 60 //动画变换高度
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
CornerRadius="4"
|
CornerRadius="4"
|
||||||
Width="300"
|
Width="300"
|
||||||
Height="300"
|
Height="300"
|
||||||
Opacity="0.9">
|
>
|
||||||
<Border.Resources>
|
<Border.Resources>
|
||||||
<Style x:Key="LeftTB" TargetType="TextBlock" BasedOn="{StaticResource TextBlockBaseStyle}">
|
<Style x:Key="LeftTB" TargetType="TextBlock" BasedOn="{StaticResource TextBlockBaseStyle}">
|
||||||
<Setter Property="Width" Value="40"/>
|
<Setter Property="Width" Value="40"/>
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
</Style>
|
</Style>
|
||||||
</Border.Resources>
|
</Border.Resources>
|
||||||
<Border.Background>
|
<Border.Background>
|
||||||
<SolidColorBrush Color="AliceBlue" Opacity="0.9"/>
|
<SolidColorBrush Color="AliceBlue" Opacity="0.98"/>
|
||||||
</Border.Background>
|
</Border.Background>
|
||||||
<hc:SimplePanel Margin="10">
|
<hc:SimplePanel Margin="10">
|
||||||
<Grid Margin="8,20,8,20">
|
<Grid Margin="8,20,8,20">
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
</hc:UniformSpacingPanel>
|
</hc:UniformSpacingPanel>
|
||||||
<hc:Divider LineStrokeDashArray="3,3" Margin="0,200,0,-27" LineStroke="Black" Grid.ColumnSpan="4"/>
|
<hc:Divider LineStrokeDashArray="3,3" Margin="0,200,0,-27" LineStroke="Black" Grid.ColumnSpan="4"/>
|
||||||
<hc:UniformSpacingPanel Spacing="10" Margin="0,218,0,-38" Grid.ColumnSpan="4">
|
<hc:UniformSpacingPanel Spacing="10" Margin="0,218,0,-38" Grid.ColumnSpan="4">
|
||||||
<Button Content="保存" Command="hc:ControlCommands.Close" Click="SaveProperty" Margin="208,6,-208,-10"/>
|
<Button Content="保存" Click="SaveProperty" Margin="208,6,-208,-10"/>
|
||||||
</hc:UniformSpacingPanel>
|
</hc:UniformSpacingPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Button Width="22" Height="22" Command="hc:ControlCommands.Close" Style="{StaticResource ButtonIcon}" Foreground="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" hc:IconElement.Geometry="{StaticResource ErrorGeometry}" Padding="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,4,4,0"/>
|
<Button Width="22" Height="22" Command="hc:ControlCommands.Close" Style="{StaticResource ButtonIcon}" Foreground="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" hc:IconElement.Geometry="{StaticResource ErrorGeometry}" Padding="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,4,4,0"/>
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ namespace GeekDesk.Control.Other
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class IconInfoDialog
|
public partial class IconInfoDialog
|
||||||
{
|
{
|
||||||
|
public HandyControl.Controls.Dialog dialog;
|
||||||
|
|
||||||
public IconInfoDialog()
|
public IconInfoDialog()
|
||||||
{
|
{
|
||||||
@@ -38,6 +39,7 @@ namespace GeekDesk.Control.Other
|
|||||||
info.Name = IconName.Text;
|
info.Name = IconName.Text;
|
||||||
info.AdminStartUp = IconIsAdmin.IsChecked.Value;
|
info.AdminStartUp = IconIsAdmin.IsChecked.Value;
|
||||||
CommonCode.SaveAppData(MainWindow.appData);
|
CommonCode.SaveAppData(MainWindow.appData);
|
||||||
|
dialog.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -47,7 +49,7 @@ namespace GeekDesk.Control.Other
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void ReStoreImage(object sender, RoutedEventArgs e)
|
private void ReStoreImage(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
IconInfo info = ((Button)sender).Tag as IconInfo;
|
IconInfo info = this.DataContext as IconInfo;
|
||||||
info.BitmapImage = ImageUtil.ByteArrToImage(info.DefaultImage);
|
info.BitmapImage = ImageUtil.ByteArrToImage(info.DefaultImage);
|
||||||
CommonCode.SaveAppData(MainWindow.appData);
|
CommonCode.SaveAppData(MainWindow.appData);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<Border x:Class="GeekDesk.Control.Other.MenuGeometryDialog"
|
<Border x:Class="GeekDesk.Control.Other.IconInfoUrlDialog"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||||
CornerRadius="10"
|
CornerRadius="4"
|
||||||
Width="300"
|
Width="300"
|
||||||
Height="300"
|
Height="300"
|
||||||
Opacity="0.9">
|
>
|
||||||
<!--<Border.Resources>
|
<Border.Resources>
|
||||||
<Style x:Key="LeftTB" TargetType="TextBlock" BasedOn="{StaticResource TextBlockBaseStyle}">
|
<Style x:Key="LeftTB" TargetType="TextBlock" BasedOn="{StaticResource TextBlockBaseStyle}">
|
||||||
<Setter Property="Width" Value="40"/>
|
<Setter Property="Width" Value="40"/>
|
||||||
<Setter Property="HorizontalAlignment" Value="Left"/>
|
<Setter Property="HorizontalAlignment" Value="Left"/>
|
||||||
@@ -15,42 +15,31 @@
|
|||||||
</Style>
|
</Style>
|
||||||
</Border.Resources>
|
</Border.Resources>
|
||||||
<Border.Background>
|
<Border.Background>
|
||||||
<SolidColorBrush Color="AliceBlue" Opacity="0.9"/>
|
<SolidColorBrush Color="AliceBlue" Opacity="0.98"/>
|
||||||
</Border.Background>
|
</Border.Background>
|
||||||
<hc:SimplePanel Margin="10">
|
<hc:SimplePanel Margin="10">
|
||||||
<Grid Margin="8,20,8,20">
|
<Grid Margin="8,20,8,20">
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="93*"/>
|
|
||||||
<ColumnDefinition Width="38*"/>
|
|
||||||
<ColumnDefinition Width="126*"/>
|
|
||||||
<ColumnDefinition Width="7*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<hc:UniformSpacingPanel Spacing="10" Grid.ColumnSpan="4">
|
<hc:UniformSpacingPanel Spacing="10" Grid.ColumnSpan="4">
|
||||||
<TextBlock Text="名称:" Style="{StaticResource LeftTB}"/>
|
<TextBlock Text="名称:" Style="{StaticResource LeftTB}"/>
|
||||||
<TextBox x:Name="IconName" Text="{Binding Name, Mode=OneWay}" Width="180" FontSize="14"/>
|
<TextBox x:Name="IconName" Text="{Binding Name, Mode=OneWay}" Width="180" FontSize="14"/>
|
||||||
</hc:UniformSpacingPanel>
|
</hc:UniformSpacingPanel>
|
||||||
<hc:Divider LineStrokeDashArray="3,3" Margin="0,50,0,71" LineStroke="Black" Grid.ColumnSpan="4"/>
|
<hc:Divider LineStrokeDashArray="3,3" Margin="0,50,0,71" LineStroke="Black" Grid.ColumnSpan="4"/>
|
||||||
<hc:UniformSpacingPanel Spacing="10" Margin="0,59,0,-9" Grid.ColumnSpan="4">
|
<hc:UniformSpacingPanel Spacing="10" Margin="0,77,0,-27">
|
||||||
|
<TextBlock Text="Url:" Style="{StaticResource LeftTB}"/>
|
||||||
|
<TextBox x:Name="IconUrl" Text="{Binding Path, Mode=OneWay}" Width="180" FontSize="14"/>
|
||||||
|
</hc:UniformSpacingPanel>
|
||||||
|
<hc:Divider LineStrokeDashArray="3,3" Margin="0,128,0,23" LineStroke="Black" Grid.ColumnSpan="4"/>
|
||||||
|
<hc:UniformSpacingPanel Spacing="10" Margin="0,133,0,27">
|
||||||
<TextBlock Text="图标:" Style="{StaticResource LeftTB}"/>
|
<TextBlock Text="图标:" Style="{StaticResource LeftTB}"/>
|
||||||
<Image x:Name="IconImg" Source="{Binding BitmapImage, Mode=OneWay}" Width="60" Height="60"/>
|
<Image x:Name="IconImg" Source="{Binding BitmapImage, Mode=OneWay}" Width="60" Height="60"/>
|
||||||
<Button Content="修改" Click="EditImage"/>
|
<Button Content="修改" Click="EditImage"/>
|
||||||
<Button Content="重置" Click="ReStoreImage"/>
|
<Button Content="重置" Click="ReStoreImage"/>
|
||||||
</hc:UniformSpacingPanel>
|
</hc:UniformSpacingPanel>
|
||||||
<hc:Divider LineStrokeDashArray="3,3" Margin="0,128,0,23" LineStroke="Black" Grid.ColumnSpan="4"/>
|
|
||||||
<hc:UniformSpacingPanel Spacing="10" Margin="0,150,0,10" Grid.ColumnSpan="4">
|
|
||||||
<CheckBox x:Name="IconIsAdmin" Content="始终以管理员方式启动" IsChecked="{Binding AdminStartUp, Mode=OneWay}">
|
|
||||||
<CheckBox.Background>
|
|
||||||
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
|
|
||||||
<GradientStop Color="#FF9EA3A6"/>
|
|
||||||
</LinearGradientBrush>
|
|
||||||
</CheckBox.Background>
|
|
||||||
</CheckBox>
|
|
||||||
</hc:UniformSpacingPanel>
|
|
||||||
<hc:Divider LineStrokeDashArray="3,3" Margin="0,200,0,-27" LineStroke="Black" Grid.ColumnSpan="4"/>
|
<hc:Divider LineStrokeDashArray="3,3" Margin="0,200,0,-27" LineStroke="Black" Grid.ColumnSpan="4"/>
|
||||||
<hc:UniformSpacingPanel Spacing="10" Margin="0,218,0,-38" Grid.ColumnSpan="4">
|
<hc:UniformSpacingPanel Spacing="10" Margin="0,218,0,-38" Grid.ColumnSpan="4">
|
||||||
<Button Content="保存" Command="hc:ControlCommands.Close" Click="SaveProperty" Margin="208,6,-208,-10"/>
|
<Button Content="保存" Click="SaveProperty" Margin="208,6,-208,-10"/>
|
||||||
</hc:UniformSpacingPanel>
|
</hc:UniformSpacingPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Button Width="22" Height="22" Command="hc:ControlCommands.Close" Style="{StaticResource ButtonIcon}" Foreground="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" hc:IconElement.Geometry="{StaticResource ErrorGeometry}" Padding="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,4,4,0"/>
|
<Button Width="22" Height="22" Command="hc:ControlCommands.Close" Style="{StaticResource ButtonIcon}" Foreground="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" hc:IconElement.Geometry="{StaticResource ErrorGeometry}" Padding="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,4,4,0"/>
|
||||||
</hc:SimplePanel>-->
|
</hc:SimplePanel>
|
||||||
</Border>
|
</Border>
|
||||||
99
Control/Other/IconInfoUrlDialog.xaml.cs
Normal file
99
Control/Other/IconInfoUrlDialog.xaml.cs
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
using GeekDesk.Constant;
|
||||||
|
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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// TextDialog.xaml 的交互逻辑
|
||||||
|
/// </summary>
|
||||||
|
public partial class IconInfoUrlDialog
|
||||||
|
{
|
||||||
|
public HandyControl.Controls.Dialog dialog;
|
||||||
|
|
||||||
|
private bool newIconInfo;
|
||||||
|
public IconInfoUrlDialog()
|
||||||
|
{
|
||||||
|
newIconInfo = true;
|
||||||
|
IconInfo info = new IconInfo
|
||||||
|
{
|
||||||
|
BitmapImage = ImageUtil.Base64ToBitmapImage(Constants.URL_ICON_IMG_BASE64),
|
||||||
|
};
|
||||||
|
info.DefaultImage = info.ImageByteArr;
|
||||||
|
info.IconType = IconType.URL;
|
||||||
|
this.DataContext = info;
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public IconInfoUrlDialog(IconInfo info)
|
||||||
|
{
|
||||||
|
this.DataContext = info;
|
||||||
|
newIconInfo = false;
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 保存修改属性
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void SaveProperty(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
IconInfo info = this.DataContext as IconInfo;
|
||||||
|
info.BitmapImage = IconImg.Source as BitmapImage;
|
||||||
|
info.Name = IconName.Text;
|
||||||
|
info.Path = IconUrl.Text;
|
||||||
|
if (newIconInfo)
|
||||||
|
{
|
||||||
|
MainWindow.appData.MenuList[MainWindow.appData.AppConfig.SelectedMenuIndex].IconList.Add(info);
|
||||||
|
}
|
||||||
|
CommonCode.SaveAppData(MainWindow.appData);
|
||||||
|
dialog.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改图标为默认
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void ReStoreImage(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
IconInfo info = this.DataContext as IconInfo;
|
||||||
|
info.BitmapImage = ImageUtil.ByteArrToImage(info.DefaultImage);
|
||||||
|
CommonCode.SaveAppData(MainWindow.appData);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改图标
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void EditImage(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
OpenFileDialog ofd = new OpenFileDialog
|
||||||
|
{
|
||||||
|
Multiselect = false, //只允许选中单个文件
|
||||||
|
Filter = "所有文件(*.*)|*.*"
|
||||||
|
};
|
||||||
|
if (ofd.ShowDialog() == true)
|
||||||
|
{
|
||||||
|
IconInfo info = this.DataContext as IconInfo;
|
||||||
|
info.BitmapImage = ImageUtil.GetBitmapIconByPath(ofd.FileName);
|
||||||
|
CommonCode.SaveAppData(MainWindow.appData);
|
||||||
|
}
|
||||||
|
} catch (Exception)
|
||||||
|
{
|
||||||
|
HandyControl.Controls.Growl.WarningGlobal("修改图标失败,已重置为默认图标!");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
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.Imaging;
|
|
||||||
using System.Windows.Navigation;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
|
|
||||||
namespace GeekDesk.Control.Other
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// MenuGeometryDialogxaml.xaml 的交互逻辑
|
|
||||||
/// </summary>
|
|
||||||
public partial class MenuGeometryDialog
|
|
||||||
{
|
|
||||||
public MenuGeometryDialog()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -13,7 +13,8 @@
|
|||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<cvt:UpdateTypeConvert x:Key="UpdateTypeConvert"/>
|
<cvt:UpdateTypeConvert x:Key="UpdateTypeConvert"/>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<hc:SimplePanel Margin="20,50,20,20">
|
<Grid MouseDown="DragMove" Background="AliceBlue">
|
||||||
|
<hc:SimplePanel Margin="20,50,20,20" >
|
||||||
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Top">
|
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Top">
|
||||||
<Image Source="/Resource/Image/About.png" Width="400" Height="100"/>
|
<Image Source="/Resource/Image/About.png" Width="400" Height="100"/>
|
||||||
<TextBlock x:Name="AppInfo" TextAlignment="Center" Text="Copyright © 2021 GeekDesk "/>
|
<TextBlock x:Name="AppInfo" TextAlignment="Center" Text="Copyright © 2021 GeekDesk "/>
|
||||||
@@ -63,7 +64,7 @@
|
|||||||
</hc:UniformSpacingPanel>
|
</hc:UniformSpacingPanel>
|
||||||
<TextBlock Margin="0,20,0,0" FontSize="13" Width="200" TextAlignment="Center" Text="这是个人开发的程序,所有人可任意修改和免费使用(商用请联系作者)" TextWrapping="Wrap"/>
|
<TextBlock Margin="0,20,0,0" FontSize="13" Width="200" TextAlignment="Center" Text="这是个人开发的程序,所有人可任意修改和免费使用(商用请联系作者)" TextWrapping="Wrap"/>
|
||||||
|
|
||||||
<hc:UniformSpacingPanel Spacing="10" Visibility="Visible" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,10,0,0">
|
<!--<hc:UniformSpacingPanel Spacing="10" Visibility="Visible" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,10,0,0">
|
||||||
<TextBlock Text="更新源:" TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<TextBlock Text="更新源:" TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
<RadioButton Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}"
|
<RadioButton Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}"
|
||||||
Style="{StaticResource RadioButtonIcon}" Content="Gitee"
|
Style="{StaticResource RadioButtonIcon}" Content="Gitee"
|
||||||
@@ -71,8 +72,10 @@
|
|||||||
<RadioButton Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}"
|
<RadioButton Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}"
|
||||||
Style="{StaticResource RadioButtonIcon}" Content="GitHub"
|
Style="{StaticResource RadioButtonIcon}" Content="GitHub"
|
||||||
IsChecked="{Binding UpdateType, Mode=TwoWay, Converter={StaticResource UpdateTypeConvert}, ConverterParameter=2}"/>
|
IsChecked="{Binding UpdateType, Mode=TwoWay, Converter={StaticResource UpdateTypeConvert}, ConverterParameter=2}"/>
|
||||||
</hc:UniformSpacingPanel>
|
</hc:UniformSpacingPanel>-->
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</hc:SimplePanel>
|
</hc:SimplePanel>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -31,5 +31,18 @@ namespace GeekDesk.Control.UserControls.Config
|
|||||||
WeChatCode.Source = ImageUtil.Base64ToBitmapImage(Constants.WE_CHAT_CODE_IMG_BASE64);
|
WeChatCode.Source = ImageUtil.Base64ToBitmapImage(Constants.WE_CHAT_CODE_IMG_BASE64);
|
||||||
ZFBCode.Source = ImageUtil.Base64ToBitmapImage(Constants.ZFB_CODE_IMG_BASE64);
|
ZFBCode.Source = ImageUtil.Base64ToBitmapImage(Constants.ZFB_CODE_IMG_BASE64);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 移动窗口
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void DragMove(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.LeftButton == MouseButtonState.Pressed)
|
||||||
|
{
|
||||||
|
Window.GetWindow(this).DragMove();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,8 @@
|
|||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<cvt:HideTypeConvert x:Key="HideTypeConvert"/>
|
<cvt:HideTypeConvert x:Key="HideTypeConvert"/>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<hc:SimplePanel Margin="20">
|
<Grid Background="AliceBlue" MouseDown="DragMove">
|
||||||
|
<hc:SimplePanel Margin="20" >
|
||||||
<hc:UniformSpacingPanel Spacing="10" Margin="0,0,0,10" Grid.ColumnSpan="4">
|
<hc:UniformSpacingPanel Spacing="10" Margin="0,0,0,10" Grid.ColumnSpan="4">
|
||||||
<TextBlock Text="面板动作设置" VerticalAlignment="Center"/>
|
<TextBlock Text="面板动作设置" VerticalAlignment="Center"/>
|
||||||
</hc:UniformSpacingPanel>
|
</hc:UniformSpacingPanel>
|
||||||
@@ -81,5 +82,7 @@
|
|||||||
</hc:UniformSpacingPanel>-->
|
</hc:UniformSpacingPanel>-->
|
||||||
<StackPanel hc:Growl.GrowlParent="True" hc:Growl.Token="HotKeyGrowl" VerticalAlignment="Top"/>
|
<StackPanel hc:Growl.GrowlParent="True" hc:Growl.Token="HotKeyGrowl" VerticalAlignment="Top"/>
|
||||||
</hc:SimplePanel>
|
</hc:SimplePanel>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -229,6 +229,19 @@ namespace GeekDesk.Control.UserControls.Config
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 移动窗口
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void DragMove(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.LeftButton == MouseButtonState.Pressed)
|
||||||
|
{
|
||||||
|
Window.GetWindow(this).DragMove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//private void ShowApp(MainWindow mainWindow)
|
//private void ShowApp(MainWindow mainWindow)
|
||||||
//{
|
//{
|
||||||
// if (appConfig.FollowMouse)
|
// if (appConfig.FollowMouse)
|
||||||
|
|||||||
@@ -14,7 +14,8 @@
|
|||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<cvt:UpdateTypeConvert x:Key="UpdateTypeConvert"/>
|
<cvt:UpdateTypeConvert x:Key="UpdateTypeConvert"/>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<hc:SimplePanel Margin="20">
|
<Grid MouseDown="DragMove" Background="AliceBlue">
|
||||||
|
<hc:SimplePanel Margin="20" >
|
||||||
<StackPanel >
|
<StackPanel >
|
||||||
<TextBlock Text="程序设置" />
|
<TextBlock Text="程序设置" />
|
||||||
<hc:UniformSpacingPanel Spacing="10" Margin="20,8,0,0">
|
<hc:UniformSpacingPanel Spacing="10" Margin="20,8,0,0">
|
||||||
@@ -54,5 +55,7 @@
|
|||||||
</hc:UniformSpacingPanel>
|
</hc:UniformSpacingPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</hc:SimplePanel>
|
</hc:SimplePanel>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -33,5 +33,18 @@ namespace GeekDesk.Control.UserControls.Config
|
|||||||
AppConfig appConfig = MainWindow.appData.AppConfig;
|
AppConfig appConfig = MainWindow.appData.AppConfig;
|
||||||
RegisterUtil.SetSelfStarting(appConfig.SelfStartUp, Constants.MY_NAME);
|
RegisterUtil.SetSelfStarting(appConfig.SelfStartUp, Constants.MY_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 移动窗口
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void DragMove(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.LeftButton == MouseButtonState.Pressed)
|
||||||
|
{
|
||||||
|
Window.GetWindow(this).DragMove();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,9 +7,12 @@
|
|||||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Background="AliceBlue"
|
Background="AliceBlue"
|
||||||
d:DesignHeight="380" d:DesignWidth="450">
|
d:DesignHeight="500" d:DesignWidth="450">
|
||||||
<hc:SimplePanel Margin="20">
|
|
||||||
|
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<Grid MouseDown="DragMove" Background="AliceBlue">
|
||||||
|
<hc:SimplePanel Margin="20" >
|
||||||
<hc:UniformSpacingPanel Spacing="10" Margin="0,0,-40,-12" Grid.ColumnSpan="4">
|
<hc:UniformSpacingPanel Spacing="10" Margin="0,0,-40,-12" Grid.ColumnSpan="4">
|
||||||
<TextBlock Text="背景图片" VerticalAlignment="Center"/>
|
<TextBlock Text="背景图片" VerticalAlignment="Center"/>
|
||||||
</hc:UniformSpacingPanel>
|
</hc:UniformSpacingPanel>
|
||||||
@@ -97,6 +100,24 @@
|
|||||||
</hc:PreviewSlider>
|
</hc:PreviewSlider>
|
||||||
</hc:UniformSpacingPanel>
|
</hc:UniformSpacingPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
<hc:Divider LineStrokeDashArray="3,3" Margin="0,341.5,0,-215.5" LineStroke="Black" Grid.ColumnSpan="4"/>
|
||||||
|
<hc:UniformSpacingPanel Spacing="10" Margin="0,354,-40,-388.313" Grid.ColumnSpan="4">
|
||||||
|
<TextBlock VerticalAlignment="Center" Text="图标字体颜色:" />
|
||||||
|
<TextBlock VerticalAlignment="Center" Text="{Binding TextColor}" Width="100"/>
|
||||||
|
<Button Content="选择" Click="ColorButton_Click"/>
|
||||||
|
</hc:UniformSpacingPanel>
|
||||||
</hc:SimplePanel>
|
</hc:SimplePanel>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<StackPanel x:Name="ColorPanel" Visibility="Collapsed" VerticalAlignment="Center">
|
||||||
|
<StackPanel.Background>
|
||||||
|
<SolidColorBrush Color="AliceBlue" Opacity="0"/>
|
||||||
|
</StackPanel.Background>
|
||||||
|
<hc:ColorPicker
|
||||||
|
Name="ColorPicker"
|
||||||
|
Canceled="ColorPicker_Canceled"
|
||||||
|
SelectedColorChanged="ColorPicker_SelectedColorChanged"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ namespace GeekDesk.Control.UserControls.Config
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class ThemeControl : System.Windows.Controls.UserControl
|
public partial class ThemeControl : System.Windows.Controls.UserControl
|
||||||
{
|
{
|
||||||
|
|
||||||
|
private static AppConfig appConfig = MainWindow.appData.AppConfig;
|
||||||
public ThemeControl()
|
public ThemeControl()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@@ -35,7 +37,6 @@ namespace GeekDesk.Control.UserControls.Config
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void BGButton_Click(object sender, RoutedEventArgs e)
|
private void BGButton_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
AppConfig appConfig = MainWindow.appData.AppConfig;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -56,5 +57,35 @@ namespace GeekDesk.Control.UserControls.Config
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ColorButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
ColorPanel.Visibility = Visibility.Visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ColorPicker_Canceled(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ColorPanel.Visibility = Visibility.Collapsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ColorPicker_SelectedColorChanged(object sender, HandyControl.Data.FunctionEventArgs<Color> e)
|
||||||
|
{
|
||||||
|
SolidColorBrush scb = ColorPicker.SelectedBrush;
|
||||||
|
appConfig.TextColor = scb.ToString();
|
||||||
|
ColorPanel.Visibility = Visibility.Collapsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 移动窗口
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void DragMove(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.LeftButton == MouseButtonState.Pressed)
|
||||||
|
{
|
||||||
|
Window.GetWindow(this).DragMove();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
<!--左侧栏样式动画-->
|
<!--左侧栏样式动画-->
|
||||||
<Style x:Key="MenuStyle" TargetType="ListBoxItem" BasedOn="{StaticResource ListBoxItemBaseStyle}">
|
<Style x:Key="MenuStyle" TargetType="ListBoxItem" BasedOn="{StaticResource ListBoxItemBaseStyle}">
|
||||||
<Setter Property="FontSize" Value="15"/>
|
<Setter Property="FontSize" Value="16"/>
|
||||||
<Setter Property="Margin" Value="0,0,0,1"/>
|
<Setter Property="Margin" Value="0,0,0,1"/>
|
||||||
<Setter Property="Background">
|
<Setter Property="Background">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
@@ -30,8 +30,8 @@
|
|||||||
</MultiTrigger.Conditions>
|
</MultiTrigger.Conditions>
|
||||||
<MultiTrigger.EnterActions>
|
<MultiTrigger.EnterActions>
|
||||||
<BeginStoryboard>
|
<BeginStoryboard>
|
||||||
<Storyboard>
|
<Storyboard Timeline.DesiredFrameRate="60">
|
||||||
<DoubleAnimation To="15" Duration="0:0:0.5" Storyboard.TargetProperty="FontSize"/>
|
<DoubleAnimation To="16" Duration="0:0:0.2" Storyboard.TargetProperty="FontSize"/>
|
||||||
</Storyboard>
|
</Storyboard>
|
||||||
</BeginStoryboard>
|
</BeginStoryboard>
|
||||||
</MultiTrigger.EnterActions>
|
</MultiTrigger.EnterActions>
|
||||||
@@ -103,7 +103,7 @@
|
|||||||
|
|
||||||
<ListBox.ItemsPanel>
|
<ListBox.ItemsPanel>
|
||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
<DraggAnimatedPanel:DraggAnimatedPanel ItemsHeight="30" ItemsWidth="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type ListBox},AncestorLevel=1},Path=Tag, Mode=TwoWay, Converter={StaticResource MenuWidthConvert}}" HorizontalAlignment="Center" VerticalAlignment="Top" SwapCommand="{Binding SwapCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"/>
|
<DraggAnimatedPanel:DraggAnimatedPanel ItemsHeight="33" ItemsWidth="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type ListBox},AncestorLevel=1},Path=Tag, Mode=TwoWay, Converter={StaticResource MenuWidthConvert}, ConverterParameter=10}" HorizontalAlignment="Center" VerticalAlignment="Top" SwapCommand="{Binding SwapCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"/>
|
||||||
</ItemsPanelTemplate>
|
</ItemsPanelTemplate>
|
||||||
</ListBox.ItemsPanel>
|
</ListBox.ItemsPanel>
|
||||||
|
|
||||||
@@ -112,12 +112,15 @@
|
|||||||
<StackPanel MouseLeftButtonDown="MenuClick" MouseRightButtonDown="MenuClick" Tag="{Binding}">
|
<StackPanel MouseLeftButtonDown="MenuClick" MouseRightButtonDown="MenuClick" Tag="{Binding}">
|
||||||
<hc:TextBox Text="{Binding Path=MenuName, Mode=TwoWay}"
|
<hc:TextBox Text="{Binding Path=MenuName, Mode=TwoWay}"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type ListBox},AncestorLevel=1},Path=Tag, Mode=TwoWay, Converter={StaticResource MenuWidthConvert}}"
|
Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type ListBox},AncestorLevel=1},Path=Tag, Mode=TwoWay, Converter={StaticResource MenuWidthConvert}, ConverterParameter=35}"
|
||||||
FontSize="15"
|
FontSize="16"
|
||||||
|
Height="25"
|
||||||
|
VerticalAlignment="Center"
|
||||||
TextAlignment="Left"
|
TextAlignment="Left"
|
||||||
LostFocus="LostFocusOrEnterDown"
|
LostFocus="LostFocusOrEnterDown"
|
||||||
KeyDown="LostFocusOrEnterDown"
|
KeyDown="LostFocusOrEnterDown"
|
||||||
Tag="{Binding}"
|
Tag="{Binding}"
|
||||||
|
Margin="2"
|
||||||
IsVisibleChanged="MenuEditWhenVisibilityChanged"
|
IsVisibleChanged="MenuEditWhenVisibilityChanged"
|
||||||
Visibility="{Binding MenuEdit}"/>
|
Visibility="{Binding MenuEdit}"/>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
|
|||||||
@@ -15,6 +15,9 @@
|
|||||||
<Setter Property="Width" Value="{Binding ImageWidth}"/>
|
<Setter Property="Width" Value="{Binding ImageWidth}"/>
|
||||||
<Setter Property="Height" Value="{Binding ImageHeight}"/>
|
<Setter Property="Height" Value="{Binding ImageHeight}"/>
|
||||||
<Setter Property="Source" Value="{Binding BitmapImage}"/>
|
<Setter Property="Source" Value="{Binding BitmapImage}"/>
|
||||||
|
<Setter Property="RenderOptions.BitmapScalingMode" Value="LowQuality" />
|
||||||
|
<Setter Property="RenderOptions.CachingHint" Value="Cache" />
|
||||||
|
|
||||||
</Style>
|
</Style>
|
||||||
<Style x:Key="MyListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
|
<Style x:Key="MyListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
@@ -28,7 +31,6 @@
|
|||||||
</Setter>
|
</Setter>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<cvt:MenuWidthConvert x:Key="MenuWidthConvert"/>
|
|
||||||
<cvt:OpcityConvert x:Key="OpcityConvert"/>
|
<cvt:OpcityConvert x:Key="OpcityConvert"/>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
|
|
||||||
@@ -44,6 +46,11 @@
|
|||||||
<hc:Card.BorderBrush>
|
<hc:Card.BorderBrush>
|
||||||
<SolidColorBrush Color="#FFFFFFFF" Opacity="0"/>
|
<SolidColorBrush Color="#FFFFFFFF" Opacity="0"/>
|
||||||
</hc:Card.BorderBrush>
|
</hc:Card.BorderBrush>
|
||||||
|
<hc:Card.ContextMenu>
|
||||||
|
<ContextMenu Width="200">
|
||||||
|
<MenuItem Header="添加URL项目" Click="AddUrlIcon"/>
|
||||||
|
</ContextMenu>
|
||||||
|
</hc:Card.ContextMenu>
|
||||||
<WrapPanel Orientation="Horizontal">
|
<WrapPanel Orientation="Horizontal">
|
||||||
<ListBox x:Name="IconListBox" ItemsSource="{Binding AppConfig.SelectedMenuIcons, Mode=TwoWay}"
|
<ListBox x:Name="IconListBox" ItemsSource="{Binding AppConfig.SelectedMenuIcons, Mode=TwoWay}"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
@@ -53,8 +60,8 @@
|
|||||||
</ListBox.Background>
|
</ListBox.Background>
|
||||||
<ListBox.ItemsPanel>
|
<ListBox.ItemsPanel>
|
||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
<DraggAnimatedPanel:DraggAnimatedPanel ItemsHeight="110"
|
<DraggAnimatedPanel:DraggAnimatedPanel ItemsHeight="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImgPanelHeight}"
|
||||||
ItemsWidth="110"
|
ItemsWidth="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImgPanelWidth}"
|
||||||
Background="#00FFFFFF"
|
Background="#00FFFFFF"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
SwapCommand="{Binding SwapCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"/>
|
SwapCommand="{Binding SwapCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"/>
|
||||||
@@ -65,6 +72,7 @@
|
|||||||
<ContextMenu x:Key="IconDialog" Width="200">
|
<ContextMenu x:Key="IconDialog" Width="200">
|
||||||
<MenuItem Header="管理员方式运行" Click="IconAdminStart" Tag="{Binding}"/>
|
<MenuItem Header="管理员方式运行" Click="IconAdminStart" Tag="{Binding}"/>
|
||||||
<MenuItem Header="打开文件所在位置" Click="ShowInExplore" Tag="{Binding}"/>
|
<MenuItem Header="打开文件所在位置" Click="ShowInExplore" Tag="{Binding}"/>
|
||||||
|
<MenuItem Header="添加URL项目" Click="AddUrlIcon"/>
|
||||||
<MenuItem Header="资源管理器菜单" Click="SystemContextMenu" Tag="{Binding}"/>
|
<MenuItem Header="资源管理器菜单" Click="SystemContextMenu" Tag="{Binding}"/>
|
||||||
<MenuItem Header="属性" Click="PropertyConfig" Tag="{Binding}"/>
|
<MenuItem Header="属性" Click="PropertyConfig" Tag="{Binding}"/>
|
||||||
<MenuItem Header="从列表移除" Click="RemoveIcon" Tag="{Binding}"/>
|
<MenuItem Header="从列表移除" Click="RemoveIcon" Tag="{Binding}"/>
|
||||||
@@ -80,8 +88,8 @@
|
|||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<StackPanel Tag="{Binding}"
|
<StackPanel Tag="{Binding}"
|
||||||
Height="110"
|
Height="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImgPanelHeight}"
|
||||||
Width="110"
|
Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImgPanelWidth}"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
hc:Poptip.HitMode="None"
|
hc:Poptip.HitMode="None"
|
||||||
hc:Poptip.IsOpen="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}"
|
hc:Poptip.IsOpen="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}"
|
||||||
@@ -92,7 +100,7 @@
|
|||||||
MouseEnter="StackPanel_MouseEnter"
|
MouseEnter="StackPanel_MouseEnter"
|
||||||
MouseLeave="StackPanel_MouseLeave"
|
MouseLeave="StackPanel_MouseLeave"
|
||||||
>
|
>
|
||||||
<Image Style="{StaticResource ImageStyle}"/>
|
<Image CacheMode="{Binding BitmapCache}" Style="{StaticResource ImageStyle}"/>
|
||||||
<TextBlock MaxWidth="80"
|
<TextBlock MaxWidth="80"
|
||||||
Margin="0,5,0,0"
|
Margin="0,5,0,0"
|
||||||
MaxHeight="40"
|
MaxHeight="40"
|
||||||
@@ -101,6 +109,7 @@
|
|||||||
TextTrimming="WordEllipsis"
|
TextTrimming="WordEllipsis"
|
||||||
TextAlignment="Center"
|
TextAlignment="Center"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
|
Foreground="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.TextColor}"
|
||||||
Text="{Binding Name}"/>
|
Text="{Binding Name}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
|||||||
public partial class RightCardControl : UserControl
|
public partial class RightCardControl : UserControl
|
||||||
{
|
{
|
||||||
private AppData appData = MainWindow.appData;
|
private AppData appData = MainWindow.appData;
|
||||||
|
|
||||||
public RightCardControl()
|
public RightCardControl()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@@ -109,16 +110,16 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
Process p = new Process();
|
||||||
|
p.StartInfo.FileName = icon.Path;
|
||||||
|
if (icon.IconType == IconType.OTHER)
|
||||||
|
{
|
||||||
if (!File.Exists(icon.Path) && !Directory.Exists(icon.Path))
|
if (!File.Exists(icon.Path) && !Directory.Exists(icon.Path))
|
||||||
{
|
{
|
||||||
HandyControl.Controls.Growl.WarningGlobal("程序启动失败(文件路径不存在或已删除)!");
|
HandyControl.Controls.Growl.WarningGlobal("程序启动失败(文件路径不存在或已删除)!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
p.StartInfo.WorkingDirectory = icon.Path.Substring(0, icon.Path.LastIndexOf("\\"));
|
||||||
Process p = new Process();
|
|
||||||
p.StartInfo.FileName = icon.Path;
|
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case IconStartType.ADMIN_STARTUP:
|
case IconStartType.ADMIN_STARTUP:
|
||||||
@@ -145,6 +146,7 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
|||||||
p.StartInfo.Arguments = "/e,/select," + icon.Path;
|
p.StartInfo.Arguments = "/e,/select," + icon.Path;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
p.Start();
|
p.Start();
|
||||||
icon.Count++;
|
icon.Count++;
|
||||||
}
|
}
|
||||||
@@ -165,7 +167,7 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
|||||||
{
|
{
|
||||||
string path = (string)obj;
|
string path = (string)obj;
|
||||||
|
|
||||||
//string base64 = ImageUtil.FileImageToBase64(path, ImageFormat.Jpeg);
|
//string base64 = ImageUtil.FileImageToBase64(path, ImageFormat.Png);
|
||||||
|
|
||||||
string ext = System.IO.Path.GetExtension(path).ToLower();
|
string ext = System.IO.Path.GetExtension(path).ToLower();
|
||||||
|
|
||||||
@@ -178,10 +180,11 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BitmapImage bi = ImageUtil.GetBitmapIconByPath(path);
|
||||||
IconInfo iconInfo = new IconInfo
|
IconInfo iconInfo = new IconInfo
|
||||||
{
|
{
|
||||||
Path = path,
|
Path = path,
|
||||||
BitmapImage = ImageUtil.GetBitmapIconByPath(path)
|
BitmapImage = bi
|
||||||
};
|
};
|
||||||
iconInfo.DefaultImage = iconInfo.ImageByteArr;
|
iconInfo.DefaultImage = iconInfo.ImageByteArr;
|
||||||
iconInfo.Name = System.IO.Path.GetFileNameWithoutExtension(path);
|
iconInfo.Name = System.IO.Path.GetFileNameWithoutExtension(path);
|
||||||
@@ -223,17 +226,29 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void PropertyConfig(object sender, RoutedEventArgs e)
|
private void PropertyConfig(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
HandyControl.Controls.Dialog.Show(new IconInfoDialog((IconInfo)((MenuItem)sender).Tag));
|
IconInfo info = (IconInfo)((MenuItem)sender).Tag;
|
||||||
|
switch (info.IconType)
|
||||||
|
{
|
||||||
|
case IconType.URL:
|
||||||
|
IconInfoUrlDialog urlDialog = new IconInfoUrlDialog(info);
|
||||||
|
urlDialog.dialog = HandyControl.Controls.Dialog.Show(urlDialog);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
IconInfoDialog dialog = new IconInfoDialog(info);
|
||||||
|
dialog.dialog = HandyControl.Controls.Dialog.Show(dialog);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void StackPanel_MouseEnter(object sender, MouseEventArgs e)
|
private void StackPanel_MouseEnter(object sender, MouseEventArgs e)
|
||||||
{
|
{
|
||||||
ImgStroyBoard(sender, (int)MainWindowEnum.IMAGE_HEIGHT_AM, (int)MainWindowEnum.IMAGE_WIDTH_AM, 1);
|
ImgStroyBoard(sender, (int)CommonEnum.IMAGE_HEIGHT_AM, (int)CommonEnum.IMAGE_WIDTH_AM, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void StackPanel_MouseLeave(object sender, MouseEventArgs e)
|
private void StackPanel_MouseLeave(object sender, MouseEventArgs e)
|
||||||
{
|
{
|
||||||
ImgStroyBoard(sender, (int)MainWindowEnum.IMAGE_HEIGHT, (int)MainWindowEnum.IMAGE_WIDTH, 250);
|
ImgStroyBoard(sender, (int)CommonEnum.IMAGE_HEIGHT, (int)CommonEnum.IMAGE_WIDTH, 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -266,5 +281,11 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
|||||||
img.BeginAnimation(HeightProperty, heightAnimation);
|
img.BeginAnimation(HeightProperty, heightAnimation);
|
||||||
img.BeginAnimation(WidthProperty, widthAnimation);
|
img.BeginAnimation(WidthProperty, widthAnimation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void AddUrlIcon(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
IconInfoUrlDialog urlDialog = new IconInfoUrlDialog();
|
||||||
|
urlDialog.dialog = HandyControl.Controls.Dialog.Show(urlDialog);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,7 +121,7 @@
|
|||||||
</hc:SideMenu>
|
</hc:SideMenu>
|
||||||
</hc:Card>
|
</hc:Card>
|
||||||
<hc:ScrollViewer Grid.Row="0" Grid.Column="1">
|
<hc:ScrollViewer Grid.Row="0" Grid.Column="1">
|
||||||
<hc:Card x:Name="RightCard" Height="448" MouseDown="DragMove">
|
<hc:Card x:Name="RightCard" Height="448">
|
||||||
</hc:Card>
|
</hc:Card>
|
||||||
</hc:ScrollViewer>
|
</hc:ScrollViewer>
|
||||||
|
|
||||||
|
|||||||
@@ -31,18 +31,7 @@ namespace GeekDesk.Control.Windows
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 移动窗口
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
private void DragMove(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
|
||||||
{
|
|
||||||
if (e.LeftButton == MouseButtonState.Pressed)
|
|
||||||
{
|
|
||||||
DragMove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 点击关闭按钮
|
/// 点击关闭按钮
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ using System.Windows;
|
|||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
using static GeekDesk.Util.ShowWindowFollowMouse;
|
||||||
|
|
||||||
namespace GeekDesk.Control.Windows
|
namespace GeekDesk.Control.Windows
|
||||||
{
|
{
|
||||||
@@ -132,6 +132,7 @@ namespace GeekDesk.Control.Windows
|
|||||||
window = new IconfontWindow(listInfo, menuInfo);
|
window = new IconfontWindow(listInfo, menuInfo);
|
||||||
}
|
}
|
||||||
window.Show();
|
window.Show();
|
||||||
|
ShowWindowFollowMouse.Show(window, MousePosition.LEFT_CENTER, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CustomButton_Click(object sender, RoutedEventArgs e)
|
private void CustomButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
|||||||
@@ -10,7 +10,9 @@ namespace GeekDesk.Converts
|
|||||||
{
|
{
|
||||||
if (value != null && value.ToString().Length > 0)
|
if (value != null && value.ToString().Length > 0)
|
||||||
{
|
{
|
||||||
return System.Convert.ToDouble(value.ToString()) - 10d;
|
if (parameter == null) parameter = 0.00;
|
||||||
|
double p = System.Convert.ToDouble(parameter.ToString());
|
||||||
|
return System.Convert.ToDouble(value.ToString()) - p;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
@@ -69,6 +70,7 @@
|
|||||||
<Reference Include="System.Drawing.Common, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="System.Drawing.Common, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>packages\System.Drawing.Common.6.0.0-preview.6.21352.12\lib\net461\System.Drawing.Common.dll</HintPath>
|
<HintPath>packages\System.Drawing.Common.6.0.0-preview.6.21352.12\lib\net461\System.Drawing.Common.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="System.Web.Extensions" />
|
||||||
<Reference Include="System.Windows.Forms" />
|
<Reference Include="System.Windows.Forms" />
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
@@ -92,7 +94,8 @@
|
|||||||
<Compile Include="Command\DelegateCommandBase.cs" />
|
<Compile Include="Command\DelegateCommandBase.cs" />
|
||||||
<Compile Include="Constant\AppHideType.cs" />
|
<Compile Include="Constant\AppHideType.cs" />
|
||||||
<Compile Include="Constant\Constants.cs" />
|
<Compile Include="Constant\Constants.cs" />
|
||||||
<Compile Include="Constant\MainWindowEnum.cs" />
|
<Compile Include="Constant\IconType.cs" />
|
||||||
|
<Compile Include="Constant\CommonEnum.cs" />
|
||||||
<Compile Include="Constant\IconStartType.cs" />
|
<Compile Include="Constant\IconStartType.cs" />
|
||||||
<Compile Include="Constant\SortType.cs" />
|
<Compile Include="Constant\SortType.cs" />
|
||||||
<Compile Include="Constant\UpdateType.cs" />
|
<Compile Include="Constant\UpdateType.cs" />
|
||||||
@@ -102,6 +105,9 @@
|
|||||||
<Compile Include="Control\Other\CustomIconUrlDialog.xaml.cs">
|
<Compile Include="Control\Other\CustomIconUrlDialog.xaml.cs">
|
||||||
<DependentUpon>CustomIconUrlDialog.xaml</DependentUpon>
|
<DependentUpon>CustomIconUrlDialog.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Control\Other\IconInfoUrlDialog.xaml.cs">
|
||||||
|
<DependentUpon>IconInfoUrlDialog.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Control\UserControls\Config\OtherControl.xaml.cs">
|
<Compile Include="Control\UserControls\Config\OtherControl.xaml.cs">
|
||||||
<DependentUpon>OtherControl.xaml</DependentUpon>
|
<DependentUpon>OtherControl.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -123,9 +129,6 @@
|
|||||||
<Compile Include="Control\Other\IconInfoDialog.xaml.cs">
|
<Compile Include="Control\Other\IconInfoDialog.xaml.cs">
|
||||||
<DependentUpon>IconInfoDialog.xaml</DependentUpon>
|
<DependentUpon>IconInfoDialog.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Control\Other\MenuGeometryDialog.xaml.cs">
|
|
||||||
<DependentUpon>MenuGeometryDialog.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Control\UserControls\Config\AboutControl.xaml.cs">
|
<Compile Include="Control\UserControls\Config\AboutControl.xaml.cs">
|
||||||
<DependentUpon>AboutControl.xaml</DependentUpon>
|
<DependentUpon>AboutControl.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -171,6 +174,7 @@
|
|||||||
<Compile Include="Util\MouseUtilities.cs" />
|
<Compile Include="Util\MouseUtilities.cs" />
|
||||||
<Compile Include="Util\RegisterUtil.cs" />
|
<Compile Include="Util\RegisterUtil.cs" />
|
||||||
<Compile Include="Util\ShellContextMenu.cs" />
|
<Compile Include="Util\ShellContextMenu.cs" />
|
||||||
|
<Compile Include="Util\ShowWindowFollowMouse.cs" />
|
||||||
<Compile Include="Util\StringUtil.cs" />
|
<Compile Include="Util\StringUtil.cs" />
|
||||||
<Compile Include="Util\SvgToGeometry.cs" />
|
<Compile Include="Util\SvgToGeometry.cs" />
|
||||||
<Compile Include="ViewModel\AppConfig.cs" />
|
<Compile Include="ViewModel\AppConfig.cs" />
|
||||||
@@ -187,6 +191,10 @@
|
|||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="Control\Other\IconInfoUrlDialog.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
<Page Include="Control\UserControls\Config\OtherControl.xaml">
|
<Page Include="Control\UserControls\Config\OtherControl.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
@@ -215,10 +223,6 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Control\Other\MenuGeometryDialog.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="Control\UserControls\Config\AboutControl.xaml">
|
<Page Include="Control\UserControls\Config\AboutControl.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ using System.Windows.Controls;
|
|||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Interop;
|
using System.Windows.Interop;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
using static GeekDesk.Util.ShowWindowFollowMouse;
|
||||||
|
|
||||||
namespace GeekDesk
|
namespace GeekDesk
|
||||||
{
|
{
|
||||||
@@ -260,7 +261,7 @@ namespace GeekDesk
|
|||||||
{
|
{
|
||||||
if (appData.AppConfig.FollowMouse)
|
if (appData.AppConfig.FollowMouse)
|
||||||
{
|
{
|
||||||
ShowAppAndFollowMouse();
|
ShowWindowFollowMouse.Show(mainWindow, MousePosition.CENTER, 0, 0);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
mainWindow.Visibility = Visibility.Visible;
|
mainWindow.Visibility = Visibility.Visible;
|
||||||
@@ -268,55 +269,8 @@ namespace GeekDesk
|
|||||||
Keyboard.Focus(mainWindow);
|
Keyboard.Focus(mainWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 随鼠标位置显示面板 (鼠标始终在中间)
|
|
||||||
/// </summary>
|
|
||||||
private static void ShowAppAndFollowMouse()
|
|
||||||
{
|
|
||||||
//获取鼠标位置
|
|
||||||
System.Windows.Point p = MouseUtil.GetMousePosition();
|
|
||||||
double left = SystemParameters.VirtualScreenLeft;
|
|
||||||
double top = SystemParameters.VirtualScreenTop;
|
|
||||||
double width = SystemParameters.VirtualScreenWidth;
|
|
||||||
double height = SystemParameters.VirtualScreenHeight;
|
|
||||||
double right = width - Math.Abs(left);
|
|
||||||
double bottom = height - Math.Abs(top);
|
|
||||||
|
|
||||||
|
|
||||||
if (p.X - mainWindow.Width / 2 < left)
|
|
||||||
{
|
|
||||||
//判断是否在最左边缘
|
|
||||||
mainWindow.Left = left;
|
|
||||||
}
|
|
||||||
else if (p.X + mainWindow.Width / 2 > right)
|
|
||||||
{
|
|
||||||
//判断是否在最右边缘
|
|
||||||
mainWindow.Left = right - mainWindow.Width;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mainWindow.Left = p.X - mainWindow.Width / 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (p.Y - mainWindow.Height / 2 < top)
|
|
||||||
{
|
|
||||||
//判断是否在最上边缘
|
|
||||||
mainWindow.Top = top;
|
|
||||||
}
|
|
||||||
else if (p.Y + mainWindow.Height / 2 > bottom)
|
|
||||||
{
|
|
||||||
//判断是否在最下边缘
|
|
||||||
mainWindow.Top = bottom - mainWindow.Height;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mainWindow.Top = p.Y - mainWindow.Height / 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
mainWindow.Visibility = Visibility.Visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 图片图标单击事件
|
/// 图片图标单击事件
|
||||||
|
|||||||
@@ -49,5 +49,5 @@ using System.Windows;
|
|||||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||||
//通过使用 "*",如下所示:
|
//通过使用 "*",如下所示:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("2.0")]
|
[assembly: AssemblyVersion("2.1")]
|
||||||
[assembly: AssemblyFileVersion("2.0")]
|
[assembly: AssemblyFileVersion("2.1")]
|
||||||
|
|||||||
@@ -30,6 +30,10 @@ namespace GeekDesk.Thread
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
|
//等待1分钟后再检查更新 有的网络连接过慢
|
||||||
|
System.Threading.Thread.Sleep(60 * 1000);
|
||||||
|
|
||||||
string updateUrl;
|
string updateUrl;
|
||||||
string nowVersion = ConfigurationManager.AppSettings["Version"];
|
string nowVersion = ConfigurationManager.AppSettings["Version"];
|
||||||
switch (appConfig.UpdateType)
|
switch (appConfig.UpdateType)
|
||||||
|
|||||||
10
Update.json
10
Update.json
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"title" : "<22>汾<EFBFBD><E6B1BE><EFBFBD><EFBFBD>",
|
"title" : "<22>汾<EFBFBD><E6B1BE><EFBFBD><EFBFBD>",
|
||||||
"subTitle" : "V2.0 <20><>ʽ<EFBFBD><CABD>",
|
"subTitle" : "V2.1 <20><>ʽ<EFBFBD><CABD>",
|
||||||
"msgTitle" : "<22><><EFBFBD>θ<EFBFBD><CEB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
"msgTitle" : "<22><><EFBFBD>θ<EFBFBD><CEB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
||||||
"msg" : "['<27><><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>²<EFBFBD><EFBFBD>ٵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD>','<27><EFBFBD><EFBFBD><EFBFBD>ʷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>bug','<27><EFBFBD>ijЩͼ<D0A9><CDBC><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1>С<EFBFBD><D0A1>bug','<27><><EFBFBD>Ӵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>óɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ','<27><><EFBFBD>ӵ<EFBFBD><D3B5><EFBFBD>ϵͳ<CFB5>˵<EFBFBD>']",
|
"msg" : "['<27><><EFBFBD>ֳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD><EFBFBD>ͼ<EFBFBD>깦<EFBFBD>ܳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>URL<52><4C>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>']",
|
||||||
"githubUrl" : "https://github.com/Demo-Liu/GeekDesk/releases/tag/2.0",
|
"githubUrl" : "https://github.com/Demo-Liu/GeekDesk/releases/tag/2.1",
|
||||||
"giteeUrl" : "https://gitee.com/demo_liu/GeekDesk/releases/2.0",
|
"giteeUrl" : "https://gitee.com/demo_liu/GeekDesk/releases/2.1",
|
||||||
"version": "2.0"
|
"version": "2.1"
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
using GeekDesk.Constant;
|
using GeekDesk.Constant;
|
||||||
using GeekDesk.ViewModel;
|
using GeekDesk.ViewModel;
|
||||||
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Runtime.Serialization.Formatters.Binary;
|
using System.Runtime.Serialization.Formatters.Binary;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 提取一些代码
|
/// 提取一些代码
|
||||||
@@ -53,6 +55,5 @@ namespace GeekDesk.Util
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,8 +19,9 @@ namespace GeekDesk.Util
|
|||||||
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(url);
|
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(url);
|
||||||
//通过Web访问对象获取响应内容
|
//通过Web访问对象获取响应内容
|
||||||
HttpWebResponse myResponse = (HttpWebResponse)myRequest.GetResponse();
|
HttpWebResponse myResponse = (HttpWebResponse)myRequest.GetResponse();
|
||||||
|
|
||||||
//通过响应内容流创建StreamReader对象,因为StreamReader更高级更快
|
//通过响应内容流创建StreamReader对象,因为StreamReader更高级更快
|
||||||
StreamReader reader = new StreamReader(myResponse.GetResponseStream(), Encoding.GetEncoding("gbk"));
|
StreamReader reader = new StreamReader(myResponse.GetResponseStream(), Encoding.UTF8);
|
||||||
string returnStr = reader.ReadToEnd();//利用StreamReader就可以从响应内容从头读到尾
|
string returnStr = reader.ReadToEnd();//利用StreamReader就可以从响应内容从头读到尾
|
||||||
reader.Close();
|
reader.Close();
|
||||||
myResponse.Close();
|
myResponse.Close();
|
||||||
|
|||||||
107
Util/ShowWindowFollowMouse.cs
Normal file
107
Util/ShowWindowFollowMouse.cs
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
using System;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
namespace GeekDesk.Util
|
||||||
|
{
|
||||||
|
public class ShowWindowFollowMouse
|
||||||
|
{
|
||||||
|
|
||||||
|
public enum MousePosition
|
||||||
|
{
|
||||||
|
CENTER = 1,
|
||||||
|
LEFT_TOP = 2,
|
||||||
|
LEFT_BOTTOM = 3,
|
||||||
|
RIGHT_TOP = 4,
|
||||||
|
RIGHT_BOTTOM = 5,
|
||||||
|
LEFT_CENTER = 6,
|
||||||
|
RIGHT_CENTER = 7
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 随鼠标位置显示面板 (鼠标始终在中间)
|
||||||
|
/// </summary>
|
||||||
|
public static void Show(Window window, MousePosition position, double widthOffset, double heightOffset)
|
||||||
|
{
|
||||||
|
//获取鼠标位置
|
||||||
|
System.Windows.Point p = MouseUtil.GetMousePosition();
|
||||||
|
double left = SystemParameters.VirtualScreenLeft;
|
||||||
|
double top = SystemParameters.VirtualScreenTop;
|
||||||
|
double width = SystemParameters.VirtualScreenWidth;
|
||||||
|
double height = SystemParameters.VirtualScreenHeight;
|
||||||
|
double right = width - Math.Abs(left);
|
||||||
|
double bottom = height - Math.Abs(top);
|
||||||
|
|
||||||
|
double afterWidth;
|
||||||
|
double afterHeight;
|
||||||
|
|
||||||
|
switch (position)
|
||||||
|
{
|
||||||
|
|
||||||
|
case MousePosition.LEFT_BOTTOM:
|
||||||
|
afterWidth = 0;
|
||||||
|
afterHeight = window.Height;
|
||||||
|
break;
|
||||||
|
case MousePosition.LEFT_TOP:
|
||||||
|
afterWidth = 0;
|
||||||
|
afterHeight = 0;
|
||||||
|
break;
|
||||||
|
case MousePosition.LEFT_CENTER:
|
||||||
|
afterWidth = 0;
|
||||||
|
afterHeight = window.Height / 2;
|
||||||
|
break;
|
||||||
|
case MousePosition.RIGHT_BOTTOM:
|
||||||
|
afterWidth = window.Width;
|
||||||
|
afterHeight = window.Height;
|
||||||
|
break;
|
||||||
|
case MousePosition.RIGHT_TOP:
|
||||||
|
afterWidth = window.Width;
|
||||||
|
afterHeight = 0;
|
||||||
|
break;
|
||||||
|
case MousePosition.RIGHT_CENTER:
|
||||||
|
afterWidth = window.Width;
|
||||||
|
afterHeight = window.Height / 2;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
afterWidth = window.Width / 2;
|
||||||
|
afterHeight = window.Height / 2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
afterWidth += widthOffset;
|
||||||
|
afterHeight -= heightOffset;
|
||||||
|
|
||||||
|
if (p.X - afterWidth < left)
|
||||||
|
{
|
||||||
|
//判断是否在最左边缘
|
||||||
|
window.Left = left;
|
||||||
|
}
|
||||||
|
else if (p.X + afterWidth > right)
|
||||||
|
{
|
||||||
|
//判断是否在最右边缘
|
||||||
|
window.Left = right - window.Width;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
window.Left = p.X - afterWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (p.Y - afterHeight < top)
|
||||||
|
{
|
||||||
|
//判断是否在最上边缘
|
||||||
|
window.Top = top;
|
||||||
|
}
|
||||||
|
else if (p.Y + afterHeight > bottom)
|
||||||
|
{
|
||||||
|
//判断是否在最下边缘
|
||||||
|
window.Top = bottom - window.Height;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
window.Top = p.Y - afterHeight;
|
||||||
|
}
|
||||||
|
window.Visibility = Visibility.Visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -19,9 +19,9 @@ namespace GeekDesk.ViewModel
|
|||||||
{
|
{
|
||||||
private SortType menuSortType = SortType.CUSTOM; //菜单排序类型
|
private SortType menuSortType = SortType.CUSTOM; //菜单排序类型
|
||||||
private SortType iconSortType = SortType.CUSTOM; //图表排序类型
|
private SortType iconSortType = SortType.CUSTOM; //图表排序类型
|
||||||
private double windowWidth = (double)MainWindowEnum.WINDOW_WIDTH; //窗口宽度
|
private double windowWidth = (double)CommonEnum.WINDOW_WIDTH; //窗口宽度
|
||||||
private double windowHeight = (double)MainWindowEnum.WINDOW_HEIGHT; //窗口高度
|
private double windowHeight = (double)CommonEnum.WINDOW_HEIGHT; //窗口高度
|
||||||
private double menuCardWidth = (double)MainWindowEnum.MENU_CARD_WIDHT;//菜单栏宽度
|
private double menuCardWidth = (double)CommonEnum.MENU_CARD_WIDHT;//菜单栏宽度
|
||||||
private int selectedMenuIndex = 0; //上次选中菜单索引
|
private int selectedMenuIndex = 0; //上次选中菜单索引
|
||||||
private bool followMouse = true; //面板跟随鼠标 默认是
|
private bool followMouse = true; //面板跟随鼠标 默认是
|
||||||
private Visibility configIconVisible = Visibility.Visible; // 设置按钮是否显示
|
private Visibility configIconVisible = Visibility.Visible; // 设置按钮是否显示
|
||||||
@@ -56,11 +56,56 @@ namespace GeekDesk.ViewModel
|
|||||||
|
|
||||||
private bool selfStartUp = true; //开机自启动设置
|
private bool selfStartUp = true; //开机自启动设置
|
||||||
private bool selfStartUped = false; //是否已设置
|
private bool selfStartUped = false; //是否已设置
|
||||||
|
|
||||||
private bool pmModel = false; //性能模式
|
private bool pmModel = false; //性能模式
|
||||||
|
private string textColor = "#000000"; //字体颜色
|
||||||
|
private double imgPanelWidth = (double)CommonEnum.IMAGE_PANEL_WIDTH;
|
||||||
|
private double imgPanelHeight = (double)CommonEnum.IMAGE_PANEL_HEIGHT;
|
||||||
|
|
||||||
|
|
||||||
#region GetSet
|
#region GetSet
|
||||||
|
|
||||||
|
public double ImgPanelWidth
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (imgPanelWidth == 0d) return (double)CommonEnum.IMAGE_PANEL_WIDTH;
|
||||||
|
return imgPanelWidth;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
imgPanelWidth = value;
|
||||||
|
OnPropertyChanged("ImgPanelWidth");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public double ImgPanelHeight
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (imgPanelHeight == 0d) return (double)CommonEnum.IMAGE_PANEL_HEIGHT;
|
||||||
|
return imgPanelHeight;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
imgPanelHeight = value;
|
||||||
|
OnPropertyChanged("ImgPanelHeight");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string TextColor
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (textColor == null) return "#000000";
|
||||||
|
return textColor;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
textColor = value;
|
||||||
|
OnPropertyChanged("TextColor");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public bool PMModel
|
public bool PMModel
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|||||||
@@ -20,13 +20,28 @@ namespace GeekDesk.ViewModel
|
|||||||
private BitmapImage bitmapImage; //位图
|
private BitmapImage bitmapImage; //位图
|
||||||
private byte[] imageByteArr; //图片 byte数组
|
private byte[] imageByteArr; //图片 byte数组
|
||||||
private string content; //显示信息
|
private string content; //显示信息
|
||||||
private int imageWidth = (int)MainWindowEnum.IMAGE_WIDTH; //图片宽度
|
private int imageWidth = (int)CommonEnum.IMAGE_WIDTH; //图片宽度
|
||||||
private int imageHeight = (int)MainWindowEnum.IMAGE_HEIGHT; //图片高度
|
private int imageHeight = (int)CommonEnum.IMAGE_HEIGHT; //图片高度
|
||||||
private bool adminStartUp = false; //始终管理员方式启动 默认否
|
private bool adminStartUp = false; //始终管理员方式启动 默认否
|
||||||
private byte[] defaultImage; //默认图标
|
private byte[] defaultImage; //默认图标
|
||||||
|
|
||||||
|
private IconType iconType = IconType.OTHER;
|
||||||
|
|
||||||
|
|
||||||
|
public IconType IconType
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (iconType == 0) return IconType.OTHER;
|
||||||
|
return iconType;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
iconType = value;
|
||||||
|
OnPropertyChanged("IconType");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public byte[] DefaultImage
|
public byte[] DefaultImage
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -142,7 +157,7 @@ namespace GeekDesk.ViewModel
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
// 为了兼容旧版 暂时使用默认
|
// 为了兼容旧版 暂时使用默认
|
||||||
return (int)MainWindowEnum.IMAGE_WIDTH;
|
return (int)CommonEnum.IMAGE_WIDTH;
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
@@ -156,7 +171,7 @@ namespace GeekDesk.ViewModel
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
// 为了兼容旧版 暂时使用默认
|
// 为了兼容旧版 暂时使用默认
|
||||||
return (int)MainWindowEnum.IMAGE_HEIGHT;
|
return (int)CommonEnum.IMAGE_HEIGHT;
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user