Skip to content

Commit

Permalink
v1.1.12.9
Browse files Browse the repository at this point in the history
1.新增黑白色皮肤设置
2.新增是否透明设置
3.修改图片放大缩小显示的百分比逻辑
  • Loading branch information
zdy1988 committed Dec 8, 2022
1 parent b86a0db commit 0f8ecd5
Show file tree
Hide file tree
Showing 23 changed files with 350 additions and 332 deletions.
15 changes: 15 additions & 0 deletions src/.changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
v1.1.12.9
1.�����ڰ�ɫƤ������
2.�����Ƿ�͸������
3.�޸�ͼƬ�Ŵ���С��ʾ�İٷֱ��߼�

v1.1.0.316
1.�������ȹ���
2.��������״̬����

v1.1.0.304
1.�Ż����б�����
2.����ͼƬ�ļ�����򿪹���

v1.1.0.0
1.�����ļ��п��ٵ�������
4 changes: 3 additions & 1 deletion src/AboutWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@
xmlns:local="clr-namespace:Zhai.PictureView"
xmlns:Controls="clr-namespace:Zhai.PictureView.Controls"
Style="{StaticResource PictureWindow}"
IsTransparency="False"
Theme="{Binding SettingsWindow.IsWindowDarked, Source={StaticResource Locator}, Converter={StaticResource PictureViewThemeConverter}}"
WindowStartupLocation ="CenterScreen"
Title="关于 ZDY ' PICTURE"
TitleBarVisibility="Collapsed"
ShowInTaskbar="False"
ResizeMode="NoResize"
Width="420" Height="310"
mc:Ignorable="d">
<Border Background="{StaticResource PictureWindowPaperColorBrush}">
<Border>
<Grid Margin="24">
<Grid.RowDefinitions>
<RowDefinition Height="0"/>
Expand Down
21 changes: 21 additions & 0 deletions src/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="Zhai.PictureView.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<userSettings>
<Zhai.PictureView.Properties.Settings>
<setting name="IsStartWindowMaximized" serializeAs="String">
<value>False</value>
</setting>
<setting name="IsWindowDarked" serializeAs="String">
<value>True</value>
</setting>
<setting name="IsWindowTransparency" serializeAs="String">
<value>True</value>
</setting>
</Zhai.PictureView.Properties.Settings>
</userSettings>
</configuration>
2 changes: 1 addition & 1 deletion src/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
<ResourceDictionary Source="pack://application:,,,/Zhai.PictureView;component/Themes/Zhai.PictureView.ScrollBar.xaml" />
<ResourceDictionary Source="pack://application:,,,/Zhai.PictureView;component/Themes/Zhai.PictureView.Silder.xaml" />
<ResourceDictionary Source="pack://application:,,,/Zhai.PictureView;component/Themes/Zhai.PictureView.TabControl.xaml" />
<ResourceDictionary Source="pack://application:,,,/Zhai.PictureView;component/Themes/Zhai.PictureView.ListDetailView.xaml" />
<ResourceDictionary Source="pack://application:,,,/Zhai.PictureView;component/Themes/Zhai.PictureView.PictureWindow.xaml" />

</ResourceDictionary.MergedDictionaries>
Expand All @@ -37,6 +36,7 @@
<Converters:ThumbBoxVisibilityConverter x:Key="ThumbBoxVisibilityConverter"/>
<Converters:ScaleTipsConverter x:Key="ScaleTipsConverter"/>
<Converters:PictureViewTitleConverter x:Key="PictureViewTitleConverter"/>
<Converters:PictureViewThemeConverter x:Key="PictureViewThemeConverter"/>


<local:ViewModelLocator x:Key="Locator" d:IsDataSource="True" />
Expand Down
113 changes: 0 additions & 113 deletions src/Controls/ListDetailView.cs

This file was deleted.

43 changes: 39 additions & 4 deletions src/Controls/PictureWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,43 @@ public enum ResizeDirection
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);

public enum WindowTheme
{
Dark,
Light
}

