]> O.S.I.I.S - jp/crow.git/commitdiff
Active only focusable widget
authorjpbruyere <jp.bruyere@hotmail.com>
Tue, 2 May 2017 12:19:38 +0000 (14:19 +0200)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Thu, 1 Feb 2018 06:43:12 +0000 (07:43 +0100)
Templates/Expandable.template
src/GraphicObjects/GraphicObject.cs

index 2360063a2d4d832df52a140a84ce7846570bf301..c73648060b0ec41ef678a29a0dc7881ae085e96b 100755 (executable)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <Border BorderWidth="1" Foreground="{./Foreground}" Background="{./Background}">
        <VerticalStack>
-               <HorizontalStack Spacing="1" Height="Fit" MouseDoubleClick="./onClickForExpand">
+               <HorizontalStack Spacing="1" Height="Fit" Focusable="true" MouseDoubleClick="./onClickForExpand">
                        <Container Margin="1" Width="10" Height="10" Focusable="true" MouseClick="./onClickForExpand"
                                                                                                                MouseEnter="{Background=LightGray}"
                                                                                                                MouseLeave="{Background=Transparent}">
index d45ed304ab8186ad8a6d6f06fd847c23be88956a..370e281622e33d0fe469886f052cf2a8111c305e 100644 (file)
@@ -1497,7 +1497,13 @@ namespace Crow
                                CurrentInterface.ActiveWidget = this;
                        if (this.Focusable && !(Interface.FocusOnHover || currentInterface.focusGiven)) {
                                CurrentInterface.FocusedWidget = this;
+                               CurrentInterface.ActiveWidget = this;
                                currentInterface.focusGiven = true;
+                               if (CurrentInterface.eligibleForDoubleClick == this && CurrentInterface.clickTimer.ElapsedMilliseconds < Interface.DoubleClick)
+                                       onMouseDoubleClick (this, e);
+                               else
+                                       currentInterface.clickTimer.Restart();
+                               CurrentInterface.eligibleForDoubleClick = null;
                        }
                        //bubble event to the top
                        GraphicObject p = Parent as GraphicObject;