From 12ebb45ce26748e415f01c12c5c76b6918484c2f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Sat, 13 Jun 2020 08:21:47 +0200 Subject: [PATCH] focus and windows move and size handles --- Crow/Default.style | 43 +++-- Crow/Templates/CheckBox.template | 2 +- Crow/Templates/MessageBox.template | 32 ++-- Crow/Templates/RadioButton.template | 2 +- Crow/Templates/ToolWindow.template | 7 +- Crow/Templates/Window.template | 8 +- Crow/src/Command.cs | 37 +++- Crow/src/IML/Node.cs | 26 +-- Crow/src/IML/NodeStack.cs | 29 +-- Crow/src/Interface.cs | 33 +++- Crow/src/Widgets/CheckBox.cs | 1 + Crow/src/Widgets/Label.cs | 16 +- Crow/src/Widgets/MessageBox.cs | 31 +-- Crow/src/Widgets/Slider.cs | 7 +- Crow/src/Widgets/Splitter.cs | 70 +++---- Crow/src/Widgets/TextBox.cs | 14 +- Crow/src/Widgets/Widget.cs | 18 +- Crow/src/Widgets/Window.cs | 178 ++++++++---------- Samples/HelloWorld/ui/helloworld.crow | 41 +--- Samples/ShowCase/ui/focused.crow | 17 ++ Samples/ShowCase/ui/helloworld.crow | 8 - Samples/ShowCase/ui/showcase.crow | 2 +- .../ui/Interfaces/Divers/testSlider.crow | 2 +- 23 files changed, 278 insertions(+), 346 deletions(-) create mode 100644 Samples/ShowCase/ui/focused.crow delete mode 100644 Samples/ShowCase/ui/helloworld.crow diff --git a/Crow/Default.style b/Crow/Default.style index 773b1eeb..3d5c3e7f 100644 --- a/Crow/Default.style +++ b/Crow/Default.style @@ -5,10 +5,17 @@ ControlCaptionColor = "LightGrey"; ControlCaptionHoverColor = "White"; ControlCornerRadius = "0"; ControlInsideMargin = "1"; +ControlHighlight = "RoyalBlue"; IconSize = "11"; IconMargin = "1"; ToggleIconSize = "16"; +WindowBackgroundColor = ""; +WindowBorderColor = "Grey"; +WindowBorderWidth = "1"; +WindowTitleBarBackground = "vgradient|0:Onyx|1:SteelBlue"; +WindowTitleBarForeground = "White"; + Button, CheckBox, RadioButton, ComboBox, Expandable, MessageBox, Popper, Slider, Spinner, TextBox { Focusable = "true"; @@ -76,28 +83,26 @@ Menu { Height = "Fit"; Width = "Stretched"; VerticalAlignment = "Top"; - SelectionBackground = "Transparent"; + SelectionBackground = "${ControlHighlight}"; } MenuItem { Caption = "MenuItem"; Width = "Stretched"; Height = "Fit"; - //Background = "vgradient|0:DimGrey|1:Black"; - //Background = "Transparent"; + Background = "DimGrey"; Foreground = "LightGrey"; - MouseEnter = "{Background=SteelBlue;}"; - MouseLeave = "{Background=Transparent;}"; - //MouseEnter = "{Background = vgradient|0:SteelBlue|1:Jet;Foreground=White;}"; - //MouseLeave = "{Foreground=LightGrey;Background=Transparent;}"; - SelectionBackground = "Transparent"; + MouseEnter = "{Background=${ControlHighlight}}"; + MouseLeave = "{Background=Transparent}"; + SelectionBackground = "${ControlHighlight}"; } MessageBox { - Background = "0.1,0.1,0.2,0.7"; + Background = "0.1,0.1,0.2,0.85"; Width = "Fit"; Caption="MessageBox"; Font = "serif, 12"; - MinimumSize = "200,120"; + //MinimumSize = "200,120"; AlwaysOnTop = "true"; + Resizable = "false"; } Slider { Foreground = "Grey"; @@ -129,6 +134,12 @@ Window { Width = "150"; Height = "150"; } +winBorder { + BorderWidth = "${WindowBorderWidth}"; + Foreground = "${WindowBorderColor}"; + Background = "${WindowBackgroundColor}"; + Margin = "0"; +} WindowIconBorder { BorderWidth="1"; Foreground="Transparent"; @@ -228,12 +239,12 @@ ArrowBut { ScrollBar { Orientation = "Vertical"; - Maximum = "0"; - Value = "0"; - Foreground="Transparent"; - Background="Onyx"; - Width = "14"; - CornerRadius = "0"; + Maximum = "0"; + Value = "0"; + Foreground="Transparent"; + Background="Onyx"; + Width = "14"; + CornerRadius = "0"; } HScrollBar { Template = "#Crow.HScrollBar.template"; diff --git a/Crow/Templates/CheckBox.template b/Crow/Templates/CheckBox.template index 9e2a568f..31247681 100644 --- a/Crow/Templates/CheckBox.template +++ b/Crow/Templates/CheckBox.template @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/Crow/Templates/MessageBox.template b/Crow/Templates/MessageBox.template index 385bf824..8a3ea804 100644 --- a/Crow/Templates/MessageBox.template +++ b/Crow/Templates/MessageBox.template @@ -1,22 +1,18 @@  - - - - - - - - + + + + + + diff --git a/Crow/Templates/Window.template b/Crow/Templates/Window.template index a47a0e30..dee91bcd 100644 --- a/Crow/Templates/Window.template +++ b/Crow/Templates/Window.template @@ -1,12 +1,10 @@  - + - + -