Kaydet (Commit) 7431bc26 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

Draw a rect in the uncovered region of the native scrollbar

When the requested region is larger than the native scrollbar the
uncovered regions need to be drawn with a background color to
avoid artifacts.

This situation can happen when the TabBar is inline with scrollbar
when the width of the TabBar is greater than the width of the
scrollbar. Inline TabBar support is added in a later commit.

Change-Id: I70cb2e5bfd8d79401f77bbe55abe596adc160194
üst 8c639609
...@@ -502,6 +502,20 @@ bool ScrollBar::ImplDrawNative( sal_uInt16 nDrawFlags ) ...@@ -502,6 +502,20 @@ bool ScrollBar::ImplDrawNative( sal_uInt16 nDrawFlags )
aCtrlRegion.Union( maPage1Rect ); aCtrlRegion.Union( maPage1Rect );
aCtrlRegion.Union( maPage2Rect ); aCtrlRegion.Union( maPage2Rect );
aCtrlRegion.Union( maThumbRect ); aCtrlRegion.Union( maThumbRect );
Rectangle aRequestedRegion(Point(0,0), GetOutputSizePixel());
// if the actual native control region is smaller then the region that
// we requested the control to draw in, then draw a background rectangle
// to avoid drawing artifacts in the uncovered region
if (aCtrlRegion.GetWidth() < aRequestedRegion.GetWidth() ||
aCtrlRegion.GetHeight() < aRequestedRegion.GetHeight())
{
Color aFaceColor = GetSettings().GetStyleSettings().GetFaceColor();
SetFillColor(aFaceColor);
SetLineColor(aFaceColor);
DrawRect(aRequestedRegion);
}
bNativeOK = DrawNativeControl( CTRL_SCROLLBAR, (bHorz ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT), bNativeOK = DrawNativeControl( CTRL_SCROLLBAR, (bHorz ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT),
aCtrlRegion, nState, scrValue, OUString() ); aCtrlRegion, nState, scrValue, OUString() );
} }
...@@ -613,7 +627,7 @@ void ScrollBar::ImplDraw( sal_uInt16 nDrawFlags, OutputDevice* pOutDev ) ...@@ -613,7 +627,7 @@ void ScrollBar::ImplDraw( sal_uInt16 nDrawFlags, OutputDevice* pOutDev )
{ {
DecorationView aDecoView( pOutDev ); DecorationView aDecoView( pOutDev );
Rectangle aTempRect; Rectangle aTempRect;
sal_uInt16 nStyle; sal_uInt16 nStyle;
const StyleSettings& rStyleSettings = pOutDev->GetSettings().GetStyleSettings(); const StyleSettings& rStyleSettings = pOutDev->GetSettings().GetStyleSettings();
SymbolType eSymbolType; SymbolType eSymbolType;
bool bEnabled = IsEnabled(); bool bEnabled = IsEnabled();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment