Skip to content

Commit 0f8ecd5

Browse files
committed
v1.1.12.9
1.新增黑白色皮肤设置 2.新增是否透明设置 3.修改图片放大缩小显示的百分比逻辑
1 parent b86a0db commit 0f8ecd5

23 files changed

+350
-332
lines changed

src/.changelog

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
v1.1.12.9
2+
1.�����ڰ�ɫƤ������
3+
2.�����Ƿ�͸������
4+
3.�޸�ͼƬ�Ŵ���С��ʾ�İٷֱ��߼�
5+
6+
v1.1.0.316
7+
1.�������ȹ���
8+
2.��������״̬����
9+
10+
v1.1.0.304
11+
1.�Ż����б�����
12+
2.����ͼƬ�ļ�����򿪹���
13+
14+
v1.1.0.0
15+
1.�����ļ��п��ٵ�������

src/AboutWindow.xaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@
66
xmlns:local="clr-namespace:Zhai.PictureView"
77
xmlns:Controls="clr-namespace:Zhai.PictureView.Controls"
88
Style="{StaticResource PictureWindow}"
9+
IsTransparency="False"
10+
Theme="{Binding SettingsWindow.IsWindowDarked, Source={StaticResource Locator}, Converter={StaticResource PictureViewThemeConverter}}"
911
WindowStartupLocation ="CenterScreen"
1012
Title="关于 ZDY ' PICTURE"
1113
TitleBarVisibility="Collapsed"
1214
ShowInTaskbar="False"
1315
ResizeMode="NoResize"
1416
Width="420" Height="310"
1517
mc:Ignorable="d">
16-
<Border Background="{StaticResource PictureWindowPaperColorBrush}">
18+
<Border>
1719
<Grid Margin="24">
1820
<Grid.RowDefinitions>
1921
<RowDefinition Height="0"/>

src/App.config

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<configSections>
4+
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
5+
<section name="Zhai.PictureView.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
6+
</sectionGroup>
7+
</configSections>
8+
<userSettings>
9+
<Zhai.PictureView.Properties.Settings>
10+
<setting name="IsStartWindowMaximized" serializeAs="String">
11+
<value>False</value>
12+
</setting>
13+
<setting name="IsWindowDarked" serializeAs="String">
14+
<value>True</value>
15+
</setting>
16+
<setting name="IsWindowTransparency" serializeAs="String">
17+
<value>True</value>
18+
</setting>
19+
</Zhai.PictureView.Properties.Settings>
20+
</userSettings>
21+
</configuration>

src/App.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
<ResourceDictionary Source="pack://application:,,,/Zhai.PictureView;component/Themes/Zhai.PictureView.ScrollBar.xaml" />
2121
<ResourceDictionary Source="pack://application:,,,/Zhai.PictureView;component/Themes/Zhai.PictureView.Silder.xaml" />
2222
<ResourceDictionary Source="pack://application:,,,/Zhai.PictureView;component/Themes/Zhai.PictureView.TabControl.xaml" />
23-
<ResourceDictionary Source="pack://application:,,,/Zhai.PictureView;component/Themes/Zhai.PictureView.ListDetailView.xaml" />
2423
<ResourceDictionary Source="pack://application:,,,/Zhai.PictureView;component/Themes/Zhai.PictureView.PictureWindow.xaml" />
2524

2625
</ResourceDictionary.MergedDictionaries>
@@ -37,6 +36,7 @@
3736
<Converters:ThumbBoxVisibilityConverter x:Key="ThumbBoxVisibilityConverter"/>
3837
<Converters:ScaleTipsConverter x:Key="ScaleTipsConverter"/>
3938
<Converters:PictureViewTitleConverter x:Key="PictureViewTitleConverter"/>
39+
<Converters:PictureViewThemeConverter x:Key="PictureViewThemeConverter"/>
4040

4141

4242
<local:ViewModelLocator x:Key="Locator" d:IsDataSource="True" />

src/Controls/ListDetailView.cs

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

src/Controls/PictureWindow.cs

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,43 @@ public enum ResizeDirection
3030
[DllImport("user32.dll", CharSet = CharSet.Auto)]
3131
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
3232

