summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2009-06-04 15:06:14 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2009-06-04 15:06:14 +0000
commitf9278148dc944e947fa8ed2b786098bcdba39004 (patch)
tree87ab1c5352b57526c3bcf3e34c5a4a4ad98ea453 /vcl/source
parentcf1a66987abce026206ef2be5089847dcca1ae88 (diff)
CWS-TOOLING: integrate CWS vcl102
pl: resync to m49 pl: #i102082# correct index access pl: #i102082# correct index access pl: merge tag pl: #i101674# update selection background markers for toolbars and menus pl: fix debug compile pl: #i101461# improve xdg functionality (thanks oblin) pl: #i100501# get IsAddStream from configuration setting in direct export case pl: #i100725# check for null ptr pl: #i100617# fix got lost in merge
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/window/keycod.cxx40
-rw-r--r--vcl/source/window/menu.cxx19
-rw-r--r--vcl/source/window/toolbox.cxx2
-rw-r--r--vcl/source/window/window.cxx52
4 files changed, 65 insertions, 48 deletions
diff --git a/vcl/source/window/keycod.cxx b/vcl/source/window/keycod.cxx
index 77af28241cb3..21030b9422fb 100644
--- a/vcl/source/window/keycod.cxx
+++ b/vcl/source/window/keycod.cxx
@@ -49,27 +49,27 @@
// =======================================================================
-static USHORT aImplKeyFuncTab[(KEYFUNC_FRONT+1)*3] =
+static USHORT aImplKeyFuncTab[(KEYFUNC_FRONT+1)*4] =
{
- 0, 0, 0, // KEYFUNC_DONTKNOW
- KEY_N | KEY_MOD1, 0, 0, // KEYFUNC_NEW
- KEY_O | KEY_MOD1, KEY_OPEN, 0, // KEYFUNC_OPEN
- KEY_S | KEY_MOD1, 0, 0, // KEYFUNC_SAVE
- 0, 0, 0, // KEYFUNC_SAVEAS
- KEY_P | KEY_MOD1, 0, 0, // KEYFUNC_PRINT
- KEY_W | KEY_MOD1, KEY_F4 | KEY_MOD1, 0, // KEYFUNC_CLOSE
- KEY_Q | KEY_MOD1, KEY_F4 | KEY_MOD2, 0, // KEYFUNC_QUIT
- KEY_X | KEY_MOD1, KEY_DELETE | KEY_SHIFT, KEY_CUT, // KEYFUNC_CUT
- KEY_C | KEY_MOD1, KEY_INSERT | KEY_MOD1, KEY_COPY, // KEYFUNC_COPY
- KEY_V | KEY_MOD1, KEY_INSERT | KEY_SHIFT, KEY_PASTE, // KEYFUNC_PASTE
- KEY_Z | KEY_MOD1, KEY_BACKSPACE | KEY_MOD2, KEY_UNDO, // KEYFUNC_UNDO
- 0, 0, 0, // KEYFUNC_REDO
- KEY_DELETE, 0, 0, // KEYFUNC_DELETE
- KEY_REPEAT, 0, 0, // KEYFUNC_REPEAT
- KEY_F | KEY_MOD1, KEY_FIND, 0, // KEYFUNC_FIND
- KEY_F | KEY_SHIFT | KEY_MOD1, KEY_SHIFT | KEY_FIND, 0, // KEYFUNC_FINDBACKWARD
- KEY_RETURN | KEY_MOD2, 0, 0, // KEYFUNC_PROPERTIES
- 0, 0, 0 // KEYFUNC_FRONT
+ 0, 0, 0, 0, // KEYFUNC_DONTKNOW
+ KEY_N | KEY_MOD1, 0, 0, 0, // KEYFUNC_NEW
+ KEY_O | KEY_MOD1, KEY_OPEN, 0, 0, // KEYFUNC_OPEN
+ KEY_S | KEY_MOD1, 0, 0, 0, // KEYFUNC_SAVE
+ 0, 0, 0, 0, // KEYFUNC_SAVEAS
+ KEY_P | KEY_MOD1, 0, 0, 0, // KEYFUNC_PRINT
+ KEY_W | KEY_MOD1, KEY_F4 | KEY_MOD1, 0, 0, // KEYFUNC_CLOSE
+ KEY_Q | KEY_MOD1, KEY_F4 | KEY_MOD2, 0, 0, // KEYFUNC_QUIT
+ KEY_X | KEY_MOD1, KEY_DELETE | KEY_SHIFT, KEY_CUT, 0, // KEYFUNC_CUT
+ KEY_C | KEY_MOD1, KEY_INSERT | KEY_MOD1, KEY_COPY, 0, // KEYFUNC_COPY
+ KEY_V | KEY_MOD1, KEY_INSERT | KEY_SHIFT, KEY_PASTE, 0, // KEYFUNC_PASTE
+ KEY_Z | KEY_MOD1, KEY_BACKSPACE | KEY_MOD2, KEY_UNDO, 0, // KEYFUNC_UNDO
+ 0, 0, 0, 0, // KEYFUNC_REDO
+ KEY_DELETE, 0, 0, 0, // KEYFUNC_DELETE
+ KEY_REPEAT, 0, 0, 0, // KEYFUNC_REPEAT
+ KEY_F | KEY_MOD1, KEY_FIND, 0, 0, // KEYFUNC_FIND
+ KEY_F | KEY_SHIFT | KEY_MOD1, KEY_SHIFT | KEY_FIND, 0, 0, // KEYFUNC_FINDBACKWARD
+ KEY_RETURN | KEY_MOD2, 0, 0, 0, // KEYFUNC_PROPERTIES
+ 0, 0, 0, 0 // KEYFUNC_FRONT
};
// -----------------------------------------------------------------------
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index b074a658ac3b..c827905e94e6 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2487,23 +2487,8 @@ static void ImplPaintCheckBackground( Window* i_pWindow, const Rectangle& i_rRec
if( ! bNativeOk )
{
const StyleSettings& rSettings = i_pWindow->GetSettings().GetStyleSettings();
- if( i_bHighlight )
- {
- i_pWindow->Push( PUSH_ALL );
- Color aCol = rSettings.GetMenuHighlightTextColor();
- i_pWindow->SetFillColor( rSettings.GetMenuHighlightTextColor() );
- if( aCol.IsDark() )
- aCol.IncreaseLuminance( 128 );
- else
- aCol.DecreaseLuminance( 128 );
- i_pWindow->SetLineColor( aCol );
- Polygon aPoly( i_rRect );
- PolyPolygon aPolyPoly( aPoly );
- i_pWindow->DrawTransparent( aPolyPoly, 20 );
- i_pWindow->Pop();
- }
- else
- i_pWindow->DrawSelectionBackground( i_rRect, 1, FALSE, TRUE, FALSE );
+ Color aColor( i_bHighlight ? rSettings.GetMenuHighlightTextColor() : rSettings.GetHighlightColor() );
+ i_pWindow->DrawSelectionBackground( i_rRect, 0, i_bHighlight, TRUE, FALSE, 2, NULL, &aColor );
}
}
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 07d56588c80e..bb1f428c6626 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -3378,7 +3378,7 @@ static void ImplDrawButton( ToolBox* pThis, const Rectangle &rRect, USHORT highl
}
if( !bNativeOk )
- pThis->DrawSelectionBackground( rRect, bIsWindow ? 3 : highlight, bChecked, TRUE, bIsWindow );
+ pThis->DrawSelectionBackground( rRect, bIsWindow ? 3 : highlight, bChecked, TRUE, bIsWindow, 2, NULL, NULL );
}
void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLayout )
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 676375db10bf..279775d712e4 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -9240,19 +9240,34 @@ BOOL Window::ImplGetCurrentBackgroundColor( Color& rCol )
void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, BOOL bChecked, BOOL bDrawBorder, BOOL bDrawExtBorderOnly )
{
- DrawSelectionBackground( rRect, highlight, bChecked, bDrawBorder, bDrawExtBorderOnly, NULL );
+ DrawSelectionBackground( rRect, highlight, bChecked, bDrawBorder, bDrawExtBorderOnly, 0, NULL, NULL );
}
void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, BOOL bChecked, BOOL bDrawBorder, BOOL bDrawExtBorderOnly, Color* pSelectionTextColor )
{
+ DrawSelectionBackground( rRect, highlight, bChecked, bDrawBorder, bDrawExtBorderOnly, 0, pSelectionTextColor, NULL );
+}
+
+void Window::DrawSelectionBackground( const Rectangle& rRect,
+ USHORT highlight,
+ BOOL bChecked,
+ BOOL bDrawBorder,
+ BOOL bDrawExtBorderOnly,
+ long nCornerRadius,
+ Color* pSelectionTextColor,
+ Color* pPaintColor
+ )
+{
if( rRect.IsEmpty() )
return;
+ bool bRoundEdges = nCornerRadius > 0;
+
const StyleSettings& rStyles = GetSettings().GetStyleSettings();
// colors used for item highlighting
- Color aSelectionBorderCol( rStyles.GetHighlightColor() );
+ Color aSelectionBorderCol( pPaintColor ? *pPaintColor : rStyles.GetHighlightColor() );
Color aSelectionFillCol( aSelectionBorderCol );
BOOL bDark = rStyles.GetFaceColor().IsDark();
@@ -9261,7 +9276,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight,
int c1 = aSelectionBorderCol.GetLuminance();
int c2 = GetDisplayBackground().GetColor().GetLuminance();
- if( !bDark && !bBright && abs( c2-c1 ) < 75 )
+ if( !bDark && !bBright && abs( c2-c1 ) < (pPaintColor ? 40 : 75) )
{
// constrast too low
USHORT h,s,b;
@@ -9272,6 +9287,14 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight,
aSelectionBorderCol = aSelectionFillCol;
}
+ if( bRoundEdges )
+ {
+ if( aSelectionBorderCol.IsDark() )
+ aSelectionBorderCol.IncreaseLuminance( 128 );
+ else
+ aSelectionBorderCol.DecreaseLuminance( 128 );
+ }
+
Rectangle aRect( rRect );
if( bDrawExtBorderOnly )
{
@@ -9294,7 +9317,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight,
if( bDark )
aSelectionFillCol = COL_BLACK;
else
- nPercent = 80; // just checked (light)
+ nPercent = bRoundEdges ? 90 : 80; // just checked (light)
}
else
{
@@ -9309,7 +9332,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight,
nPercent = 0;
}
else
- nPercent = 20; // selected, pressed or checked ( very dark )
+ nPercent = bRoundEdges ? 50 : 20; // selected, pressed or checked ( very dark )
}
else if( bChecked || highlight == 1 )
{
@@ -9322,7 +9345,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight,
nPercent = 0;
}
else
- nPercent = 35; // selected, pressed or checked ( very dark )
+ nPercent = bRoundEdges ? 70 : 35; // selected, pressed or checked ( very dark )
}
else
{
@@ -9338,7 +9361,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight,
nPercent = 0;
}
else
- nPercent = 70; // selected ( dark )
+ nPercent = bRoundEdges ? 80 : 70; // selected ( dark )
}
}
@@ -9368,9 +9391,18 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight,
}
else
{
- Polygon aPoly( aRect );
- PolyPolygon aPolyPoly( aPoly );
- DrawTransparent( aPolyPoly, nPercent );
+ if( bRoundEdges )
+ {
+ Polygon aPoly( aRect, nCornerRadius, nCornerRadius );
+ PolyPolygon aPolyPoly( aPoly );
+ DrawTransparent( aPolyPoly, nPercent );
+ }
+ else
+ {
+ Polygon aPoly( aRect );
+ PolyPolygon aPolyPoly( aPoly );
+ DrawTransparent( aPolyPoly, nPercent );
+ }
}
SetFillColor( oldFillCol );