BCLV: Adjust arrow key behavior.
- Left/right arrow can now be used to collapse/expand the focus row. Holding shift reverts to the previous behavior of scrolling the view.
This commit is contained in:
@@ -1656,6 +1656,7 @@ BColumnListView::KeyDown(const char* bytes, int32 numBytes)
|
||||
case B_RIGHT_ARROW:
|
||||
case B_LEFT_ARROW:
|
||||
{
|
||||
if ((modifiers() & B_SHIFT_KEY) != 0) {
|
||||
float minVal, maxVal;
|
||||
fHorizontalScrollBar->GetRange(&minVal, &maxVal);
|
||||
float smallStep, largeStep;
|
||||
@@ -1674,6 +1675,17 @@ BColumnListView::KeyDown(const char* bytes, int32 numBytes)
|
||||
newVal = maxVal;
|
||||
|
||||
fHorizontalScrollBar->SetValue(newVal);
|
||||
} else {
|
||||
BRow* focusRow = fOutlineView->FocusRow();
|
||||
if (focusRow == NULL)
|
||||
break;
|
||||
|
||||
bool expanded = focusRow->IsExpanded();
|
||||
if ((c == B_RIGHT_ARROW && !expanded)
|
||||
|| (c == B_LEFT_ARROW && expanded)) {
|
||||
fOutlineView->ToggleFocusRowOpen();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user