Kaydet (Commit) d6116890 authored tarafından Caolán McNamara's avatar Caolán McNamara

have another shot at placing the expander checkitem optimally

reverts 03569dc7 "I hate the positioning of the
expander checkitem in hierarchical view". I still hate it, so merge together
the various places where different efforts are made to try and position the
checkitem optimally and provide a single central place to do that.

Change-Id: I047504945fb5bf94e5f451007eb74328b8b56785
üst 9b6b916e
...@@ -686,6 +686,8 @@ public: ...@@ -686,6 +686,8 @@ public:
Size GetOutputSizePixel() const; Size GetOutputSizePixel() const;
short GetIndent() const { return nIndent; } short GetIndent() const { return nIndent; }
void SetIndent( short nIndent ); void SetIndent( short nIndent );
// Place the expander checkitem at the optimal indent for hierarchical lists
void SetOptimalImageIndent() { SetIndent(12); }
void SetSpaceBetweenEntries( short nSpace ); void SetSpaceBetweenEntries( short nSpace );
short GetSpaceBetweenEntries() const {return nEntryHeightOffs;} short GetSpaceBetweenEntries() const {return nEntryHeightOffs;}
Point GetEntryPosition( SvTreeListEntry* ) const; Point GetEntryPosition( SvTreeListEntry* ) const;
......
...@@ -464,7 +464,7 @@ CustomAnimationList::CustomAnimationList( ::Window* pParent ) ...@@ -464,7 +464,7 @@ CustomAnimationList::CustomAnimationList( ::Window* pParent )
EnableContextMenuHandling(); EnableContextMenuHandling();
SetSelectionMode( MULTIPLE_SELECTION ); SetSelectionMode( MULTIPLE_SELECTION );
SetIndent(16); SetOptimalImageIndent();
SetNodeDefaultImages(); SetNodeDefaultImages();
} }
......
...@@ -1855,7 +1855,7 @@ void SfxCommonTemplateDialog_Impl::EnableHierarchical(bool const bEnable) ...@@ -1855,7 +1855,7 @@ void SfxCommonTemplateDialog_Impl::EnableHierarchical(bool const bEnable)
LINK(this, SfxCommonTemplateDialog_Impl, ApplyHdl)); LINK(this, SfxCommonTemplateDialog_Impl, ApplyHdl));
((StyleTreeListBox_Impl*)pTreeBox)-> ((StyleTreeListBox_Impl*)pTreeBox)->
SetDropHdl(LINK(this, SfxCommonTemplateDialog_Impl, DropHdl)); SetDropHdl(LINK(this, SfxCommonTemplateDialog_Impl, DropHdl));
pTreeBox->SetIndent(10); pTreeBox->SetOptimalImageIndent();
FillTreeBox(); FillTreeBox();
SelectStyle(aSelectEntry); SelectStyle(aSelectEntry);
pTreeBox->SetAccessibleName(SfxResId(STR_STYLE_ELEMTLIST).toString()); pTreeBox->SetAccessibleName(SfxResId(STR_STYLE_ELEMTLIST).toString());
......
...@@ -1602,8 +1602,12 @@ void SvImpLBox::SetNodeBmpYOffset( const Image& rBmp ) ...@@ -1602,8 +1602,12 @@ void SvImpLBox::SetNodeBmpYOffset( const Image& rBmp )
void SvImpLBox::SetNodeBmpTabDistance() void SvImpLBox::SetNodeBmpTabDistance()
{ {
nNodeBmpTabDistance = -pView->GetIndent(); nNodeBmpTabDistance = -pView->GetIndent();
Size aSize = GetExpandedNodeBmp().GetSizePixel(); if( pView->nContextBmpWidthMax )
nNodeBmpTabDistance -= aSize.Width() / 2; {
// only if the first dynamic tab is centered (we currently assume that)
Size aSize = GetExpandedNodeBmp().GetSizePixel();
nNodeBmpTabDistance -= aSize.Width() / 2;
}
} }
// //
......
...@@ -71,7 +71,7 @@ SwFldDokInfPage::SwFldDokInfPage(Window* pParent, const SfxItemSet& rCoreSet) ...@@ -71,7 +71,7 @@ SwFldDokInfPage::SwFldDokInfPage(Window* pParent, const SfxItemSet& rCoreSet)
m_pTypeTLB->SetSelectionMode(SINGLE_SELECTION); m_pTypeTLB->SetSelectionMode(SINGLE_SELECTION);
m_pTypeTLB->SetStyle(m_pTypeTLB->GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL); m_pTypeTLB->SetStyle(m_pTypeTLB->GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL);
m_pTypeTLB->SetIndent(10); m_pTypeTLB->SetOptimalImageIndent();
// Don't set font, so that the control's font is adobted! // Don't set font, so that the control's font is adobted!
// Otherwise at wrong font bug to OV. // Otherwise at wrong font bug to OV.
m_pTypeTLB->SetSpaceBetweenEntries(0); m_pTypeTLB->SetSpaceBetweenEntries(0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment