have another shot at placing the expander checkitem optimally

reverts 03569dc7d3 "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
This commit is contained in:
Caolán McNamara
2013-10-11 20:15:15 +01:00
parent 9b6b916ef3
commit d61168908c
5 changed files with 11 additions and 5 deletions

View File

@@ -686,6 +686,8 @@ public:
Size GetOutputSizePixel() const;
short GetIndent() const { return nIndent; }
void SetIndent( short nIndent );
// Place the expander checkitem at the optimal indent for hierarchical lists
void SetOptimalImageIndent() { SetIndent(12); }
void SetSpaceBetweenEntries( short nSpace );
short GetSpaceBetweenEntries() const {return nEntryHeightOffs;}
Point GetEntryPosition( SvTreeListEntry* ) const;

View File

@@ -464,7 +464,7 @@ CustomAnimationList::CustomAnimationList( ::Window* pParent )
EnableContextMenuHandling();
SetSelectionMode( MULTIPLE_SELECTION );
SetIndent(16);
SetOptimalImageIndent();
SetNodeDefaultImages();
}

View File

@@ -1855,7 +1855,7 @@ void SfxCommonTemplateDialog_Impl::EnableHierarchical(bool const bEnable)
LINK(this, SfxCommonTemplateDialog_Impl, ApplyHdl));
((StyleTreeListBox_Impl*)pTreeBox)->
SetDropHdl(LINK(this, SfxCommonTemplateDialog_Impl, DropHdl));
pTreeBox->SetIndent(10);
pTreeBox->SetOptimalImageIndent();
FillTreeBox();
SelectStyle(aSelectEntry);
pTreeBox->SetAccessibleName(SfxResId(STR_STYLE_ELEMTLIST).toString());

View File

@@ -1602,8 +1602,12 @@ void SvImpLBox::SetNodeBmpYOffset( const Image& rBmp )
void SvImpLBox::SetNodeBmpTabDistance()
{
nNodeBmpTabDistance = -pView->GetIndent();
Size aSize = GetExpandedNodeBmp().GetSizePixel();
nNodeBmpTabDistance -= aSize.Width() / 2;
if( pView->nContextBmpWidthMax )
{
// only if the first dynamic tab is centered (we currently assume that)
Size aSize = GetExpandedNodeBmp().GetSizePixel();
nNodeBmpTabDistance -= aSize.Width() / 2;
}
}
//

View File

@@ -71,7 +71,7 @@ SwFldDokInfPage::SwFldDokInfPage(Window* pParent, const SfxItemSet& rCoreSet)
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->SetIndent(10);
m_pTypeTLB->SetOptimalImageIndent();
// Don't set font, so that the control's font is adobted!
// Otherwise at wrong font bug to OV.
m_pTypeTLB->SetSpaceBetweenEntries(0);