From bd5161c0a77c380fbacd8f1358beb3e89251631b Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Mon, 3 Apr 2023 23:14:52 +0800
Subject: [PATCH 01/14] fix: close #1373
---
.../HandyControl_Shared/Controls/Image/ImageViewer.cs | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/Shared/HandyControl_Shared/Controls/Image/ImageViewer.cs b/src/Shared/HandyControl_Shared/Controls/Image/ImageViewer.cs
index a75951a6..9ae80e84 100644
--- a/src/Shared/HandyControl_Shared/Controls/Image/ImageViewer.cs
+++ b/src/Shared/HandyControl_Shared/Controls/Image/ImageViewer.cs
@@ -729,8 +729,14 @@ private void ScaleImg(bool isEnlarge)
var olgImageHeight = ImageHeight;
var tempScale = isEnlarge ? _imgActualScale + ScaleInternal : _imgActualScale - ScaleInternal;
- if (Math.Abs(tempScale) < ScaleInternal || Math.Abs(tempScale - 50) < 0.001)
- return;
+ if (Math.Abs(tempScale) < ScaleInternal)
+ {
+ tempScale = ScaleInternal;
+ }
+ else if (Math.Abs(tempScale) > 50)
+ {
+ tempScale = 50;
+ }
ImageScale = tempScale;
From 61a964f9eab709a7816310a3ac24c38193bf4c90 Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Thu, 6 Apr 2023 21:06:25 +0800
Subject: [PATCH 02/14] fix: close #1378
---
src/Net_40/HandyControl_Net_40/Themes/Theme.xaml | 3 +--
.../Themes/Styles/Base/AutoCompleteTextBoxBaseStyle.xaml | 4 +---
src/Shared/HandyControl_Shared/Themes/Theme.xaml | 3 +--
3 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml b/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml
index 6487212f..880f38a5 100644
--- a/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml
+++ b/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml
@@ -11558,7 +11558,6 @@
-
-
-
\ No newline at end of file
+
diff --git a/src/Shared/HandyControl_Shared/Themes/Theme.xaml b/src/Shared/HandyControl_Shared/Themes/Theme.xaml
index de20dfbc..e96e892a 100644
--- a/src/Shared/HandyControl_Shared/Themes/Theme.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Theme.xaml
@@ -8701,7 +8701,7 @@
-
+
diff --git a/src/Shared/HandyControl_Shared/Tools/Extension/ColLayout.cs b/src/Shared/HandyControl_Shared/Tools/Extension/ColLayout.cs
index 37f67cea..00433ba5 100644
--- a/src/Shared/HandyControl_Shared/Tools/Extension/ColLayout.cs
+++ b/src/Shared/HandyControl_Shared/Tools/Extension/ColLayout.cs
@@ -11,19 +11,19 @@ namespace HandyControl.Tools.Extension;
[TypeConverter(typeof(ColLayoutConverter))]
public class ColLayout : MarkupExtension
{
- public static readonly int ColMaxCellCount = 24;
+ public const int ColMaxCellCount = 24;
- public static readonly int HalfColMaxCellCount = 12;
+ public const int HalfColMaxCellCount = 12;
- public static readonly int XsMaxWidth = 768;
+ public const int XsMaxWidth = 768;
- public static readonly int SmMaxWidth = 992;
+ public const int SmMaxWidth = 992;
- public static readonly int MdMaxWidth = 1200;
+ public const int MdMaxWidth = 1200;
- public static readonly int LgMaxWidth = 1920;
+ public const int LgMaxWidth = 1920;
- public static readonly int XlMaxWidth = 2560;
+ public const int XlMaxWidth = 2560;
public int Xs { get; set; } = 24;
From 3e01876fa3d1e5308b3ebcfbbfc645f1a92830f3 Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Sat, 17 Jun 2023 15:39:11 +0800
Subject: [PATCH 08/14] fix: close #1395
---
.../HandyControl_Net_40/Themes/Theme.xaml | 20 +++++++++----------
.../Styles/Base/NumericUpDownBaseStyle.xaml | 20 +++++++++----------
.../HandyControl_Shared/Themes/Theme.xaml | 20 +++++++++----------
3 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml b/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml
index 2335124e..f52bc7b8 100644
--- a/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml
+++ b/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml
@@ -9407,8 +9407,8 @@
-
-
+
+
@@ -9447,8 +9447,8 @@
-
-
+
+
@@ -9489,8 +9489,8 @@
-
-
+
+
@@ -9542,8 +9542,8 @@
-
-
+
+
@@ -9590,8 +9590,8 @@
-
-
+
+
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/NumericUpDownBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/NumericUpDownBaseStyle.xaml
index ebde4902..233bde99 100644
--- a/src/Shared/HandyControl_Shared/Themes/Styles/Base/NumericUpDownBaseStyle.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/NumericUpDownBaseStyle.xaml
@@ -26,8 +26,8 @@
-
-
+
+
@@ -67,8 +67,8 @@
-
-
+
+
@@ -110,8 +110,8 @@
-
-
+
+
@@ -165,8 +165,8 @@
-
-
+
+
@@ -214,8 +214,8 @@
-
-
+
+
diff --git a/src/Shared/HandyControl_Shared/Themes/Theme.xaml b/src/Shared/HandyControl_Shared/Themes/Theme.xaml
index e96e892a..d1bf6042 100644
--- a/src/Shared/HandyControl_Shared/Themes/Theme.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Theme.xaml
@@ -9526,8 +9526,8 @@
-
-
+
+
@@ -9566,8 +9566,8 @@
-
-
+
+
@@ -9608,8 +9608,8 @@
-
-
+
+
@@ -9661,8 +9661,8 @@
-
-
+
+
@@ -9709,8 +9709,8 @@
-
-
+
+
From f6b8bdbeef23de6eea8d53692c2839f5561d4d2c Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Thu, 27 Jul 2023 23:11:37 +0800
Subject: [PATCH 09/14] fix: CheckComboBox ShowSelectAllButton issue.
---
.../Controls/Input/CheckComboBox/CheckComboBox.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Shared/HandyControl_Shared/Controls/Input/CheckComboBox/CheckComboBox.cs b/src/Shared/HandyControl_Shared/Controls/Input/CheckComboBox/CheckComboBox.cs
index 85a73296..efa615f8 100644
--- a/src/Shared/HandyControl_Shared/Controls/Input/CheckComboBox/CheckComboBox.cs
+++ b/src/Shared/HandyControl_Shared/Controls/Input/CheckComboBox/CheckComboBox.cs
@@ -170,7 +170,7 @@ private void UpdateTags()
if (_selectAllItem != null)
{
_isInternalAction = true;
- _selectAllItem.SetCurrentValue(IsSelectedProperty, SelectedItems.Count == Items.Count);
+ _selectAllItem.SetCurrentValue(IsSelectedProperty, Items.Count > 0 && SelectedItems.Count == Items.Count);
_isInternalAction = false;
}
From ff10ded92fd336b69d5cd6782af6b9a1fb59fa9e Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Thu, 27 Jul 2023 23:27:45 +0800
Subject: [PATCH 10/14] enhance: close #1425
---
.../Themes/Styles/Base/CheckComboBoxBaseStyle.xaml | 4 ++--
src/Net_40/HandyControl_Net_40/Themes/Theme.xaml | 4 ++--
.../Themes/Styles/Base/CheckComboBoxBaseStyle.xaml | 4 ++--
src/Shared/HandyControl_Shared/Themes/Theme.xaml | 4 ++--
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/Net_40/HandyControl_Net_40/Themes/Styles/Base/CheckComboBoxBaseStyle.xaml b/src/Net_40/HandyControl_Net_40/Themes/Styles/Base/CheckComboBoxBaseStyle.xaml
index 948fd99e..b734888c 100644
--- a/src/Net_40/HandyControl_Net_40/Themes/Styles/Base/CheckComboBoxBaseStyle.xaml
+++ b/src/Net_40/HandyControl_Net_40/Themes/Styles/Base/CheckComboBoxBaseStyle.xaml
@@ -318,7 +318,7 @@
-
+
@@ -414,7 +414,7 @@
-
+
diff --git a/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml b/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml
index f52bc7b8..b5dfb11b 100644
--- a/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml
+++ b/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml
@@ -7563,7 +7563,7 @@
-
+
@@ -7658,7 +7658,7 @@
-
+
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/CheckComboBoxBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/CheckComboBoxBaseStyle.xaml
index f4b3c539..c713b6ab 100644
--- a/src/Shared/HandyControl_Shared/Themes/Styles/Base/CheckComboBoxBaseStyle.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/CheckComboBoxBaseStyle.xaml
@@ -333,7 +333,7 @@
-
+
@@ -436,7 +436,7 @@
-
+
diff --git a/src/Shared/HandyControl_Shared/Themes/Theme.xaml b/src/Shared/HandyControl_Shared/Themes/Theme.xaml
index d1bf6042..47690fbd 100644
--- a/src/Shared/HandyControl_Shared/Themes/Theme.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Theme.xaml
@@ -7668,7 +7668,7 @@
-
+
@@ -7770,7 +7770,7 @@
-
+
From cb660054792ba9a3d9a660ec9a2deac75f321513 Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Sun, 30 Jul 2023 16:20:07 +0800
Subject: [PATCH 11/14] fix: close #1438
---
src/Net_40/HandyControl_Net_40/Themes/Theme.xaml | 6 +++---
.../Themes/Styles/Base/ScrollViewerBaseStyle.xaml | 4 ++--
.../HandyControl_Shared/Themes/Styles/ScrollViewer.xaml | 2 +-
src/Shared/HandyControl_Shared/Themes/Theme.xaml | 6 +++---
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml b/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml
index b5dfb11b..d39ee134 100644
--- a/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml
+++ b/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml
@@ -2253,7 +2253,7 @@
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/ScrollViewerBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/ScrollViewerBaseStyle.xaml
index 8965a84e..65f65b86 100644
--- a/src/Shared/HandyControl_Shared/Themes/Styles/Base/ScrollViewerBaseStyle.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/ScrollViewerBaseStyle.xaml
@@ -294,7 +294,7 @@
diff --git a/src/Shared/HandyControl_Shared/Themes/Theme.xaml b/src/Shared/HandyControl_Shared/Themes/Theme.xaml
index 47690fbd..68142ab4 100644
--- a/src/Shared/HandyControl_Shared/Themes/Theme.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Theme.xaml
@@ -2253,7 +2253,7 @@
From 8548a6019368341b6c203154c76bf2948b1a814b Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Sun, 24 Sep 2023 21:33:59 +0800
Subject: [PATCH 12/14] fix: close #1451
---
src/Net_40/HandyControl_Net_40/Themes/Theme.xaml | 2 +-
src/Shared/HandyControl_Shared/Themes/Styles/ScrollViewer.xaml | 2 +-
src/Shared/HandyControl_Shared/Themes/Theme.xaml | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml b/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml
index d39ee134..f3fa23cf 100644
--- a/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml
+++ b/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml
@@ -4107,7 +4107,7 @@
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/ScrollViewer.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/ScrollViewer.xaml
index 2e114aa4..4a03faa6 100644
--- a/src/Shared/HandyControl_Shared/Themes/Styles/ScrollViewer.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/ScrollViewer.xaml
@@ -47,7 +47,7 @@
diff --git a/src/Shared/HandyControl_Shared/Themes/Theme.xaml b/src/Shared/HandyControl_Shared/Themes/Theme.xaml
index 68142ab4..582b4f1a 100644
--- a/src/Shared/HandyControl_Shared/Themes/Theme.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Theme.xaml
@@ -4107,7 +4107,7 @@
From 5b0be3b1ab9e441ceda5df6ec875f52af350feb1 Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Sun, 24 Sep 2023 22:58:55 +0800
Subject: [PATCH 13/14] fix: close #1452
---
.../Themes/Styles/Base/TreeViewBaseStyle.xaml | 2 +-
.../Themes/Styles/ListView.xaml | 154 +++++------------
.../HandyControl_Net_40/Themes/Theme.xaml | 12 +-
.../Styles/Base/ItemsPanelTemplate.xaml | 8 +
.../Themes/Styles/Base/ListBoxBaseStyle.xaml | 2 +-
.../Themes/Styles/Base/TransferBaseStyle.xaml | 2 +-
.../Themes/Styles/Base/TreeViewBaseStyle.xaml | 2 +-
.../Themes/Styles/ListView.xaml | 163 +++++-------------
.../HandyControl_Shared/Themes/Theme.xaml | 12 +-
9 files changed, 111 insertions(+), 246 deletions(-)
diff --git a/src/Net_40/HandyControl_Net_40/Themes/Styles/Base/TreeViewBaseStyle.xaml b/src/Net_40/HandyControl_Net_40/Themes/Styles/Base/TreeViewBaseStyle.xaml
index aacb3600..25e782ac 100644
--- a/src/Net_40/HandyControl_Net_40/Themes/Styles/Base/TreeViewBaseStyle.xaml
+++ b/src/Net_40/HandyControl_Net_40/Themes/Styles/Base/TreeViewBaseStyle.xaml
@@ -104,7 +104,7 @@
-
+
diff --git a/src/Net_40/HandyControl_Net_40/Themes/Styles/ListView.xaml b/src/Net_40/HandyControl_Net_40/Themes/Styles/ListView.xaml
index 611c5e90..1d4bf6c4 100644
--- a/src/Net_40/HandyControl_Net_40/Themes/Styles/ListView.xaml
+++ b/src/Net_40/HandyControl_Net_40/Themes/Styles/ListView.xaml
@@ -2,68 +2,42 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:hc="clr-namespace:HandyControl.Controls">
-
-
+
-
-
diff --git a/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml b/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml
index f3fa23cf..75873777 100644
--- a/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml
+++ b/src/Net_40/HandyControl_Net_40/Themes/Theme.xaml
@@ -602,6 +602,12 @@
+
+
+
+
+
+
@@ -9205,7 +9211,7 @@
-
+
@@ -11414,7 +11420,7 @@
-
+
@@ -11532,7 +11538,7 @@
-
+
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/ItemsPanelTemplate.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/ItemsPanelTemplate.xaml
index bada6f89..845a5628 100644
--- a/src/Shared/HandyControl_Shared/Themes/Styles/Base/ItemsPanelTemplate.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/ItemsPanelTemplate.xaml
@@ -17,6 +17,14 @@
+
+
+
+
+
+
+
+
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/ListBoxBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/ListBoxBaseStyle.xaml
index 4b9f593d..819023dc 100644
--- a/src/Shared/HandyControl_Shared/Themes/Styles/Base/ListBoxBaseStyle.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/ListBoxBaseStyle.xaml
@@ -79,7 +79,7 @@
-
+
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/TransferBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/TransferBaseStyle.xaml
index ae9bb748..4d45e0b4 100644
--- a/src/Shared/HandyControl_Shared/Themes/Styles/Base/TransferBaseStyle.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/TransferBaseStyle.xaml
@@ -58,7 +58,7 @@
-
+
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/TreeViewBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/TreeViewBaseStyle.xaml
index 81bb92d0..2786dd59 100644
--- a/src/Shared/HandyControl_Shared/Themes/Styles/Base/TreeViewBaseStyle.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/TreeViewBaseStyle.xaml
@@ -105,7 +105,7 @@
-
+
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/ListView.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/ListView.xaml
index febd0f76..dab0c9fb 100644
--- a/src/Shared/HandyControl_Shared/Themes/Styles/ListView.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/ListView.xaml
@@ -2,68 +2,42 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:hc="clr-namespace:HandyControl.Controls">
-
-
+
-
-
diff --git a/src/Shared/HandyControl_Shared/Themes/Theme.xaml b/src/Shared/HandyControl_Shared/Themes/Theme.xaml
index 582b4f1a..69d4ddfc 100644
--- a/src/Shared/HandyControl_Shared/Themes/Theme.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Theme.xaml
@@ -602,6 +602,12 @@
+
+
+
+
+
+
@@ -9324,7 +9330,7 @@
-
+
@@ -11533,7 +11539,7 @@
-
+
@@ -11652,7 +11658,7 @@
-
+
From ef5ab72301d136bb39a53443b5c00dc58cd65013 Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Sun, 24 Sep 2023 23:39:56 +0800
Subject: [PATCH 14/14] fix: close #1457
---
.../Controls/TabControl/TabItem.cs | 20 ++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/src/Shared/HandyControl_Shared/Controls/TabControl/TabItem.cs b/src/Shared/HandyControl_Shared/Controls/TabControl/TabItem.cs
index d202527c..1b495414 100644
--- a/src/Shared/HandyControl_Shared/Controls/TabControl/TabItem.cs
+++ b/src/Shared/HandyControl_Shared/Controls/TabControl/TabItem.cs
@@ -257,7 +257,11 @@ protected override void OnMouseRightButtonDown(MouseButtonEventArgs e)
{
base.OnMouseRightButtonDown(e);
- if (VisualTreeHelper.HitTest(this, e.GetPosition(this)) == null) return;
+ if (!IsMouseOverHeader(e))
+ {
+ return;
+ }
+
IsSelected = true;
Focus();
}
@@ -300,7 +304,11 @@ protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
{
base.OnMouseLeftButtonDown(e);
- if (VisualTreeHelper.HitTest(this, e.GetPosition(this)) == null) return;
+ if (!IsMouseOverHeader(e))
+ {
+ return;
+ }
+
var parent = TabControlParent;
if (parent == null) return;
@@ -391,7 +399,8 @@ protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
protected override void OnMouseDown(MouseButtonEventArgs e)
{
if (e is { ChangedButton: MouseButton.Middle, ButtonState: MouseButtonState.Pressed } &&
- TabControlParent.CanBeClosedByMiddleButton)
+ TabControlParent.CanBeClosedByMiddleButton &&
+ IsMouseOverHeader(e))
{
if (ShowCloseButton || ShowContextMenu)
{
@@ -474,6 +483,11 @@ private int CalLocationIndex(double left)
return result > maxIndex ? maxIndex : result;
}
+ private bool IsMouseOverHeader(MouseButtonEventArgs e)
+ {
+ return VisualTreeHelper.HitTest(this, e.GetPosition(this)) is not null;
+ }
+
public static readonly RoutedEvent ClosingEvent = EventManager.RegisterRoutedEvent("Closing", RoutingStrategy.Bubble, typeof(EventHandler), typeof(TabItem));
public event EventHandler Closing