33+
public enum WindowTheme
34+
{
35+
Dark,
36+
Light
37+
}
38+
39+
public string AppName
40+
{
41+
get { return (string)GetValue(AppNameProperty); }
42+
set { SetValue(AppNameProperty, value); }
43+
}
44+
45+
public static readonly DependencyProperty AppNameProperty = DependencyProperty.Register(nameof(AppName), typeof(string), typeof(PictureWindow), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.Inherits));
46+
47+
public WindowTheme Theme
48+
{
49+
get { return (WindowTheme)GetValue(ThemeProperty); }
50+
set { SetValue(ThemeProperty, value); }
51+
}
3352

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

35-
public FrameworkElement TitleBar
55+
public bool IsTransparency
3656
{
37-
get { return (FrameworkElement)GetValue(TitleBarProperty); }
38-
set { SetValue(TitleBarProperty, value); }
57+
get { return (bool)GetValue(IsTransparencyProperty); }
58+
set { SetValue(IsTransparencyProperty, value); }
3959
}
4060

41-
public static readonly DependencyProperty TitleBarProperty = DependencyProperty.Register(nameof(TitleBar), typeof(FrameworkElement), typeof(PictureWindow), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.Inherits));
61+
public static readonly DependencyProperty IsTransparencyProperty = DependencyProperty.Register(nameof(IsTransparency), typeof(bool), typeof(PictureWindow), new FrameworkPropertyMetadata(true, FrameworkPropertyMetadataOptions.Inherits));
62+
63+
public FrameworkElement TitleBarContent
64+
{
65+
get { return (FrameworkElement)GetValue(TitleBarContentProperty); }
66+
set { SetValue(TitleBarContentProperty, value); }
67+
}
68+
69+
public static readonly DependencyProperty TitleBarContentProperty = DependencyProperty.Register(nameof(TitleBarContent), typeof(FrameworkElement), typeof(PictureWindow), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.Inherits));
4270

4371
public Visibility TitleBarVisibility
4472
{
@@ -48,6 +76,13 @@ public Visibility TitleBarVisibility
4876

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

79+
public bool IsTopmostButtonEnabled
80+
{
81+
get { return (bool)GetValue(IsTopmostButtonEnabledProperty); }
82+
set { SetValue(IsTopmostButtonEnabledProperty, value); }
83+
}
84+
85+
public static readonly DependencyProperty IsTopmostButtonEnabledProperty = DependencyProperty.Register(nameof(IsTopmostButtonEnabled), typeof(bool), typeof(PictureWindow), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.Inherits));
5186

5287

5388
public PictureWindow()
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Globalization;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
using System.Windows.Data;
8+
using static Zhai.PictureView.PictureWindow;
9+
10+
namespace Zhai.PictureView.Converters
11+
{
12+
internal class PictureViewThemeConverter : IValueConverter
13+
{
14+
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
15+
{
16+
if (value is bool isDarked)
17+
return isDarked ? WindowTheme.Dark : WindowTheme.Light;
18+
19+
return WindowTheme.Dark;
20+
}
21+
22+
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
23+
{
24+
throw new NotImplementedException();
25+
}
26+
}
27+
}

src/ExifWindow.xaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@
55
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
66
xmlns:local="clr-namespace:Zhai.PictureView"
77
Style="{StaticResource PictureWindow}"
8+
IsTransparency="False"
9+
Theme="{Binding SettingsWindow.IsWindowDarked, Source={StaticResource Locator}, Converter={StaticResource PictureViewThemeConverter}}"
810
WindowStartupLocation ="CenterScreen"
911
ResizeMode="NoResize"
1012
ShowInTaskbar="False"
13+
Icon="/favicon.ico"
1114
Title="{Binding Name}"
1215
Height="300" Width="400"
1316
mc:Ignorable="d">
14-
<Grid Background="{StaticResource PictureWindowPaperColorBrush}">
15-
<ScrollViewer Margin="13 48 12 16">
17+
<Grid>
18+
<ScrollViewer Margin="16 16 8 16">
1619
<ItemsControl ItemsSource="{Binding PictureExif}">
1720
<ItemsControl.ItemsPanel>
1821
<ItemsPanelTemplate>

0 commit comments

Comments
 (0)