diff options
author | Keith Curtis <keithcu@gmail.com> | 2014-01-02 16:01:07 -0500 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-01-04 13:01:52 +0100 |
commit | ae37972cd25117d467d34ee8591c21dcbb5a0fec (patch) | |
tree | e3125042122cc611150dcfb848307e43a7e00451 | |
parent | bdc192739892114e8b159a8af185ff28b873e748 (diff) |
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
-rw-r--r-- | sc/source/ui/miscdlgs/autofmt.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/sidebar/CellAppearancePropertyPanel.src | 1 | ||||
-rw-r--r-- | sd/source/ui/sidebar/MasterPagesSelector.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/dialog/dinfdlg.cxx | 11 | ||||
-rw-r--r-- | sfx2/source/sidebar/DeckLayouter.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/sidebar/SidebarChildWindow.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/sidebar/SidebarController.cxx | 32 | ||||
-rw-r--r-- | sfx2/source/sidebar/TabBar.cxx | 25 | ||||
-rw-r--r-- | svx/source/sidebar/tools/ValueSetWithTextControl.cxx | 29 | ||||
-rw-r--r-- | svx/source/tbxctrls/fontworkgallery.cxx | 4 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 13 | ||||
-rw-r--r-- | sw/source/ui/table/tautofmt.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/toolbox2.cxx | 2 |
13 files changed, 109 insertions, 26 deletions
diff --git a/sc/source/ui/miscdlgs/autofmt.cxx b/sc/source/ui/miscdlgs/autofmt.cxx index 425014f378a5..a536b22dbbfa 100644 --- a/sc/source/ui/miscdlgs/autofmt.cxx +++ b/sc/source/ui/miscdlgs/autofmt.cxx @@ -106,13 +106,13 @@ static void lcl_SetFontProperties( void ScAutoFmtPreview::MakeFonts( sal_uInt16 nIndex, Font& rFont, Font& rCJKFont, Font& rCTLFont ) { if ( pCurData ) { rFont = rCJKFont = rCTLFont = GetFont(); - Size aFontSize( rFont.GetSize().Width(), 10 ); + Size aFontSize( rFont.GetSize().Width(), 10 * GetDPIScaleFactor() ); const SvxFontItem* pFontItem = (const SvxFontItem*) pCurData->GetItem( nIndex, ATTR_FONT ); const SvxWeightItem* pWeightItem = (const SvxWeightItem*) pCurData->GetItem( nIndex, ATTR_FONT_WEIGHT ); const SvxPostureItem* pPostureItem = (const SvxPostureItem*) pCurData->GetItem( nIndex, ATTR_FONT_POSTURE ); const SvxFontItem* pCJKFontItem = (const SvxFontItem*) pCurData->GetItem( nIndex, ATTR_CJK_FONT ); const SvxWeightItem* pCJKWeightItem = (const SvxWeightItem*) pCurData->GetItem( nIndex, ATTR_CJK_FONT_WEIGHT ); diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.src b/sc/source/ui/sidebar/CellAppearancePropertyPanel.src index 00876285015e..4542e4cb184f 100644 --- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.src +++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.src @@ -164,12 +164,13 @@ Control RID_POPUPPANEL_APPEARANCE_CELL_LINESTYLE Control RID_POPUPPANEL_APPEARANCE_CELL_BORDERSTYLE { OutputSize = TRUE; DialogControl = TRUE; Border = FALSE; + //This is broken with the auto-doubled hidpi bitmaps Size = MAP_PIXEL( POPUPPANEL_MARGIN_SMALL_PIXEL * 2 + 108, POPUPPANEL_MARGIN_SMALL_PIXEL * 2 + 138); ToolBox TB_BORDER1 { SVLook = TRUE ; Pos = MAP_PIXEL(POPUPPANEL_MARGIN_SMALL_PIXEL, POPUPPANEL_MARGIN_SMALL_PIXEL); //MAP_APPFONT (POPUPPANEL_MARGIN_SMALL + OFFSET_X + 1, POPUPPANEL_MARGIN_SMALL + OFFSET_Y + 1) ; diff --git a/sd/source/ui/sidebar/MasterPagesSelector.cxx b/sd/source/ui/sidebar/MasterPagesSelector.cxx index 783d4ed2b5fa..9d1444a1ef6d 100644 --- a/sd/source/ui/sidebar/MasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/MasterPagesSelector.cxx @@ -84,12 +84,16 @@ MasterPagesSelector::MasterPagesSelector ( { PreviewValueSet::SetSelectHdl ( LINK(this, MasterPagesSelector, ClickHandler)); PreviewValueSet::SetRightMouseClickHandler ( LINK(this, MasterPagesSelector, RightClickHandler)); PreviewValueSet::SetStyle(PreviewValueSet::GetStyle() | WB_NO_DIRECTSELECT); + + if ( GetDPIScaleFactor() > 1 ) + mpContainer->SetPreviewSize(MasterPageContainer::LARGE); + PreviewValueSet::SetPreviewSize(mpContainer->GetPreviewSizePixel()); PreviewValueSet::Show(); SetBackground(sfx2::sidebar::Theme::GetWallpaper(sfx2::sidebar::Theme::Paint_PanelBackground)); SetColor(sfx2::sidebar::Theme::GetColor(sfx2::sidebar::Theme::Paint_PanelBackground)); diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 45030f326e0d..6b58a5181614 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -1052,13 +1052,22 @@ void SfxDocumentPage::Reset( const SfxItemSet& rSet ) // determine context symbol INetURLObject aURL; aURL.SetSmartProtocol( INET_PROT_FILE ); aURL.SetSmartURL( aFactory); const OUString& rMainURL = aURL.GetMainURL( INetURLObject::NO_DECODE ); - m_pBmp->SetImage( SvFileInformationManager::GetImage( aURL, sal_True ) ); + Image aImage = SvFileInformationManager::GetImage( aURL, sal_True ); + + if ( GetDPIScaleFactor() > 1) + { + BitmapEx b = aImage.GetBitmapEx(); + b.Scale(GetDPIScaleFactor(), GetDPIScaleFactor()); + aImage = Image(b); + } + + m_pBmp->SetImage( aImage ); // determine size and type OUString aSizeText( m_aUnknownSize ); if ( aURL.GetProtocol() == INET_PROT_FILE ) aSizeText = CreateSizeText( SfxContentHelper::GetSize( aURL.GetMainURL( INetURLObject::NO_DECODE ) ) ); m_pShowSizeFT->SetText( aSizeText ); diff --git a/sfx2/source/sidebar/DeckLayouter.cxx b/sfx2/source/sidebar/DeckLayouter.cxx index 9dcc3585a6ee..c87625b3458c 100644 --- a/sfx2/source/sidebar/DeckLayouter.cxx +++ b/sfx2/source/sidebar/DeckLayouter.cxx @@ -198,13 +198,12 @@ sal_Int32 DeckLayouter::PlacePanels ( const sal_Int32 nWidth, const LayoutMode eMode, Window& rScrollContainer) { ::std::vector<sal_Int32> aSeparators; const sal_Int32 nDeckSeparatorHeight (Theme::GetInteger(Theme::Int_DeckSeparatorHeight)); - const sal_Int32 nPanelTitleBarHeight (Theme::GetInteger(Theme::Int_PanelTitleBarHeight)); sal_Int32 nY (0); // Assign heights and places. IterateLayoutItems(iItem,rLayoutItems) { if (iItem->mpPanel == 0) @@ -217,12 +216,14 @@ sal_Int32 DeckLayouter::PlacePanels ( nY += nDeckSeparatorHeight; // Place the title bar. PanelTitleBar* pTitleBar = rPanel.GetTitleBar(); if (pTitleBar != NULL) { + const sal_Int32 nPanelTitleBarHeight (Theme::GetInteger(Theme::Int_PanelTitleBarHeight) * rPanel.GetDPIScaleFactor()); + if (iItem->mbShowTitleBar) { pTitleBar->setPosSizePixel(0, nY, nWidth, nPanelTitleBarHeight); pTitleBar->Show(); nY += nPanelTitleBarHeight; } @@ -292,13 +293,12 @@ void DeckLayouter::GetRequestedSizes ( sal_Int32& rAvailableHeight, sal_Int32& rMinimalWidth, const Rectangle& rContentBox) { rAvailableHeight = rContentBox.GetHeight(); - const sal_Int32 nPanelTitleBarHeight (Theme::GetInteger(Theme::Int_PanelTitleBarHeight)); const sal_Int32 nDeckSeparatorHeight (Theme::GetInteger(Theme::Int_DeckSeparatorHeight)); IterateLayoutItems(iItem,rLayoutItems) { ui::LayoutSize aLayoutSize (ui::LayoutSize(0,0,0)); if (iItem->mpPanel != 0) @@ -312,12 +312,14 @@ void DeckLayouter::GetRequestedSizes ( iItem->mbShowTitleBar = false; } else { // Show the title bar and a separator above and below // the title bar. + const sal_Int32 nPanelTitleBarHeight (Theme::GetInteger(Theme::Int_PanelTitleBarHeight) * iItem->mpPanel->GetDPIScaleFactor()); + rAvailableHeight -= nPanelTitleBarHeight; rAvailableHeight -= nDeckSeparatorHeight; } if (iItem->mpPanel->IsExpanded()) { @@ -435,13 +437,13 @@ Rectangle DeckLayouter::PlaceDeckTitle ( // When the side bar is undocked then the outer system window displays the deck title. rDeckTitleBar.Hide(); return rAvailableSpace; } else { - const sal_Int32 nDeckTitleBarHeight (Theme::GetInteger(Theme::Int_DeckTitleBarHeight)); + const sal_Int32 nDeckTitleBarHeight (Theme::GetInteger(Theme::Int_DeckTitleBarHeight) * rDeckTitleBar.GetDPIScaleFactor()); rDeckTitleBar.setPosSizePixel( rAvailableSpace.Left(), rAvailableSpace.Top(), rAvailableSpace.GetWidth(), nDeckTitleBarHeight); rDeckTitleBar.Show(); diff --git a/sfx2/source/sidebar/SidebarChildWindow.cxx b/sfx2/source/sidebar/SidebarChildWindow.cxx index 8ef593acd01c..f4347b1ccbf8 100644 --- a/sfx2/source/sidebar/SidebarChildWindow.cxx +++ b/sfx2/source/sidebar/SidebarChildWindow.cxx @@ -65,13 +65,13 @@ sal_Int32 SidebarChildWindow::GetDefaultWidth (Window* pWindow) if (pWindow != NULL) { // Width of the paragraph panel. const static sal_Int32 nMaxPropertyPageWidth (115); return pWindow->LogicToPixel(Point(nMaxPropertyPageWidth,1), MAP_APPFONT).X() - + TabBar::GetDefaultWidth(); + + TabBar::GetDefaultWidth() * pWindow->GetDPIScaleFactor(); } else return 0; } diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index d6fd4ba301a1..357c5456c4fe 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -335,29 +335,30 @@ void SidebarController::NotifyResize (void) { OSL_ASSERT(mpTabBar!=0); return; } Window* pParentWindow = mpTabBar->GetParent(); + sal_Int32 nTabBarDefaultWidth = TabBar::GetDefaultWidth() * mpTabBar->GetDPIScaleFactor(); const sal_Int32 nWidth (pParentWindow->GetSizePixel().Width()); const sal_Int32 nHeight (pParentWindow->GetSizePixel().Height()); - mbIsDeckOpen = (nWidth > TabBar::GetDefaultWidth()); + mbIsDeckOpen = (nWidth > nTabBarDefaultWidth); if (mnSavedSidebarWidth <= 0) mnSavedSidebarWidth = nWidth; bool bIsDeckVisible; if (mbCanDeckBeOpened) { const bool bIsOpening (nWidth > mnWidthOnSplitterButtonDown); if (bIsOpening) - bIsDeckVisible = nWidth >= TabBar::GetDefaultWidth() + gnWidthOpenThreshold; + bIsDeckVisible = nWidth >= nTabBarDefaultWidth + gnWidthOpenThreshold; else - bIsDeckVisible = nWidth >= TabBar::GetDefaultWidth() + gnWidthCloseThreshold; + bIsDeckVisible = nWidth >= nTabBarDefaultWidth + gnWidthCloseThreshold; mbIsDeckRequestedOpen = bIsDeckVisible; UpdateCloseIndicator(!bIsDeckVisible); } else bIsDeckVisible = false; @@ -368,34 +369,34 @@ void SidebarController::NotifyResize (void) if ( pSplitWindow->GetAlign() == WINDOWALIGN_RIGHT ) // attach the Sidebar towards the right-side of screen { // Place the deck first. { if (bIsDeckVisible) { - mpCurrentDeck->setPosSizePixel(0,0, nWidth-TabBar::GetDefaultWidth(), nHeight); + mpCurrentDeck->setPosSizePixel(0,0, nWidth-nTabBarDefaultWidth, nHeight); mpCurrentDeck->Show(); mpCurrentDeck->RequestLayout(); } else mpCurrentDeck->Hide(); } // Now place the tab bar. - mpTabBar->setPosSizePixel(nWidth-TabBar::GetDefaultWidth(),0,TabBar::GetDefaultWidth(),nHeight); + mpTabBar->setPosSizePixel(nWidth-nTabBarDefaultWidth,0,nTabBarDefaultWidth,nHeight); mpTabBar->Show(); } else if ( pSplitWindow->GetAlign() == WINDOWALIGN_LEFT) // attach the Sidebar towards the left-side of screen { // Place the tab bar first. - mpTabBar->setPosSizePixel(0,0,TabBar::GetDefaultWidth(),nHeight); + mpTabBar->setPosSizePixel(0,0,nTabBarDefaultWidth,nHeight); mpTabBar->Show(); // Now place the deck. if (bIsDeckVisible) { - mpCurrentDeck->setPosSizePixel(TabBar::GetDefaultWidth(),0, nWidth-TabBar::GetDefaultWidth(), nHeight); + mpCurrentDeck->setPosSizePixel(nTabBarDefaultWidth,0, nWidth-nTabBarDefaultWidth, nHeight); mpCurrentDeck->Show(); mpCurrentDeck->RequestLayout(); } else mpCurrentDeck->Hide(); } @@ -433,13 +434,13 @@ void SidebarController::ProcessNewWidth (const sal_Int32 nNewWidth) // Deck became too small. Close it completely. // If window is wider than the tab bar then mark the deck as being visible, even when it its not. // This is to trigger an adjustment of the width to the width of the tab bar. mbIsDeckOpen = true; RequestCloseDeck(); - if (mnWidthOnSplitterButtonDown > TabBar::GetDefaultWidth()) + if (mnWidthOnSplitterButtonDown > TabBar::GetDefaultWidth() * mpTabBar->GetDPIScaleFactor()) mnSavedSidebarWidth = mnWidthOnSplitterButtonDown; } } @@ -685,13 +686,13 @@ void SidebarController::SwitchToDeck ( aNewPanels.resize(nWriteIndex); // Activate the deck and the new set of panels. mpCurrentDeck->setPosSizePixel( 0, 0, - mpParentWindow->GetSizePixel().Width()-TabBar::GetDefaultWidth(), + mpParentWindow->GetSizePixel().Width()-TabBar::GetDefaultWidth() * mpTabBar->GetDPIScaleFactor(), mpParentWindow->GetSizePixel().Height()); mpCurrentDeck->SetPanels(aNewPanels); mpCurrentDeck->Show(); mpParentWindow->SetText(rDeckDescriptor.msTitle); @@ -1011,29 +1012,31 @@ void SidebarController::RequestOpenDeck (void) void SidebarController::UpdateDeckOpenState (void) { if ( ! mbIsDeckRequestedOpen) // No state requested. return; + sal_Int32 nTabBarDefaultWidth = TabBar::GetDefaultWidth() * mpTabBar->GetDPIScaleFactor(); + // Update (change) the open state when it either has not yet been initialized // or when its value differs from the requested state. if ( ! mbIsDeckOpen || mbIsDeckOpen.get() != mbIsDeckRequestedOpen.get()) { if (mbIsDeckRequestedOpen.get()) { - if (mnSavedSidebarWidth <= TabBar::GetDefaultWidth()) + if (mnSavedSidebarWidth <= nTabBarDefaultWidth) SetChildWindowWidth(SidebarChildWindow::GetDefaultWidth(mpParentWindow)); else SetChildWindowWidth(mnSavedSidebarWidth); } else { if ( ! mpParentWindow->IsFloatingMode()) - mnSavedSidebarWidth = SetChildWindowWidth(TabBar::GetDefaultWidth()); - if (mnWidthOnSplitterButtonDown > TabBar::GetDefaultWidth()) + mnSavedSidebarWidth = SetChildWindowWidth(nTabBarDefaultWidth); + if (mnWidthOnSplitterButtonDown > nTabBarDefaultWidth) mnSavedSidebarWidth = mnWidthOnSplitterButtonDown; mpParentWindow->SetStyle(mpParentWindow->GetStyle() & ~WB_SIZEABLE); } mbIsDeckOpen = mbIsDeckRequestedOpen.get(); if (mbIsDeckOpen.get() && mpCurrentDeck) @@ -1106,13 +1109,14 @@ void SidebarController::RestrictWidth (sal_Int32 nWidth) if (pSplitWindow != NULL) { const sal_uInt16 nId (pSplitWindow->GetItemId(mpParentWindow)); const sal_uInt16 nSetId (pSplitWindow->GetSet(nId)); pSplitWindow->SetItemSizeRange( nSetId, - Range(TabBar::GetDefaultWidth() + nWidth, gnMaximumSidebarWidth)); + Range(TabBar::GetDefaultWidth() * mpTabBar->GetDPIScaleFactor() + nWidth, + gnMaximumSidebarWidth * mpTabBar->GetDPIScaleFactor())); } } @@ -1160,13 +1164,13 @@ void SidebarController::UpdateCloseIndicator (const bool bCloseAfterDrag) // Place and show the indicator. const Size aWindowSize (mpParentWindow->GetSizePixel()); const Size aImageSize (mpCloseIndicator->GetSizePixel()); mpCloseIndicator->SetPosPixel( Point( - aWindowSize.Width() - TabBar::GetDefaultWidth() - aImageSize.Width(), + aWindowSize.Width() - TabBar::GetDefaultWidth() * mpTabBar->GetDPIScaleFactor() - aImageSize.Width(), (aWindowSize.Height() - aImageSize.Height())/2)); mpCloseIndicator->Show(); } else { // Hide but don't delete the indicator. 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 @@ -147,22 +147,39 @@ 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()); iItem!=iEnd; ++iItem) { 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(); } @@ -175,14 +192,14 @@ void TabBar::Layout (void) Theme::GetInteger(Theme::Int_TabBarTopPadding), Theme::GetInteger(Theme::Int_TabBarRightPadding), Theme::GetInteger(Theme::Int_TabBarBottomPadding)); 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) { mpMenuButton->SetPosSizePixel( Point(nX,nY), diff --git a/svx/source/sidebar/tools/ValueSetWithTextControl.cxx b/svx/source/sidebar/tools/ValueSetWithTextControl.cxx index 25d5798323f4..b897facd7aea 100644 --- a/svx/source/sidebar/tools/ValueSetWithTextControl.cxx +++ b/svx/source/sidebar/tools/ValueSetWithTextControl.cxx @@ -96,12 +96,27 @@ void ValueSetWithTextControl::AddItem( ValueSetWithTextItem aItem; aItem.maItemImage = rItemImage; aItem.maSelectedItemImage = (pSelectedItemImage != 0) ? *pSelectedItemImage : rItemImage; + + if ( GetDPIScaleFactor() > 1 ) + { + BitmapEx b = aItem.maItemImage.GetBitmapEx(); + b.Scale(GetDPIScaleFactor(), GetDPIScaleFactor()); + aItem.maItemImage = Image(b); + + if ( pSelectedItemImage != 0 ) + { + b = aItem.maSelectedItemImage.GetBitmapEx(); + b.Scale(GetDPIScaleFactor(), GetDPIScaleFactor()); + aItem.maSelectedItemImage = Image(b); + } + } + aItem.maItemText = rItemText; maItems.push_back( aItem ); InsertItem( maItems.size() ); SetItemText( maItems.size(), @@ -148,12 +163,26 @@ void ValueSetWithTextControl::ReplaceItemImages( } maItems[nItemId-1].maItemImage = rItemImage; maItems[nItemId-1].maSelectedItemImage = (pSelectedItemImage != 0) ? *pSelectedItemImage : rItemImage; + + if ( GetDPIScaleFactor() > 1 ) + { + BitmapEx b = maItems[nItemId-1].maItemImage.GetBitmapEx(); + b.Scale(GetDPIScaleFactor(), GetDPIScaleFactor()); + maItems[nItemId-1].maItemImage = Image(b); + + if ( pSelectedItemImage != 0 ) + { + b = maItems[nItemId-1].maSelectedItemImage.GetBitmapEx(); + b.Scale(GetDPIScaleFactor(), GetDPIScaleFactor()); + maItems[nItemId-1].maSelectedItemImage = Image(b); + } + } } void ValueSetWithTextControl::UserDraw( const UserDrawEvent& rUDEvt ) { const Rectangle aRect = rUDEvt.GetRect(); diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx index db81609fe450..01b34f923724 100644 --- a/svx/source/tbxctrls/fontworkgallery.cxx +++ b/svx/source/tbxctrls/fontworkgallery.cxx @@ -123,12 +123,16 @@ void FontWorkGalleryDialog::initFavorites(sal_uInt16 nThemeId) GalleryExplorer::GetSdrObj(nThemeId, nModelPos, pModel, &aThumb); if(!!aThumb) { VirtualDevice aVDev; const Point aNull(0, 0); + + if (GetDPIScaleFactor() > 1) + aThumb.Scale(GetDPIScaleFactor(), GetDPIScaleFactor()); + const Size aSize(aThumb.GetSizePixel()); aVDev.SetOutputSizePixel(aSize); if(rStyleSettings.GetPreviewUsesCheckeredBackground()) { diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index f7976e8ab12b..6d6befa2ff1f 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -1262,12 +1262,23 @@ SvxFrameWindow_Impl::SvxFrameWindow_Impl( sal_uInt16 nId, const Reference< XFram { BindListener(); AddStatusListener(OUString(".uno:BorderReducedMode")); aImgList = ImageList( SVX_RES( RID_SVXIL_FRAME ) ); + if( pParentWindow->GetDPIScaleFactor() > 1 ) + { + for (short i = 0; i < aImgList.GetImageCount(); i++) + { + OUString rImageName = aImgList.GetImageName(i); + BitmapEx b = aImgList.GetImage(rImageName).GetBitmapEx(); + b.Scale(pParentWindow->GetDPIScaleFactor(), pParentWindow->GetDPIScaleFactor()); + aImgList.ReplaceImage(rImageName, Image(b)); + } + } + /* * 1 2 3 4 * ------------------------------------- * NONE LEFT RIGHT LEFTRIGHT * TOP BOTTOM TOPBOTTOM OUTER * ------------------------------------- @@ -1284,13 +1295,13 @@ SvxFrameWindow_Impl::SvxFrameWindow_Impl( sal_uInt16 nId, const Reference< XFram for ( i = 9; i < 13; i++ ) aFrameSet.InsertItem( i, aImgList.GetImage(i) ); aFrameSet.SetColCount( 4 ); aFrameSet.SetSelectHdl( LINK( this, SvxFrameWindow_Impl, SelectHdl ) ); - lcl_CalcSizeValueSet( *this, aFrameSet,Size( 20, 20 )); + lcl_CalcSizeValueSet( *this, aFrameSet, Size( 20 * pParentWindow->GetDPIScaleFactor(), 20 * pParentWindow->GetDPIScaleFactor() )); SetHelpId( HID_POPUP_FRAME ); SetText( SVX_RESSTR(RID_SVXSTR_FRAME) ); aFrameSet.SetAccessibleName( SVX_RESSTR(RID_SVXSTR_FRAME) ); aFrameSet.Show(); } diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx index 5b68feb1e3fa..0651d155cb53 100644 --- a/sw/source/ui/table/tautofmt.cxx +++ b/sw/source/ui/table/tautofmt.cxx @@ -563,13 +563,13 @@ rCTLFont.MethodName( Value ); void AutoFmtPreview::MakeFonts( sal_uInt8 nIndex, Font& rFont, Font& rCJKFont, Font& rCTLFont ) { const SwBoxAutoFmt& rBoxFmt = aCurData.GetBoxFmt( nIndex ); rFont = rCJKFont = rCTLFont = GetFont(); - Size aFontSize( rFont.GetSize().Width(), 10 ); + Size aFontSize( rFont.GetSize().Width(), 10 * GetDPIScaleFactor() ); lcl_SetFontProperties( rFont, rBoxFmt.GetFont(), rBoxFmt.GetWeight(), rBoxFmt.GetPosture() ); lcl_SetFontProperties( rCJKFont, rBoxFmt.GetCJKFont(), rBoxFmt.GetCJKWeight(), rBoxFmt.GetCJKPosture() ); lcl_SetFontProperties( rCTLFont, rBoxFmt.GetCTLFont(), rBoxFmt.GetCTLWeight(), rBoxFmt.GetCTLPosture() ); SETONALLFONTS( SetUnderline, (FontUnderline)rBoxFmt.GetUnderline().GetValue() ); diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index fca0ce8b5971..1f9021971c8b 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -621,12 +621,13 @@ void ToolBox::InsertItem( sal_uInt16 nItemId, const Image& rImage, DBG_ASSERT( nItemId, "ToolBox::InsertItem(): ItemId == 0" ); DBG_ASSERT( GetItemPos( nItemId ) == TOOLBOX_ITEM_NOTFOUND, "ToolBox::InsertItem(): ItemId already exists" ); // Item anlegen und in die Liste einfuegen mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), ImplToolItem( nItemId, rImage, nBits ) ); + SetItemImage(nItemId, rImage); mpData->ImplClearLayoutData(); ImplInvalidate( sal_True ); // Notify sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos); @@ -642,12 +643,13 @@ void ToolBox::InsertItem( sal_uInt16 nItemId, const Image& rImage, DBG_ASSERT( nItemId, "ToolBox::InsertItem(): ItemId == 0" ); DBG_ASSERT( GetItemPos( nItemId ) == TOOLBOX_ITEM_NOTFOUND, "ToolBox::InsertItem(): ItemId already exists" ); // Item anlegen und in die Liste einfuegen mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), ImplToolItem( nItemId, rImage, ImplConvertMenuString( rText ), nBits ) ); + SetItemImage(nItemId, rImage); mpData->ImplClearLayoutData(); ImplInvalidate( sal_True ); // Notify sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos); |