guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: installer: Allow selecting popup item with single click.


From: Danny Milosavljevic
Subject: 01/01: installer: Allow selecting popup item with single click.
Date: Fri, 7 Jul 2017 15:24:01 -0400 (EDT)

dannym pushed a commit to branch wip-installer-2
in repository guix.

commit 252c32ce38db952ce183f8b5730cc4254435262e
Author: Danny Milosavljevic <address@hidden>
Date:   Fri Jul 7 21:22:23 2017 +0200

    installer: Allow selecting popup item with single click.
    
    * gurses/form.scm (run-event-loop): Refresh more often. Allow selecting 
popup
    item with a single click.
    * gurses/menu.scm (std-menu-mouse-handler): Emit new event when item is
    selected.
---
 gurses/form.scm | 2 ++
 gurses/menu.scm | 8 +++++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/gurses/form.scm b/gurses/form.scm
index 6aa1e26..13642ff 100644
--- a/gurses/form.scm
+++ b/gurses/form.scm
@@ -271,6 +271,8 @@ than #f.  Return that to our caller."
       (match (getmouse)
        ((device-id g-x g-y z button-state)
         (match (std-menu-mouse-handler menu device-id g-x g-y z button-state)
+         (('menu-item-selected x)
+          (end-status form #\newline))
          (('menu-item-activated x)
           (end-status form #\newline))
          (_
diff --git a/gurses/menu.scm b/gurses/menu.scm
index 646ce07..c8ff2f5 100644
--- a/gurses/menu.scm
+++ b/gurses/menu.scm
@@ -202,8 +202,10 @@ active."
                 (begin
                   (menu-set-current-item! menu selected-item-index)
                   (menu-redraw menu)
-                  (if (logtest BUTTON1_DOUBLE_CLICKED button-state)
-                    (list 'menu-item-activated (menu-get-current-item menu))
-                    #f)))))
+                  (list (if (logtest BUTTON1_DOUBLE_CLICKED button-state)
+                            'menu-item-activated
+                            'menu-item-selected)
+                        (menu-get-current-item menu)))
+                #f)))
          (_ #f)))
       #f))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]