[haiku-commits] haiku: hrev54296 - src/kits/interface

  • From: waddlesplash <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 3 Jun 2020 10:00:21 -0400 (EDT)

hrev54296 adds 1 changeset to branch 'master'
old head: a9f415f06a4457c27f4a7e87ff74a79839b03ce5
new head: c47cb94a5e0f32433723a22beab176f877dddfca
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=c47cb94a5e0f+%5Ea9f415f06a44

----------------------------------------------------------------------------

c47cb94a5e0f: BOutlineListView: fix keyboard navigation
  
  * On left arrow key select parent item when selected item is collapsed.
  * Scroll to selected item when expanding/collapsing.
  
  Change-Id: Ia404abb970376d4168efd8bba4d8817712a885a6
  Reviewed-on: https://review.haiku-os.org/c/haiku/+/2873
  Reviewed-by: waddlesplash <waddlesplash@xxxxxxxxx>

                                              [ X512 <danger_mail@xxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev54296
Commit:      c47cb94a5e0f32433723a22beab176f877dddfca
URL:         https://git.haiku-os.org/haiku/commit/?id=c47cb94a5e0f
Author:      X512 <danger_mail@xxxxxxx>
Date:        Wed Jun  3 08:52:17 2020 UTC
Committer:   waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Wed Jun  3 14:00:17 2020 UTC

----------------------------------------------------------------------------

1 file changed, 7 insertions(+), 3 deletions(-)
src/kits/interface/OutlineListView.cpp | 10 +++++++---

----------------------------------------------------------------------------

diff --git a/src/kits/interface/OutlineListView.cpp 
b/src/kits/interface/OutlineListView.cpp
index 7cc121c69d..483eac2f87 100644
--- a/src/kits/interface/OutlineListView.cpp
+++ b/src/kits/interface/OutlineListView.cpp
@@ -199,8 +199,10 @@ BOutlineListView::KeyDown(const char* bytes, int32 
numBytes)
                                if (item && item->fHasSubitems) {
                                        if (!item->IsExpanded())
                                                Expand(item);
-                                       else
+                                       else {
                                                Select(currentSel + 1);
+                                               ScrollToSelection();
+                                       }
                                }
                                return;
                        }
@@ -209,12 +211,14 @@ BOutlineListView::KeyDown(const char* bytes, int32 
numBytes)
                        {
                                BListItem* item = ItemAt(currentSel);
                                if (item) {
-                                       if (item->fHasSubitems)
+                                       if (item->fHasSubitems && 
item->IsExpanded())
                                                Collapse(item);
                                        else {
                                                item = Superitem(item);
-                                               if (item)
+                                               if (item) {
                                                        Select(IndexOf(item));
+                                                       ScrollToSelection();
+                                               }
                                        }
                                }
                                return;


Other related posts:

  • » [haiku-commits] haiku: hrev54296 - src/kits/interface - waddlesplash