From 8970e6cecac4f7fb9eead2ae26d0a996c46d1590 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Tue, 4 Mar 2025 13:26:18 +0100 Subject: [PATCH] color picker, wip --- Crow/Default.style | 16 +- Crow/Images/crow0.svg | 16 +- Crow/Templates/CheckBox2.template | 2 +- Crow/Templates/ColorPicker.template | 21 +- Crow/Templates/ColorSlider.template | 10 + Crow/Templates/ScrollBar.template | 2 +- Crow/src/Fill/Picture.cs | 20 +- Crow/src/IML/Instantiator.cs | 35 --- Crow/src/Interface.cs | 10 + Crow/src/Text/TextChange.cs | 7 +- Crow/src/Widgets/ColorGauge.cs | 137 +++++++++ Crow/src/Widgets/ColorPicker.cs | 72 ++++- Crow/src/Widgets/ColorSlider.cs | 259 ++---------------- Crow/src/Widgets/Gauge.cs | 4 +- Crow/src/Widgets/GroupBase.cs | 15 +- Crow/src/Widgets/Slider.cs | 14 +- Crow/src/Widgets/TemplatedGroup.cs | 5 + Crow/src/Widgets/Widget.cs | 7 +- Crow/src/Widgets/XmlIgnoreAttribute.cs | 34 --- Crow/src/styling/Style.cs | 19 +- Directory.Build.props | 2 +- Drawing2D/Drawing2D.csproj | 1 + .../IML => Drawing2D/src}/IMLAttributes.cs | 4 + Drawing2D/src/Style.cs | 28 ++ Samples/common/src/SampleBase.cs | 29 +- .../ui/Interfaces/Divers/colorPicker.crow | 2 +- .../ui/Interfaces/Divers/colorSlider.crow | 75 +++++ .../ui/Interfaces/Divers/colorSlider2.crow | 78 ++++++ .../ui/Interfaces/Divers/colorSlider3.crow | 47 ++++ .../ui/Interfaces/Divers/colorSlider4.crow | 13 + .../common/ui/Interfaces/Divers/image.crow | 2 + .../ui/Interfaces/Divers/observableList.crow | 3 +- .../ui/Interfaces/Divers/testShape.crow | 9 +- .../ui/Interfaces/Divers/testSlider.crow | 3 +- .../ui/Interfaces/Experimental/table.crow | 10 +- .../TemplatedControl/testScrollbar2.crow | 20 ++ 36 files changed, 640 insertions(+), 391 deletions(-) create mode 100644 Crow/Templates/ColorSlider.template create mode 100644 Crow/src/Widgets/ColorGauge.cs delete mode 100644 Crow/src/Widgets/XmlIgnoreAttribute.cs rename {Crow/src/IML => Drawing2D/src}/IMLAttributes.cs (88%) create mode 100644 Drawing2D/src/Style.cs create mode 100644 Samples/common/ui/Interfaces/Divers/colorSlider.crow create mode 100644 Samples/common/ui/Interfaces/Divers/colorSlider2.crow create mode 100644 Samples/common/ui/Interfaces/Divers/colorSlider3.crow create mode 100644 Samples/common/ui/Interfaces/Divers/colorSlider4.crow create mode 100644 Samples/common/ui/Interfaces/Divers/image.crow create mode 100644 Samples/common/ui/Interfaces/TemplatedControl/testScrollbar2.crow diff --git a/Crow/Default.style b/Crow/Default.style index 473f4070..34fb5899 100644 --- a/Crow/Default.style +++ b/Crow/Default.style @@ -280,12 +280,17 @@ ArrowBut { Foreground="Grey"; Background="Transparent"; - MouseEnter="{Foreground=${ControlHighlight}}"; + MouseEnter="{Foreground=WhiteSmoke}"; MouseLeave="{Foreground=Grey}"; - Margin="2"; + Margin="1"; KeepProportions="true"; } +ScrollBarCursor { + Background="Grey"; + MouseEnter="{Background=WhiteSmoke}"; + MouseLeave="{Background=Grey}"; +} ScrollBar { Orientation = "Vertical"; @@ -318,12 +323,15 @@ labColor { } labColorV { Margin="1"; - Width="Fit"; + Width="50"; + TextAlignment="Right"; } ColorSlider { Focusable="true"; - Height="12"; + Height="36"; Margin="0"; + Maximum="255"; + Decimals="0"; } ColorPicker { Height="Fit"; diff --git a/Crow/Images/crow0.svg b/Crow/Images/crow0.svg index c6211302..94f5cfc6 100644 --- a/Crow/Images/crow0.svg +++ b/Crow/Images/crow0.svg @@ -9,22 +9,8 @@ width="51.116982" version="1.1" id="svg2"> - - - - image/svg+xml - - - - - - + style="fill:#dddddd" /> diff --git a/Crow/Templates/CheckBox2.template b/Crow/Templates/CheckBox2.template index 68afd0bf..4f692335 100644 --- a/Crow/Templates/CheckBox2.template +++ b/Crow/Templates/CheckBox2.template @@ -1,4 +1,4 @@ -