Kaydet (Commit) 6f0d3a51 authored tarafından Rafael Dominguez's avatar Rafael Dominguez

Position correctly widgets in Template Manager.

Change-Id: I2bb16913f20fcc093acaec9de8b07d27a692056b
üst 0e173abe
...@@ -309,7 +309,6 @@ protected: ...@@ -309,7 +309,6 @@ protected:
long mnDisplayHeight; // Height of the data display box (name, etc) long mnDisplayHeight; // Height of the data display box (name, etc)
long mnVisLines; long mnVisLines;
long mnLines; long mnLines;
sal_uInt16 mnScrBarOffset;
sal_uInt16 mnHighItemId; sal_uInt16 mnHighItemId;
sal_uInt16 mnCols; sal_uInt16 mnCols;
sal_uInt16 mnFirstLine; sal_uInt16 mnFirstLine;
......
...@@ -91,7 +91,6 @@ void ThumbnailView::ImplInit() ...@@ -91,7 +91,6 @@ void ThumbnailView::ImplInit()
mnVisLines = 0; mnVisLines = 0;
mnLines = 0; mnLines = 0;
mnFirstLine = 0; mnFirstLine = 0;
mnScrBarOffset = 1;
mnHighItemId = 0; mnHighItemId = 0;
mnCols = 0; mnCols = 0;
mnSpacing = 0; mnSpacing = 0;
...@@ -243,7 +242,7 @@ void ThumbnailView::CalculateItemPositions () ...@@ -243,7 +242,7 @@ void ThumbnailView::CalculateItemPositions ()
// calculate ScrollBar width // calculate ScrollBar width
long nScrBarWidth = 0; long nScrBarWidth = 0;
if ( mpScrBar ) if ( mpScrBar )
nScrBarWidth = mpScrBar->GetSizePixel().Width()+mnScrBarOffset; nScrBarWidth = mpScrBar->GetSizePixel().Width();
// calculate maximum number of visible columns // calculate maximum number of visible columns
mnCols = (sal_uInt16)((aWinSize.Width()-nScrBarWidth) / (mnItemWidth)); mnCols = (sal_uInt16)((aWinSize.Width()-nScrBarWidth) / (mnItemWidth));
...@@ -383,8 +382,8 @@ void ThumbnailView::CalculateItemPositions () ...@@ -383,8 +382,8 @@ void ThumbnailView::CalculateItemPositions ()
mbScroll = mnLines > mnVisLines; mbScroll = mnLines > mnVisLines;
Point aPos( aWinSize.Width() - nScrBarWidth - mnScrBarOffset, mnHeaderHeight ); Point aPos( aWinSize.Width() - nScrBarWidth, mnHeaderHeight );
Size aSize( nScrBarWidth - mnScrBarOffset, aWinSize.Height() - mnHeaderHeight ); Size aSize( nScrBarWidth, aWinSize.Height() - mnHeaderHeight );
mpScrBar->SetPosSizePixel( aPos, aSize ); mpScrBar->SetPosSizePixel( aPos, aSize );
mpScrBar->SetRangeMax( (nCurCount+mnCols-1)/mnCols); mpScrBar->SetRangeMax( (nCurCount+mnCols-1)/mnCols);
......
...@@ -342,13 +342,9 @@ IMPL_LINK_NOARG(SfxTemplateManagerDlg,ActivatePageHdl) ...@@ -342,13 +342,9 @@ IMPL_LINK_NOARG(SfxTemplateManagerDlg,ActivatePageHdl)
void SfxTemplateManagerDlg::Resize() void SfxTemplateManagerDlg::Resize()
{ {
Size aWinSize = GetSizePixel();
// Fit the tab page control and the toolbars // Fit the tab page control and the toolbars
Size aTabSize = maTabControl.GetSizePixel(); maTabControl.SetSizePixel(GetSizePixel());
aTabSize.setWidth(aWinSize.getWidth()); const Size aWinSize = maTabControl.GetTabPageSizePixel();
maTabControl.SetSizePixel(aTabSize);
maTabControl.SetTabPageSizePixel(aWinSize);
// Calculate toolboxes size and positions // Calculate toolboxes size and positions
Size aViewSize = mpViewBar->CalcMinimumWindowSizePixel(); Size aViewSize = mpViewBar->CalcMinimumWindowSizePixel();
...@@ -372,11 +368,7 @@ void SfxTemplateManagerDlg::Resize() ...@@ -372,11 +368,7 @@ void SfxTemplateManagerDlg::Resize()
Point aViewPos = maView->GetPosPixel(); Point aViewPos = maView->GetPosPixel();
aViewPos.setY(nToolbarsHeight); aViewPos.setY(nToolbarsHeight);
aViewPos.setX(0); aViewPos.setX(0);
Size aThumbSize(aWinSize.getWidth(), maTabControl.GetTabPageSizePixel().getHeight() - aViewPos.getY()); Size aThumbSize(aWinSize.getWidth(), aWinSize.getHeight() - aViewPos.getY());
maView->SetPosSizePixel(aViewPos, aThumbSize);
if (aWinSize.getHeight() < aViewPos.getY() + aThumbSize.getHeight() + PADDING_DLG_BORDER)
aWinSize.setHeight(aViewPos.getY() + aThumbSize.getHeight() + PADDING_DLG_BORDER);
// Set search box position and size // Set search box position and size
Size aSearchSize = mpSearchEdit->CalcMinimumSize(); Size aSearchSize = mpSearchEdit->CalcMinimumSize();
...@@ -385,11 +377,9 @@ void SfxTemplateManagerDlg::Resize() ...@@ -385,11 +377,9 @@ void SfxTemplateManagerDlg::Resize()
mpSearchEdit->SetSizePixel(aSearchSize); mpSearchEdit->SetSizePixel(aSearchSize);
mpSearchEdit->SetPosPixel(Point(PADDING_DLG_BORDER,aViewPos.Y())); mpSearchEdit->SetPosPixel(Point(PADDING_DLG_BORDER,aViewPos.Y()));
maView->SetSizePixel(aThumbSize); maView->SetPosSizePixel(aViewPos,aThumbSize);
mpOnlineView->SetPosSizePixel(aViewPos,aThumbSize); mpOnlineView->SetPosSizePixel(aViewPos,aThumbSize);
mpSearchView->SetSizePixel(aThumbSize); mpSearchView->SetPosSizePixel(aViewPos,aThumbSize);
mpCurView->Resize();
ModelessDialog::Resize(); ModelessDialog::Resize();
} }
......
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