From ae37972cd25117d467d34ee8591c21dcbb5a0fec Mon Sep 17 00:00:00 2001 From: Keith Curtis Date: Thu, 2 Jan 2014 16:01:07 -0500 Subject: hidpi: Sidebar, fontwork, autoformat and other improvements. This is a second batch of HiDPI changes. It fixes the following areas: Sidebar * Impress Master pages preview * deck title height * tab (icon) bar * valueset dropdown control * wider maximum width * Draw and other misc. buttons which didn't get fixed by earlier change to Toolbar.SetItemImage There are several more sidebar issues, but it is much improved. Other changes * Writer and Calc auto-format dialog text * file-properties document image * fontwork gallery preview size * Calc table border control Change-Id: I95a0169a3b011836b1c75b3dcacb2733c9567ef3 --- sfx2/source/sidebar/TabBar.cxx | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'sfx2/source/sidebar/TabBar.cxx') diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx index ba5974dadf12..353a2bb4238c 100644 --- a/sfx2/source/sidebar/TabBar.cxx +++ b/sfx2/source/sidebar/TabBar.cxx @@ -150,7 +150,14 @@ void TabBar::SetDecks ( void TabBar::UpdateButtonIcons (void) { - mpMenuButton->SetModeImage(Theme::GetImage(Theme::Image_TabBarMenu)); + Image aImage = Theme::GetImage(Theme::Image_TabBarMenu); + if ( mpMenuButton->GetDPIScaleFactor() > 1 ) + { + BitmapEx b = aImage.GetBitmapEx(); + b.Scale(mpMenuButton->GetDPIScaleFactor(), mpMenuButton->GetDPIScaleFactor(), BMP_SCALE_FAST); + aImage = Image(b); + } + mpMenuButton->SetModeImage(aImage); for(ItemContainer::const_iterator iItem(maItems.begin()), iEnd(maItems.end()); @@ -159,7 +166,17 @@ void TabBar::UpdateButtonIcons (void) { const DeckDescriptor* pDeckDescriptor = ResourceManager::Instance().GetDeckDescriptor(iItem->msDeckId); if (pDeckDescriptor != NULL) - iItem->mpButton->SetModeImage(GetItemImage(*pDeckDescriptor)); + { + aImage = GetItemImage(*pDeckDescriptor); + if ( mpMenuButton->GetDPIScaleFactor() > 1 ) + { + BitmapEx b = aImage.GetBitmapEx(); + b.Scale(mpMenuButton->GetDPIScaleFactor(), mpMenuButton->GetDPIScaleFactor(), BMP_SCALE_FAST); + aImage = Image(b); + } + + iItem->mpButton->SetModeImage(aImage); + } } Invalidate(); @@ -178,8 +195,8 @@ void TabBar::Layout (void) sal_Int32 nX (aPadding.Top()); sal_Int32 nY (aPadding.Left()); const Size aTabItemSize ( - Theme::GetInteger(Theme::Int_TabItemWidth), - Theme::GetInteger(Theme::Int_TabItemHeight)); + Theme::GetInteger(Theme::Int_TabItemWidth) * GetDPIScaleFactor(), + Theme::GetInteger(Theme::Int_TabItemHeight) * GetDPIScaleFactor()); // Place the menu button and the separator. if (mpMenuButton != 0) -- cgit v1.2.3