diff options
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/dialcontrol.cxx | 5 | ||||
-rw-r--r-- | svx/source/stbctrls/modctrl.cxx | 14 | ||||
-rw-r--r-- | svx/source/stbctrls/pszctrl.cxx | 11 | ||||
-rw-r--r-- | svx/source/stbctrls/selctrl.cxx | 7 | ||||
-rw-r--r-- | svx/source/stbctrls/xmlsecctrl.cxx | 25 | ||||
-rw-r--r-- | svx/source/stbctrls/zoomsliderctrl.cxx | 39 | ||||
-rw-r--r-- | svx/source/tbxctrls/layctrl.cxx | 30 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.src | 2 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbunocontroller.cxx | 2 |
9 files changed, 107 insertions, 28 deletions
diff --git a/svx/source/dialog/dialcontrol.cxx b/svx/source/dialog/dialcontrol.cxx index 42e4e6f43d4e..4a780a6cf411 100644 --- a/svx/source/dialog/dialcontrol.cxx +++ b/svx/source/dialog/dialcontrol.cxx @@ -449,8 +449,13 @@ void DialControl::Init( const Size& rWinSize, const Font& rWinFont ) void DialControl::Init( const Size& rWinSize ) { + //hidpi TODO: GetDefaultFont() picks a font size too small, so fix it here. + Font aDefaultSize = GetFont(); + Font aFont( OutputDevice::GetDefaultFont( DEFAULTFONT_UI_SANS, Application::GetSettings().GetUILanguageTag().getLanguageType(), DEFAULTFONT_FLAGS_ONLYONE ) ); + + aFont.SetHeight(aDefaultSize.GetHeight()); Init( rWinSize, aFont ); } diff --git a/svx/source/stbctrls/modctrl.cxx b/svx/source/stbctrls/modctrl.cxx index da2d40f44688..5f0168794769 100644 --- a/svx/source/stbctrls/modctrl.cxx +++ b/svx/source/stbctrls/modctrl.cxx @@ -64,6 +64,7 @@ struct SvxModifyControl::ImplData maImages[MODIFICATION_STATE_NO] = Image(SVX_RES(RID_SVXBMP_DOC_MODIFIED_NO)); maImages[MODIFICATION_STATE_YES] = Image(SVX_RES(RID_SVXBMP_DOC_MODIFIED_YES)); maImages[MODIFICATION_STATE_FEEDBACK] = Image(SVX_RES(RID_SVXBMP_DOC_MODIFIED_FEEDBACK)); + maTimer.SetTimeout(_FEEDBACK_TIMEOUT); } }; @@ -75,6 +76,19 @@ SvxModifyControl::SvxModifyControl( sal_uInt16 _nSlotId, SfxStatusBarControl( _nSlotId, _nId, rStb ), mpImpl(new ImplData) { + printf ("SvxModifyControl SF %d\n", rStb.GetDPIScaleFactor()); + printf ("SvxModifyControl DPIY %d\n", rStb.ImplGetDPIY()); + + if ( rStb.GetDPIScaleFactor() > 1 ) + { + for (int i = 0; i < mpImpl->MODIFICATION_STATE_SIZE; i++) + { + BitmapEx b = mpImpl->maImages[i].GetBitmapEx(); + b.Scale(rStb.GetDPIScaleFactor(), rStb.GetDPIScaleFactor(), BMP_SCALE_FAST); + mpImpl->maImages[i] = Image(b); + } + } + mpImpl->maTimer.SetTimeoutHdl( LINK(this, SvxModifyControl, OnTimer) ); } diff --git a/svx/source/stbctrls/pszctrl.cxx b/svx/source/stbctrls/pszctrl.cxx index 89b9c19ede4b..733b8e7221a4 100644 --- a/svx/source/stbctrls/pszctrl.cxx +++ b/svx/source/stbctrls/pszctrl.cxx @@ -177,6 +177,17 @@ SvxPosSizeStatusBarControl::SvxPosSizeStatusBarControl( sal_uInt16 _nSlotId, pImp->aPosImage = Image( ResId( RID_SVXBMP_POSITION, DIALOG_MGR() ) ); pImp->aSizeImage = Image( ResId( RID_SVXBMP_SIZE, DIALOG_MGR() ) ); + if ( rStb.GetDPIScaleFactor() > 1) + { + BitmapEx b = pImp->aPosImage.GetBitmapEx(); + b.Scale(rStb.GetDPIScaleFactor(), rStb.GetDPIScaleFactor(), BMP_SCALE_FAST); + pImp->aPosImage = Image(b); + + b = pImp->aSizeImage.GetBitmapEx(); + b.Scale(rStb.GetDPIScaleFactor(), rStb.GetDPIScaleFactor(), BMP_SCALE_FAST); + pImp->aSizeImage = Image(b); + } + addStatusListener( OUString( STR_POSITION )); // SID_ATTR_POSITION addStatusListener( OUString( STR_TABLECELL )); // SID_TABLE_CELL addStatusListener( OUString( STR_FUNC )); // SID_PSZ_FUNCTION diff --git a/svx/source/stbctrls/selctrl.cxx b/svx/source/stbctrls/selctrl.cxx index e54760d3a9b6..9b77972d74de 100644 --- a/svx/source/stbctrls/selctrl.cxx +++ b/svx/source/stbctrls/selctrl.cxx @@ -80,6 +80,13 @@ SvxSelectionModeControl::SvxSelectionModeControl( sal_uInt16 _nSlotId, mnState( 0 ), maImage( SVX_RES( RID_SVXBMP_SELECTION ) ) { + if ( GetStatusBar().GetDPIScaleFactor() > 1 ) + { + BitmapEx b = maImage.GetBitmapEx(); + b.Scale(GetStatusBar().GetDPIScaleFactor(), GetStatusBar().GetDPIScaleFactor(), BMP_SCALE_FAST); + maImage = Image(b); + } + GetStatusBar().SetItemText( GetId(), "" ); } diff --git a/svx/source/stbctrls/xmlsecctrl.cxx b/svx/source/stbctrls/xmlsecctrl.cxx index b2e2eb9a0b89..46ea35b8b167 100644 --- a/svx/source/stbctrls/xmlsecctrl.cxx +++ b/svx/source/stbctrls/xmlsecctrl.cxx @@ -60,6 +60,23 @@ XmlSecStatusBarControl::XmlSecStatusBarControl( sal_uInt16 _nSlotId, sal_uInt16 mpImpl->maImage = Image( SVX_RES( RID_SVXBMP_SIGNET ) ); mpImpl->maImageBroken = Image( SVX_RES( RID_SVXBMP_SIGNET_BROKEN ) ); mpImpl->maImageNotValidated = Image( SVX_RES( RID_SVXBMP_SIGNET_NOTVALIDATED ) ); + + if (_rStb.GetDPIScaleFactor() > 1) + { + Image arr[3] = {mpImpl->maImage, mpImpl->maImageBroken, mpImpl->maImageNotValidated}; + + for (int i = 0; i < 3; i++) + { + BitmapEx b = arr[i].GetBitmapEx(); + b.Scale(_rStb.GetDPIScaleFactor(), _rStb.GetDPIScaleFactor(), BMP_SCALE_FAST); + arr[i] = Image(b); + } + + mpImpl->maImage = arr[0]; + mpImpl->maImageBroken = arr[1]; + mpImpl->maImageNotValidated = arr[2]; + } + } XmlSecStatusBarControl::~XmlSecStatusBarControl() @@ -135,20 +152,22 @@ void XmlSecStatusBarControl::Paint( const UserDrawEvent& rUsrEvt ) pDev->SetLineColor(); pDev->SetFillColor( pDev->GetBackground().GetColor() ); + long yOffset = (aRect.GetHeight() - mpImpl->maImage.GetSizePixel().Height()) / 2; + if( mpImpl->mnState == SIGNATURESTATE_SIGNATURES_OK ) { - ++aRect.Top(); + aRect.Top() += yOffset; pDev->DrawImage( aRect.TopLeft(), mpImpl->maImage ); } else if( mpImpl->mnState == SIGNATURESTATE_SIGNATURES_BROKEN ) { - ++aRect.Top(); + aRect.Top() += yOffset; pDev->DrawImage( aRect.TopLeft(), mpImpl->maImageBroken ); } else if( mpImpl->mnState == SIGNATURESTATE_SIGNATURES_NOTVALIDATED || mpImpl->mnState == SIGNATURESTATE_SIGNATURES_PARTIAL_OK) { - ++aRect.Top(); + aRect.Top() += yOffset; pDev->DrawImage( aRect.TopLeft(), mpImpl->maImageNotValidated ); } else diff --git a/svx/source/stbctrls/zoomsliderctrl.cxx b/svx/source/stbctrls/zoomsliderctrl.cxx index fc72cb621f8c..638a8505fb9a 100644 --- a/svx/source/stbctrls/zoomsliderctrl.cxx +++ b/svx/source/stbctrls/zoomsliderctrl.cxx @@ -66,12 +66,6 @@ struct SvxZoomSliderControl::SvxZoomSliderControl_Impl // ----------------------------------------------------------------------- -const long nButtonWidth = 10; -const long nButtonHeight = 10; -const long nIncDecWidth = 10; -const long nIncDecHeight = 10; -const long nSliderHeight = 2; -const long nSnappingHeight = 4; const long nSliderXOffset = 20; const long nSnappingEpsilon = 5; // snapping epsilon in pixels const long nSnappingPointsMinDist = nSnappingEpsilon; // minimum distance of two adjacent snapping points @@ -175,6 +169,23 @@ SvxZoomSliderControl::SvxZoomSliderControl( sal_uInt16 _nSlotId, sal_uInt16 _nI mpImpl->maSliderButton = Image( SVX_RES( RID_SVXBMP_SLIDERBUTTON ) ); mpImpl->maIncreaseButton = Image( SVX_RES( RID_SVXBMP_SLIDERINCREASE ) ); mpImpl->maDecreaseButton = Image( SVX_RES( RID_SVXBMP_SLIDERDECREASE ) ); + + if ( _rStb.GetDPIScaleFactor() > 1) + { + Image arr[3] = {mpImpl->maSliderButton, mpImpl->maIncreaseButton, mpImpl->maDecreaseButton}; + + for (int i = 0; i < 3; i++) + { + BitmapEx b = arr[i].GetBitmapEx(); + //Use Lanczos scaling for the slider button because it does a better job with circles + b.Scale(_rStb.GetDPIScaleFactor(), _rStb.GetDPIScaleFactor(), i == 0 ? BMP_SCALE_LANCZOS : BMP_SCALE_FAST); + arr[i] = Image(b); + } + + mpImpl->maSliderButton = arr[0]; + mpImpl->maIncreaseButton = arr[1]; + mpImpl->maDecreaseButton = arr[2]; + } } // ----------------------------------------------------------------------- @@ -258,6 +269,9 @@ void SvxZoomSliderControl::Paint( const UserDrawEvent& rUsrEvt ) Rectangle aRect = rUsrEvt.GetRect(); Rectangle aSlider = aRect; + long nSliderHeight = 2 * pDev->GetDPIScaleFactor(); + long nSnappingHeight = 4 * pDev->GetDPIScaleFactor(); + aSlider.Top() += (aControlRect.GetHeight() - nSliderHeight)/2; aSlider.Bottom() = aSlider.Top() + nSliderHeight - 1; aSlider.Left() += nSliderXOffset; @@ -270,6 +284,7 @@ void SvxZoomSliderControl::Paint( const UserDrawEvent& rUsrEvt ) pDev->SetLineColor( rStyleSettings.GetShadowColor() ); pDev->SetFillColor( rStyleSettings.GetShadowColor() ); + // draw snapping points: std::vector< long >::iterator aSnappingPointIter; for ( aSnappingPointIter = mpImpl->maSnappingPointOffsets.begin(); @@ -288,18 +303,18 @@ void SvxZoomSliderControl::Paint( const UserDrawEvent& rUsrEvt ) // draw slider button Point aImagePoint = aRect.TopLeft(); aImagePoint.X() += Zoom2Offset( mpImpl->mnCurrentZoom ); - aImagePoint.X() -= nButtonWidth/2; - aImagePoint.Y() += (aControlRect.GetHeight() - nButtonHeight)/2; + aImagePoint.X() -= mpImpl->maSliderButton.GetSizePixel().Width()/2; + aImagePoint.Y() += (aControlRect.GetHeight() - mpImpl->maSliderButton.GetSizePixel().Height())/2; pDev->DrawImage( aImagePoint, mpImpl->maSliderButton ); // draw decrease button aImagePoint = aRect.TopLeft(); - aImagePoint.X() += (nSliderXOffset - nIncDecWidth)/2; - aImagePoint.Y() += (aControlRect.GetHeight() - nIncDecHeight)/2; + aImagePoint.X() += (nSliderXOffset - mpImpl->maDecreaseButton.GetSizePixel().Width())/2; + aImagePoint.Y() += (aControlRect.GetHeight() - mpImpl->maDecreaseButton.GetSizePixel().Height())/2; pDev->DrawImage( aImagePoint, mpImpl->maDecreaseButton ); // draw increase button - aImagePoint.X() = aRect.TopLeft().X() + aControlRect.GetWidth() - nIncDecWidth - (nSliderXOffset - nIncDecWidth)/2; + aImagePoint.X() = aRect.TopLeft().X() + aControlRect.GetWidth() - mpImpl->maIncreaseButton.GetSizePixel().Width() - (nSliderXOffset - mpImpl->maIncreaseButton.GetSizePixel().Height())/2; pDev->DrawImage( aImagePoint, mpImpl->maIncreaseButton ); pDev->SetLineColor( aOldLineColor ); @@ -317,6 +332,8 @@ sal_Bool SvxZoomSliderControl::MouseButtonDown( const MouseEvent & rEvt ) const Point aPoint = rEvt.GetPosPixel(); const sal_Int32 nXDiff = aPoint.X() - aControlRect.Left(); + long nIncDecWidth = mpImpl->maIncreaseButton.GetSizePixel().Width(); + const long nButtonLeftOffset = (nSliderXOffset - nIncDecWidth)/2; const long nButtonRightOffset = (nSliderXOffset + nIncDecWidth)/2; diff --git a/svx/source/tbxctrls/layctrl.cxx b/svx/source/tbxctrls/layctrl.cxx index f004fe310e1d..eb55215c723b 100644 --- a/svx/source/tbxctrls/layctrl.cxx +++ b/svx/source/tbxctrls/layctrl.cxx @@ -43,18 +43,6 @@ SFX_IMPL_TOOLBOX_CONTROL(SvxColumnsToolBoxControl,SfxUInt16Item); // class TableWindow ----------------------------------------------------- -const long TABLE_CELL_WIDTH = 15; -const long TABLE_CELL_HEIGHT = 15; - -const long TABLE_CELLS_HORIZ = 10; -const long TABLE_CELLS_VERT = 15; - -const long TABLE_POS_X = 2; -const long TABLE_POS_Y = 2; - -const long TABLE_WIDTH = TABLE_POS_X + TABLE_CELLS_HORIZ*TABLE_CELL_WIDTH; -const long TABLE_HEIGHT = TABLE_POS_Y + TABLE_CELLS_VERT*TABLE_CELL_HEIGHT; - class TableWindow : public SfxPopupWindow { private: @@ -71,6 +59,18 @@ private: Reference< XFrame > mxFrame; OUString maCommand; + long TABLE_CELL_WIDTH; + long TABLE_CELL_HEIGHT; + + const long TABLE_CELLS_HORIZ = 10; + const long TABLE_CELLS_VERT = 15; + + long TABLE_POS_X = 2; + long TABLE_POS_Y = 2; + + long TABLE_WIDTH; + long TABLE_HEIGHT; + DECL_LINK( SelectHdl, void * ); public: @@ -113,6 +113,12 @@ TableWindow::TableWindow( sal_uInt16 nSlotId, const OUString& rCmd, const OUStri mxFrame( rFrame ), maCommand( rCmd ) { + TABLE_CELL_WIDTH = 15 * GetDPIScaleFactor(); + TABLE_CELL_HEIGHT = 15 * GetDPIScaleFactor(); + + TABLE_WIDTH = TABLE_POS_X + TABLE_CELLS_HORIZ*TABLE_CELL_WIDTH; + TABLE_HEIGHT = TABLE_POS_Y + TABLE_CELLS_VERT*TABLE_CELL_HEIGHT; + const StyleSettings& rStyles = Application::GetSettings().GetStyleSettings(); svtools::ColorConfig aColorConfig; diff --git a/svx/source/tbxctrls/tbcontrl.src b/svx/source/tbxctrls/tbcontrl.src index 4d2cfbc13a73..665f0fa5c2af 100644 --- a/svx/source/tbxctrls/tbcontrl.src +++ b/svx/source/tbxctrls/tbcontrl.src @@ -74,7 +74,7 @@ String RID_SVXSTR_FRAME_COLOR ComboBox RID_SVXTBX_STYLE { HelpId = HID_STYLE_LISTBOX ; - Size = MAP_APPFONT ( 67 , 86 ) ; + Size = MAP_APPFONT ( 50 , 86 ) ; DropDown = TRUE ; Sort = TRUE ; AutoHScroll = TRUE ; diff --git a/svx/source/tbxctrls/tbunocontroller.cxx b/svx/source/tbxctrls/tbunocontroller.cxx index 36e257e5d876..c34384466b6e 100644 --- a/svx/source/tbxctrls/tbunocontroller.cxx +++ b/svx/source/tbxctrls/tbunocontroller.cxx @@ -85,7 +85,7 @@ SvxFontSizeBox_Impl::SvxFontSizeBox_Impl( FontSizeBox( _pParent, WinBits( WB_DROPDOWN ) ), m_pCtrl ( &_rCtrl ), - m_aLogicalSize ( 30,100 ), + m_aLogicalSize ( 20,100 ), m_bRelease ( true ), m_xDispatchProvider ( _rDispatchProvider ), m_xFrame ( _xFrame ) |