public string AppName
{
get { return (string)GetValue(AppNameProperty); }
set { SetValue(AppNameProperty, value); }
}

public static readonly DependencyProperty AppNameProperty = DependencyProperty.Register(nameof(AppName), typeof(string), typeof(PictureWindow), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.Inherits));

public WindowTheme Theme
{
get { return (WindowTheme)GetValue(ThemeProperty); }
set { SetValue(ThemeProperty, value); }
}

public static readonly DependencyProperty ThemeProperty = DependencyProperty.Register(nameof(Theme), typeof(WindowTheme), typeof(PictureWindow), new FrameworkPropertyMetadata(WindowTheme.Dark, FrameworkPropertyMetadataOptions.Inherits));

public FrameworkElement TitleBar
public bool IsTransparency
{
get { return (FrameworkElement)GetValue(TitleBarProperty); }
set { SetValue(TitleBarProperty, value); }
get { return (bool)GetValue(IsTransparencyProperty); }
set { SetValue(IsTransparencyProperty, value); }
}

public static readonly DependencyProperty TitleBarProperty = DependencyProperty.Register(nameof(TitleBar), typeof(FrameworkElement), typeof(PictureWindow), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.Inherits));
public static readonly DependencyProperty IsTransparencyProperty = DependencyProperty.Register(nameof(IsTransparency), typeof(bool), typeof(PictureWindow), new FrameworkPropertyMetadata(true, FrameworkPropertyMetadataOptions.Inherits));

public FrameworkElement TitleBarContent
{
get { return (FrameworkElement)GetValue(TitleBarContentProperty); }
set { SetValue(TitleBarContentProperty, value); }
}

public static readonly DependencyProperty TitleBarContentProperty = DependencyProperty.Register(nameof(TitleBarContent), typeof(FrameworkElement), typeof(PictureWindow), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.Inherits));

public Visibility TitleBarVisibility
{
Expand All @@ -48,6 +76,13 @@ public Visibility TitleBarVisibility

public static readonly DependencyProperty TitleBarVisibilityProperty = DependencyProperty.Register(nameof(TitleBarVisibility), typeof(Visibility), typeof(PictureWindow), new FrameworkPropertyMetadata(Visibility.Visible, FrameworkPropertyMetadataOptions.Inherits));

public bool IsTopmostButtonEnabled
{
get { return (bool)GetValue(IsTopmostButtonEnabledProperty); }
set { SetValue(IsTopmostButtonEnabledProperty, value); }
}

public static readonly DependencyProperty IsTopmostButtonEnabledProperty = DependencyProperty.Register(nameof(IsTopmostButtonEnabled), typeof(bool), typeof(PictureWindow), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.Inherits));


public PictureWindow()
Expand Down
27 changes: 27 additions & 0 deletions src/Converters/PictureViewThemeConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using static Zhai.PictureView.PictureWindow;

namespace Zhai.PictureView.Converters
{
internal class PictureViewThemeConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is bool isDarked)
return isDarked ? WindowTheme.Dark : WindowTheme.Light;

return WindowTheme.Dark;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
7 changes: 5 additions & 2 deletions src/ExifWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Zhai.PictureView"
Style="{StaticResource PictureWindow}"
IsTransparency="False"
Theme="{Binding SettingsWindow.IsWindowDarked, Source={StaticResource Locator}, Converter={StaticResource PictureViewThemeConverter}}"
WindowStartupLocation ="CenterScreen"
ResizeMode="NoResize"
ShowInTaskbar="False"
Icon="/favicon.ico"
Title="{Binding Name}"
Height="300" Width="400"
mc:Ignorable="d">
<Grid Background="{StaticResource PictureWindowPaperColorBrush}">
<ScrollViewer Margin="13 48 12 16">
<Grid>
<ScrollViewer Margin="16 16 8 16">
<ItemsControl ItemsSource="{Binding PictureExif}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
Expand Down
Loading

0 comments on commit 0f8ecd5

Please sign in to comment.