diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-11-29 21:25:53 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-11-29 21:29:31 -0500 |
commit | a013ffa4f71faa77a35352f00bf72195fa7aa499 (patch) | |
tree | 46bbab95f79be46339017cbb04666183707b1a46 /svtools/source | |
parent | 7a49685adc7e926f320427ee15003acde71053c4 (diff) |
Introduce a 'highlighted' state which differs from a 'selected' state.
And use that to only highlight child entries which should logically be
treated as not-selected but should have the same appearance as the
selected entries.
A 'selected' state is logically registered as 'selected' as well as
visually. A 'highlighted' state should only appear as if it's selected
but logically it's treated the same way as non-selected entry.
Change-Id: Ic4bc6923c7678044cf552194ad9865371465c614
Diffstat (limited to 'svtools/source')
-rw-r--r-- | svtools/source/contnr/treelistbox.cxx | 4 | ||||
-rw-r--r-- | svtools/source/contnr/viewdataentry.cxx | 14 |
2 files changed, 16 insertions, 2 deletions
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index b9c41805a949..945fbb77015f 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -3007,7 +3007,9 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry,long nLine,sal_uInt16 nT int bSelTab = nFlags & SV_LBOXTAB_SHOW_SELECTION; sal_uInt16 nItemType = pItem->GetType(); - if ( pViewDataEntry->IsSelected() && bSelTab && !pViewDataEntry->IsCursored() ) + bool bHighlighted = pViewDataEntry->IsHighlighted() || pViewDataEntry->IsSelected(); + + if (bHighlighted && bSelTab && !pViewDataEntry->IsCursored()) { Color aNewWallColor = rSettings.GetHighlightColor(); if ( !bInUse || nItemType != SV_ITEM_ID_LBOXCONTEXTBMP ) diff --git a/svtools/source/contnr/viewdataentry.cxx b/svtools/source/contnr/viewdataentry.cxx index bcdcb110ae77..a7f1a9093a5a 100644 --- a/svtools/source/contnr/viewdataentry.cxx +++ b/svtools/source/contnr/viewdataentry.cxx @@ -33,6 +33,7 @@ DBG_NAME(SvViewDataEntry); SvViewDataEntry::SvViewDataEntry() : nVisPos(0), mbSelected(false), + mbHighlighted(false), mbExpanded(false), mbFocused(false), mbCursored(false), @@ -44,6 +45,7 @@ SvViewDataEntry::SvViewDataEntry() : SvViewDataEntry::SvViewDataEntry( const SvViewDataEntry& rData ) : nVisPos(rData.nVisPos), mbSelected(false), + mbHighlighted(rData.mbHighlighted), mbExpanded(rData.mbExpanded), mbFocused(false), mbCursored(rData.mbCursored), @@ -65,6 +67,11 @@ bool SvViewDataEntry::IsSelected() const return mbSelected; } +bool SvViewDataEntry::IsHighlighted() const +{ + return mbHighlighted; +} + bool SvViewDataEntry::IsExpanded() const { return mbExpanded; @@ -100,6 +107,11 @@ void SvViewDataEntry::SetSelected( bool bSelected ) mbSelected = bSelected; } +void SvViewDataEntry::SetHighlighted( bool bHighlighted ) +{ + mbHighlighted = bHighlighted; +} + void SvViewDataEntry::SetExpanded( bool bExpanded ) { mbExpanded = bExpanded; @@ -107,7 +119,7 @@ void SvViewDataEntry::SetExpanded( bool bExpanded ) void SvViewDataEntry::SetSelectable( bool bSelectable ) { - mbSelectable; + mbSelectable = bSelectable; } void SvViewDataEntry::Init(size_t nSize) |