[Libreoffice-commits] .: 3 commits - vcl/source vcl/win
Ivan Timofeev
ivantimofeev at kemper.freedesktop.org
Sat Apr 14 10:00:13 PDT 2012
vcl/source/window/menu.cxx | 5 ++++-
vcl/win/source/gdi/salnativewidgets-luna.cxx | 21 +++++++++++++--------
2 files changed, 17 insertions(+), 9 deletions(-)
New commits:
commit 3a603d376a2bc2b839be3b89a8ecf8df1c42260b
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date: Sat Apr 14 20:51:20 2012 +0400
vcl: win: adjust some coordinates
diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx b/vcl/win/source/gdi/salnativewidgets-luna.cxx
index 3b0051a..888b1a7 100644
--- a/vcl/win/source/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx
@@ -986,7 +986,7 @@ sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
RECT aGutterRC = rc;
if( Application::GetSettings().GetLayoutRTL() )
{
- aGutterRC.right -= aValue.getNumericVal();
+ aGutterRC.right -= aValue.getNumericVal()+1;
aGutterRC.left = aGutterRC.right-3;
}
else
@@ -1043,9 +1043,9 @@ sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
{
// adjust for gutter position
if( Application::GetSettings().GetLayoutRTL() )
- rc.right -= aValue.getNumericVal();
+ rc.right -= aValue.getNumericVal()+1;
else
- rc.left += aValue.getNumericVal();
+ rc.left += aValue.getNumericVal()+1;
Rectangle aRect( ImplGetThemeRect( hTheme, hDC,
MENU_POPUPSEPARATOR, 0, Rectangle( rc.left, rc.top, rc.right, rc.bottom ) ) );
// center the separator inside the passed rectangle
commit 7179a362dd5788c4c4f7197d15abfa17e0cad584
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date: Sat Apr 14 20:48:11 2012 +0400
vcl: win: fix RTL checkmark backgrounds fdo#42537
diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx b/vcl/win/source/gdi/salnativewidgets-luna.cxx
index bcf80cd..3b0051a 100644
--- a/vcl/win/source/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx
@@ -1015,13 +1015,18 @@ sal_Bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
if( aValue.getType() == CTRL_MENU_POPUP )
{
const MenupopupValue& rMVal( static_cast<const MenupopupValue&>(aValue) );
- aBGRect.left = rMVal.maItemRect.Left();
aBGRect.top = rMVal.maItemRect.Top();
aBGRect.bottom = rMVal.maItemRect.Bottom()+1; // see below in drawNativeControl
- aBGRect.right = rMVal.getNumericVal();
-
- // FIXME: magic
- aBGRect.left += 1; aBGRect.top += 1; aBGRect.bottom +=1;
+ if( Application::GetSettings().GetLayoutRTL() )
+ {
+ aBGRect.right = rMVal.maItemRect.Right()+1;
+ aBGRect.left = aBGRect.right - (rMVal.getNumericVal()-rMVal.maItemRect.Left());
+ }
+ else
+ {
+ aBGRect.right = rMVal.getNumericVal();
+ aBGRect.left = rMVal.maItemRect.Left();
+ }
}
iState = (nState & CTRL_STATE_ENABLED) ? MCB_NORMAL : MCB_DISABLED;
ImplDrawTheme( hTheme, hDC, MENU_POPUPCHECKBACKGROUND, iState, aBGRect, aCaption );
commit 532904765073c827bed3181d97c217909db1843f
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date: Sat Apr 14 20:42:23 2012 +0400
vcl: hack: pData->aSz.Width() is set only for MenuBar, use aOutSz.Width()
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 73283f3..eaca00d 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2751,7 +2751,10 @@ void Menu::ImplPaint( Window* pWin, sal_uInt16 nBorder, long nStartY, MenuItemDa
aTmpPos.Y() = aOuterCheckRect.Top() + (aOuterCheckRect.GetHeight() - nCtrlHeight)/2;
Rectangle aCheckRect( aTmpPos, Size( nCtrlHeight, nCtrlHeight ) );
- MenupopupValue aVal( nTextPos-GUTTERBORDER, Rectangle( aPos, pData->aSz ) );
+ Size aSz( pData->aSz );
+ aSz.Width() = aOutSz.Width() - 2*nOuterSpace;
+ Rectangle aItemRect( aPos, aSz );
+ MenupopupValue aVal( nTextPos-GUTTERBORDER, aItemRect );
pWin->DrawNativeControl( CTRL_MENU_POPUP, nPart,
aCheckRect,
nState,
More information about the Libreoffice-commits
mailing list