hrev48363 adds 2 changesets to branch 'master' old head: 0690178786125729bcfc3d986f330bf6998870f8 new head: 8b27b730552bf7d9b4e339949a18f33645f34948 overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=8b27b73+%5E0690178 ---------------------------------------------------------------------------- 6136e43: Debugger: Cleanups. VariablesView: - Remove unused member variable. - Add optional presentation name field to ModelNode, which allows overriding the name of its underlying ValueNode for display purposes. Used to ensure that a top-level node for an expression always shows the expression string itself, even when the returned result is a value node with a different name. 8b27b73: 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. [ Rene Gollent <rene@xxxxxxxxxxx> ] ---------------------------------------------------------------------------- 2 files changed, 48 insertions(+), 24 deletions(-) .../gui/team_window/VariablesView.cpp | 26 ++++++++--- src/kits/interface/ColumnListView.cpp | 46 ++++++++++++-------- ############################################################################ Commit: 6136e4303c7a3c29491b812eca93ac9e0980e6bf URL: http://cgit.haiku-os.org/haiku/commit/?id=6136e43 Author: Rene Gollent <rene@xxxxxxxxxxx> Date: Sun Nov 23 14:10:33 2014 UTC Debugger: Cleanups. VariablesView: - Remove unused member variable. - Add optional presentation name field to ModelNode, which allows overriding the name of its underlying ValueNode for display purposes. Used to ensure that a top-level node for an expression always shows the expression string itself, even when the returned result is a value node with a different name. ---------------------------------------------------------------------------- diff --git a/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp b/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp index 0414f41..4837532 100644 --- a/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp +++ b/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp @@ -267,7 +267,8 @@ public: fComponentPath(NULL), fIsPresentationNode(isPresentationNode), fHidden(false), - fValueChanged(false) + fValueChanged(false), + fPresentationName() { fVariable->AcquireReference(); fNodeChild->AcquireReference(); @@ -324,7 +325,13 @@ public: const BString& Name() const { - return fNodeChild->Name(); + return fPresentationName.IsEmpty() + ? fNodeChild->Name() : fPresentationName; + } + + void SetPresentationName(const BString& name) + { + fPresentationName = name; } Type* GetType() const @@ -530,10 +537,10 @@ private: bool fIsPresentationNode; bool fHidden; bool fValueChanged; - bool fIsExpression; + BString fPresentationName; public: - ModelNode* fNext; + ModelNode* fNext; }; @@ -638,7 +645,8 @@ public: int32 columnIndex, BToolTip** _tip); status_t AddSyntheticNode(Variable* variable, - ValueNodeChild*& _child); + ValueNodeChild*& _child, + const char* presentationName = NULL); void RemoveSyntheticNode(ModelNode* node); private: @@ -1513,7 +1521,7 @@ VariablesView::VariableTableModel::GetToolTipForTablePath( status_t VariablesView::VariableTableModel::AddSyntheticNode(Variable* variable, - ValueNodeChild*& _child) + ValueNodeChild*& _child, const char* presentationName) { ValueNodeContainer* container = fNodeManager->GetContainer(); AutoLocker<ValueNodeContainer> containerLocker(container); @@ -1557,6 +1565,9 @@ VariablesView::VariableTableModel::AddSyntheticNode(Variable* variable, ModelNode* childNode = fNodeTable.Lookup(_child); if (childNode != NULL) { + if (presentationName != NULL) + childNode->SetPresentationName(presentationName); + ValueNode* valueNode = _child->Node(); if (valueNode->LocationAndValueResolutionState() == VALUE_NODE_UNRESOLVED) { @@ -2936,7 +2947,8 @@ VariablesView::_AddExpressionNode(ExpressionInfo* info, status_t result, return; variableReference.SetTo(variable, true); - status_t error = fVariableTableModel->AddSyntheticNode(variable, child); + status_t error = fVariableTableModel->AddSyntheticNode(variable, child, + info->Expression()); if (error != B_OK) return; ############################################################################ Revision: hrev48363 Commit: 8b27b730552bf7d9b4e339949a18f33645f34948 URL: http://cgit.haiku-os.org/haiku/commit/?id=8b27b73 Author: Rene Gollent <rene@xxxxxxxxxxx> Date: Sun Nov 23 14:57:18 2014 UTC 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. ---------------------------------------------------------------------------- diff --git a/src/kits/interface/ColumnListView.cpp b/src/kits/interface/ColumnListView.cpp index 9c1ec4d..ce8237e 100644 --- a/src/kits/interface/ColumnListView.cpp +++ b/src/kits/interface/ColumnListView.cpp @@ -1656,24 +1656,36 @@ BColumnListView::KeyDown(const char* bytes, int32 numBytes) case B_RIGHT_ARROW: case B_LEFT_ARROW: { - float minVal, maxVal; - fHorizontalScrollBar->GetRange(&minVal, &maxVal); - float smallStep, largeStep; - fHorizontalScrollBar->GetSteps(&smallStep, &largeStep); - float oldVal = fHorizontalScrollBar->Value(); - float newVal = oldVal; - - if (c == B_LEFT_ARROW) - newVal -= smallStep; - else if (c == B_RIGHT_ARROW) - newVal += smallStep; - - if (newVal < minVal) - newVal = minVal; - else if (newVal > maxVal) - newVal = maxVal; + if ((modifiers() & B_SHIFT_KEY) != 0) { + float minVal, maxVal; + fHorizontalScrollBar->GetRange(&minVal, &maxVal); + float smallStep, largeStep; + fHorizontalScrollBar->GetSteps(&smallStep, &largeStep); + float oldVal = fHorizontalScrollBar->Value(); + float newVal = oldVal; + + if (c == B_LEFT_ARROW) + newVal -= smallStep; + else if (c == B_RIGHT_ARROW) + newVal += smallStep; + + if (newVal < minVal) + newVal = minVal; + else if (newVal > maxVal) + newVal = maxVal; + + fHorizontalScrollBar->SetValue(newVal); + } else { + BRow* focusRow = fOutlineView->FocusRow(); + if (focusRow == NULL) + break; - fHorizontalScrollBar->SetValue(newVal); + bool expanded = focusRow->IsExpanded(); + if ((c == B_RIGHT_ARROW && !expanded) + || (c == B_LEFT_ARROW && expanded)) { + fOutlineView->ToggleFocusRowOpen(); + } + } break; }