Skip to content

Commit 13a0f1f

Browse files
committed
Update image effects
1 parent 7b6718f commit 13a0f1f

File tree

7 files changed

+339
-11
lines changed

7 files changed

+339
-11
lines changed

src/PicView.Avalonia.MacOS/Views/EffectsWindow.axaml.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Avalonia.Controls;
22
using Avalonia.Input;
33
using Avalonia.Media;
4+
using PicView.Avalonia.WindowBehavior;
45
using PicView.Core.Config;
56
using PicView.Core.Localization;
67

@@ -19,6 +20,11 @@ public EffectsWindow()
1920
{
2021
MinWidth = MaxWidth = Width;
2122
Title = $"{TranslationHelper.Translation.Effects} - PicView";
23+
24+
ClientSizeProperty.Changed.Subscribe(size =>
25+
{
26+
WindowResizing.HandleWindowResize(this, size);
27+
});
2228
};
2329
KeyDown += (_, e) =>
2430
{

src/PicView.Avalonia.Win32/Views/EffectsWindow.axaml.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using Avalonia.Input;
44
using Avalonia.Interactivity;
55
using Avalonia.Media;
6+
using PicView.Avalonia.WindowBehavior;
67
using PicView.Core.Config;
78
using PicView.Core.Localization;
89

@@ -47,6 +48,11 @@ public EffectsWindow()
4748
{
4849
MinWidth = MaxWidth = Width;
4950
Title = $"{TranslationHelper.Translation.Effects} - PicView";
51+
52+
ClientSizeProperty.Changed.Subscribe(size =>
53+
{
54+
WindowResizing.HandleWindowResize(this, size);
55+
});
5056
};
5157
KeyDown += (_, e) =>
5258
{

src/PicView.Avalonia/PicViewTheme/Controls/Slider.axaml

Lines changed: 71 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<Setter Property="Height" Value="12" />
88
<Setter Property="Template">
99
<ControlTemplate>
10-
<Border Name="DecreaseThemeBorder" Background="{DynamicResource AccentColor}" />
10+
<Border Background="{DynamicResource AccentColor}" Name="DecreaseThemeBorder" />
1111
</ControlTemplate>
1212
</Setter>
1313
</ControlTheme>
@@ -16,7 +16,10 @@
1616
<Setter Property="Height" Value="12" />
1717
<Setter Property="Template">
1818
<ControlTemplate>
19-
<Border Name="IncreaseThemeBorder" Background="{DynamicResource AccentColor}" Opacity="0.2" />
19+
<Border
20+
Background="{DynamicResource AccentColor}"
21+
Name="IncreaseThemeBorder"
22+
Opacity="0.2" />
2023
</ControlTemplate>
2124
</Setter>
2225
</ControlTheme>
@@ -75,4 +78,70 @@
7578
<Setter Property="Opacity" Value="{DynamicResource ThemeDisabledOpacity}" />
7679
</Style>
7780
</ControlTheme>
81+
82+
<ControlTheme TargetType="Slider" x:Key="SetBg">
83+
<Style Selector="^:horizontal">
84+
<Setter Property="MinWidth" Value="40" />
85+
<Setter Property="MinHeight" Value="20" />
86+
<Setter Property="Template">
87+
<ControlTemplate>
88+
<Grid Name="grid">
89+
<Grid.RowDefinitions>
90+
<RowDefinition Height="Auto" />
91+
<RowDefinition Height="Auto" MinHeight="20" />
92+
<RowDefinition Height="Auto" />
93+
</Grid.RowDefinitions>
94+
<Border
95+
Background="{TemplateBinding Background}"
96+
Grid.Row="1"
97+
Height="12"
98+
VerticalAlignment="Center" />
99+
<Track
100+
Grid.Row="1"
101+
IsDirectionReversed="{TemplateBinding IsDirectionReversed}"
102+
Name="PART_Track"
103+
Orientation="Horizontal">
104+
<Track.DecreaseButton>
105+
<RepeatButton
106+
Background="Transparent"
107+
Height="12"
108+
Name="PART_DecreaseButton" />
109+
</Track.DecreaseButton>
110+
<Track.IncreaseButton>
111+
<RepeatButton
112+
Background="Transparent"
113+
Height="12"
114+
Name="PART_IncreaseButton" />
115+
</Track.IncreaseButton>
116+
<Thumb Height="22" Width="22">
117+
<Thumb.Template>
118+
<ControlTemplate>
119+
<Rectangle
120+
Fill="{DynamicResource SecondaryButtonBackgroundColor}"
121+
Name="thumb"
122+
Stroke="{DynamicResource MainBorderColor}"
123+
StrokeThickness="1.5" />
124+
</ControlTemplate>
125+
</Thumb.Template>
126+
<Thumb.Styles>
127+
<Style Selector="Rectangle:pointerover">
128+
<Setter Property="Fill" Value="{DynamicResource AccentColor}" />
129+
</Style>
130+
</Thumb.Styles>
131+
</Thumb>
132+
</Track>
133+
</Grid>
134+
</ControlTemplate>
135+
</Setter>
136+
</Style>
137+
138+
<Style Selector="^ /template/ Track#PART_Track">
139+
<Setter Property="Minimum" Value="{TemplateBinding Minimum}" />
140+
<Setter Property="Maximum" Value="{TemplateBinding Maximum}" />
141+
<Setter Property="Value" Value="{TemplateBinding Value, Mode=TwoWay}" />
142+
</Style>
143+
<Style Selector="^:disabled /template/ Grid#grid">
144+
<Setter Property="Opacity" Value="{DynamicResource ThemeDisabledOpacity}" />
145+
</Style>
146+
</ControlTheme>
78147
</ResourceDictionary>

src/PicView.Avalonia/PicViewTheme/Icons.axaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,4 +1076,28 @@
10761076
</GeometryDrawing>
10771077
</DrawingGroup>
10781078
</DrawingImage>
1079+
<DrawingImage x:Key="UndoImage">
1080+
<DrawingGroup>
1081+
<GeometryDrawing Geometry="F1 M3 7L3 13L9 13">
1082+
<GeometryDrawing.Pen>
1083+
<Pen
1084+
Brush="{StaticResource SecondaryTextColor}"
1085+
LineCap="Round"
1086+
LineJoin="Round"
1087+
MiterLimit="4"
1088+
Thickness="2" />
1089+
</GeometryDrawing.Pen>
1090+
</GeometryDrawing>
1091+
<GeometryDrawing Geometry="F1 M21 17Q21 16.7791 20.9892 16.5584Q20.9783 16.3377 20.9567 16.1178Q20.935 15.898 20.9026 15.6794Q20.8702 15.4609 20.8271 15.2442Q20.784 15.0275 20.7303 14.8132Q20.6766 14.5989 20.6125 14.3874Q20.5483 14.176 20.4739 13.968Q20.3995 13.76 20.3149 13.5558Q20.2304 13.3517 20.1359 13.152Q20.0414 12.9523 19.9373 12.7574Q19.8331 12.5626 19.7196 12.3731Q19.606 12.1836 19.4832 11.9999Q19.3605 11.8162 19.2289 11.6387Q19.0973 11.4612 18.9571 11.2905Q18.8169 11.1197 18.6686 10.956Q18.5202 10.7923 18.364 10.636Q18.2077 10.4798 18.044 10.3314Q17.8803 10.1831 17.7095 10.0429Q17.5388 9.90274 17.3613 9.77113Q17.1838 9.63952 17.0001 9.51677Q16.8164 9.39403 16.6269 9.28044Q16.4374 9.16686 16.2426 9.06271Q16.0477 8.95856 15.848 8.8641Q15.6483 8.76963 15.4441 8.68508Q15.24 8.60054 15.032 8.5261Q14.824 8.45167 14.6126 8.38754Q14.4011 8.3234 14.1868 8.26972Q13.9725 8.21603 13.7558 8.17293Q13.5391 8.12983 13.3206 8.09741Q13.102 8.06499 12.8822 8.04334Q12.6623 8.02168 12.4416 8.01084Q12.2209 8 12 8Q11.589 8.00042 11.1798 8.03829Q10.7706 8.07615 10.3666 8.15116Q9.96253 8.22616 9.567 8.33767Q9.17147 8.44919 8.78774 8.59628Q8.40401 8.74337 8.03529 8.92483Q7.66657 9.10628 7.31591 9.32058Q6.96526 9.53488 6.6356 9.78025Q6.30593 10.0256 6 10.3L3 13">
1092+
<GeometryDrawing.Pen>
1093+
<Pen
1094+
Brush="{StaticResource SecondaryTextColor}"
1095+
LineCap="Round"
1096+
LineJoin="Round"
1097+
MiterLimit="4"
1098+
Thickness="2" />
1099+
</GeometryDrawing.Pen>
1100+
</GeometryDrawing>
1101+
</DrawingGroup>
1102+
</DrawingImage>
10791103
</ResourceDictionary>

src/PicView.Avalonia/ViewModels/ViewModelBase.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,27 @@ public void UpdateLanguage()
259259
ImageAliasing = TranslationHelper.Translation.ImageAliasing;
260260
HighQuality = TranslationHelper.Translation.HighQuality;
261261
Lighting = TranslationHelper.Translation.Lighting;
262-
Emboss = TranslationHelper.Translation.Embossed; // Should change to Emboss
262+
Emboss = TranslationHelper.Translation.Embossed;
263263
BlackAndWhite = TranslationHelper.Translation.BlackAndWhite;
264264
NegativeColors = TranslationHelper.Translation.NegativeColors;
265+
Blur = TranslationHelper.Translation.Blur;
266+
DirectionalBlur = TranslationHelper.Translation.DirectionalBlur;
265267
}
266268

267269
#region Strings
268270

271+
public string? DirectionalBlur
272+
{
273+
get;
274+
set => this.RaiseAndSetIfChanged(ref field, value);
275+
}
276+
277+
public string? Blur
278+
{
279+
get;
280+
set => this.RaiseAndSetIfChanged(ref field, value);
281+
}
282+
269283
public string? NegativeColors
270284
{
271285
get;

0 commit comments

Comments
 (0)