From 5c91d515f8e05171ff94323c49831f080a11adec Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Mon, 12 Jul 2021 08:45:51 +0200 Subject: [PATCH] replace FastEnum with Enums.NET for flags handling, Bubbling event as Flag, requiredLayouting, MAXLAYOUTINGTRY=>30 --- Crow.sln | 4 - Crow/Crow.csproj | 3 +- Crow/Default.style | 18 +- Crow/Icons/pin.svg | 6 + Crow/Icons/unpin.svg | 9 + Crow/Templates/DirectoryView.template | 2 +- Crow/Templates/DockWindow.template | 35 ++- Crow/Templates/MenuItem.template | 2 +- Crow/Templates/MessageBox.template | 11 +- Crow/Templates/ToolWindow.template | 11 +- Crow/Templates/Window.template | 23 +- Crow/Templates/WindowButton.template | 9 + Crow/src/Colors.cs | 6 +- Crow/src/Configuration.cs | 15 + Crow/src/DebugUtils/DbgEvent.cs | 31 +- Crow/src/DebugUtils/DbgEvtType.cs | 2 + Crow/src/DebugUtils/DbgLayoutEvent.cs | 29 +- Crow/src/DebugUtils/DbgWidgetEvent.cs | 7 + Crow/src/DebugUtils/DbgWidgetRecord.cs | 6 +- Crow/src/DebugUtils/DebugLogger.cs | 50 ++- Crow/src/Fill/SolidColor.cs | 25 +- Crow/src/Font.cs | 4 +- Crow/src/IML/CompilerServices.cs | 88 +++--- Crow/src/IML/Instantiator.cs | 2 - Crow/src/Input/MouseEventArgs.cs | 19 +- Crow/src/Interface.cs | 100 +++--- Crow/src/ItemTemplate.cs | 21 +- Crow/src/LayoutingQueueItem.cs | 88 +++--- Crow/src/ObservableList.cs | 8 +- Crow/src/Widgets/ColorPicker.cs | 2 +- Crow/src/Widgets/DockStack.cs | 50 +-- Crow/src/Widgets/DockWindow.cs | 138 ++++++--- Crow/src/Widgets/Expandable.cs | 9 +- Crow/src/Widgets/GenericStack.cs | 160 +++++----- Crow/src/Widgets/Group.cs | 40 ++- Crow/src/Widgets/GroupBase.cs | 2 +- Crow/src/Widgets/ILayoutable.cs | 1 + Crow/src/Widgets/Label.cs | 2 +- Crow/src/Widgets/PrivateContainer.cs | 33 +- Crow/src/Widgets/ScrollBar.cs | 7 +- Crow/src/Widgets/TableRow.cs | 13 +- Crow/src/Widgets/TemplatedContainer.cs | 1 + Crow/src/Widgets/TemplatedControl.cs | 5 +- Crow/src/Widgets/TemplatedGroup.cs | 11 +- Crow/src/Widgets/Widget.cs | 212 ++++++++----- Crow/src/Widgets/Window.cs | 285 ++++++++++++------ Crow/src/Widgets/Wrapper.cs | 124 ++++---- .../DebugLogAnalyzer/src/DebugInterface.cs | 10 +- .../src/DebugInterfaceWidget.cs | 2 +- .../DebugLogAnalyzer/ui/DbgEventView.template | 1 + .../DebugLogAnalyzer/ui/DbgEvtTooltip.crow | 1 + Samples/ShowCase/ui/showcase.crow | 2 +- Samples/common/src/Editor.cs | 4 +- Samples/common/src/SampleBase.cs | 4 +- Samples/common/ui/Interfaces/Divers/0.crow | 2 +- .../common/ui/Interfaces/Divers/color3.crow | 7 + .../Divers/fitListWithStretchedItems.crow | 1 - .../ui/Interfaces/Divers/testDisable.crow | 4 +- .../common/ui/Interfaces/Divers/windows.crow | 1 + .../Experimental/colorPicktest.crow | 23 ++ .../Experimental/colorPicktest2.crow | 19 ++ .../Experimental/multiColorPick2.crow | 2 +- .../ui/Interfaces/Experimental/tabView1.crow | 4 +- .../ui/Interfaces/Stack/StretchedInFit1.crow | 26 ++ .../Interfaces/Stack/StretchedInFit3.1.crow | 15 + .../Interfaces/Stack/StretchedInFit3.2.crow | 7 + .../Interfaces/Stack/StretchedInFit3.3.crow | 17 ++ .../Interfaces/Stack/StretchedInFit3.4.crow | 4 + .../Interfaces/Stack/StretchedInFit3.5.crow | 17 ++ .../ui/Interfaces/Stack/StretchedInFit3.crow | 8 +- .../ui/Interfaces/Stack/StretchedInFit5.crow | 8 +- .../TemplatedControl/testItemTemplateTag.crow | 4 +- Samples/common/ui/Interfaces/colorPicker.tmp | 2 +- .../common/ui/templates/ColorPicker.template | 2 +- Samples/common/ui/templates/testitems.crow | 23 ++ Samples/dockableWindows/dockableWindows.cs | 1 + Samples/dockableWindows/ui/dock.style | 3 + Samples/dockableWindows/ui/dockWin.template | 35 ++- 78 files changed, 1297 insertions(+), 691 deletions(-) create mode 100644 Crow/Icons/pin.svg create mode 100644 Crow/Icons/unpin.svg create mode 100644 Crow/Templates/WindowButton.template create mode 100644 Samples/common/ui/Interfaces/Divers/color3.crow create mode 100644 Samples/common/ui/Interfaces/Divers/windows.crow create mode 100644 Samples/common/ui/Interfaces/Experimental/colorPicktest.crow create mode 100644 Samples/common/ui/Interfaces/Experimental/colorPicktest2.crow create mode 100644 Samples/common/ui/Interfaces/Stack/StretchedInFit1.crow create mode 100644 Samples/common/ui/Interfaces/Stack/StretchedInFit3.1.crow create mode 100644 Samples/common/ui/Interfaces/Stack/StretchedInFit3.2.crow create mode 100644 Samples/common/ui/Interfaces/Stack/StretchedInFit3.3.crow create mode 100644 Samples/common/ui/Interfaces/Stack/StretchedInFit3.4.crow create mode 100644 Samples/common/ui/Interfaces/Stack/StretchedInFit3.5.crow create mode 100644 Samples/common/ui/templates/testitems.crow diff --git a/Crow.sln b/Crow.sln index 7db03c15..0e50f247 100644 --- a/Crow.sln +++ b/Crow.sln @@ -10,8 +10,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "global", "global", "{728545 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Crow", "Crow\Crow.csproj", "{C2980F9B-4798-4C05-99E2-E174810F7C7B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CrowDbgShared", "CrowDbgShared\CrowDbgShared.csproj", "{91F1CE07-EECE-4F1D-A3EE-7239B563654A}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}" ProjectSection(SolutionItems) = preProject Samples\Directory.Build.props = Samples\Directory.Build.props @@ -57,8 +55,6 @@ Global {56329D48-D382-4850-93DE-59C453894E8A}.Debug|Any CPU.Build.0 = Debug|Any CPU {56329D48-D382-4850-93DE-59C453894E8A}.Release|Any CPU.ActiveCfg = Release|Any CPU {56329D48-D382-4850-93DE-59C453894E8A}.Release|Any CPU.Build.0 = Release|Any CPU - {91F1CE07-EECE-4F1D-A3EE-7239B563654A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {91F1CE07-EECE-4F1D-A3EE-7239B563654A}.Release|Any CPU.ActiveCfg = Release|Any CPU {0CC6DFAB-2E4A-4786-976C-89053D5EA6A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0CC6DFAB-2E4A-4786-976C-89053D5EA6A2}.Debug|Any CPU.Build.0 = Debug|Any CPU {0CC6DFAB-2E4A-4786-976C-89053D5EA6A2}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/Crow/Crow.csproj b/Crow/Crow.csproj index d5d50114..972e22f1 100644 --- a/Crow/Crow.csproj +++ b/Crow/Crow.csproj @@ -39,7 +39,8 @@ - + + diff --git a/Crow/Default.style b/Crow/Default.style index 5c88c062..80131bce 100644 --- a/Crow/Default.style +++ b/Crow/Default.style @@ -134,6 +134,7 @@ MessageBox { //MinimumSize = "200,120"; AlwaysOnTop = "true"; Resizable = "false"; + AllowedStates = "Normal"; } Slider { Foreground = "Grey"; @@ -166,12 +167,15 @@ WindowIconBorder { Foreground="Transparent"; Height="12"; Width="12"; - MouseEnter="{Foreground=White}"; + MouseEnter="{Foreground=Grey}"; MouseLeave="{Foreground=Transparent}"; + MouseDown="{Background=${ControlHighlight}}"; + MouseUp="{Background=Transparent}"; } ToolWindow { Caption = "Window"; Template = "#Crow.ToolWindow.template"; + AllowedStates = "Normal"; Focusable = "true"; MinimumSize="50,50"; Width = "150"; @@ -183,7 +187,8 @@ DockStack { AllowDrop = "true"; AllowedDropTypes = "Crow.DockWindow"; } -DockWindow { +DockWindow { + AllowedStates = "Normal"; Focusable = "true"; AllowDrag = "true"; AllowDrop="true"; @@ -321,8 +326,9 @@ MessageBox, Popper, Slider, Spinner, TextBox, NumericControl { Background = "${ControlBackground}"; CornerRadius = "${ControlCornerRadius}"; Margin="0"; - BubbleMouseEvent="false"; + BubbleMouseEvent="MouseWheel|Keyboard"; } -TemplatedControl, GenericStack { - CacheEnabled="true"; -} \ No newline at end of file + +//TemplatedControl, GenericStack { +// CacheEnabled="true"; +//} \ No newline at end of file diff --git a/Crow/Icons/pin.svg b/Crow/Icons/pin.svg new file mode 100644 index 00000000..b36340b8 --- /dev/null +++ b/Crow/Icons/pin.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Crow/Icons/unpin.svg b/Crow/Icons/unpin.svg new file mode 100644 index 00000000..8396017f --- /dev/null +++ b/Crow/Icons/unpin.svg @@ -0,0 +1,9 @@ + + + + + + diff --git a/Crow/Templates/DirectoryView.template b/Crow/Templates/DirectoryView.template index 98094c90..7a157bdd 100644 --- a/Crow/Templates/DirectoryView.template +++ b/Crow/Templates/DirectoryView.template @@ -15,7 +15,7 @@ - +