From 51fdf273e9893d3d05c99a09e1c2e5835a78e891 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Tue, 22 May 2012 15:44:13 +0200 Subject: border window: Design by Mirek M. - make the 'shells' more lightweight. Just a line at the top and the bottom, we do not want the entire 3D effect here, it makes it visually incompatible with the window decorations. Change-Id: I262932fb5def21d5bc4fb347be6d6a07807bb4d2 --- vcl/inc/vcl/decoview.hxx | 1 + vcl/inc/vcl/window.hxx | 1 + vcl/source/window/brdwin.cxx | 4 ++++ vcl/source/window/decoview.cxx | 15 +++++++++++++++ 4 files changed, 21 insertions(+) (limited to 'vcl') diff --git a/vcl/inc/vcl/decoview.hxx b/vcl/inc/vcl/decoview.hxx index 64b738e66388..b6b6f0f09e94 100644 --- a/vcl/inc/vcl/decoview.hxx +++ b/vcl/inc/vcl/decoview.hxx @@ -52,6 +52,7 @@ class OutputDevice; #define FRAME_DRAW_GROUP ((sal_uInt16)0x0003) #define FRAME_DRAW_DOUBLEIN ((sal_uInt16)0x0004) #define FRAME_DRAW_DOUBLEOUT ((sal_uInt16)0x0005) +#define FRAME_DRAW_TOPBOTTOM ((sal_uInt16)0x0006) #define FRAME_DRAW_MENU ((sal_uInt16)0x0010) #define FRAME_DRAW_WINDOWBORDER ((sal_uInt16)0x0020) #define FRAME_DRAW_BORDERWINDOWBORDER ((sal_uInt16)0x0040) diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx index 94a3fbea738b..65118ca16520 100644 --- a/vcl/inc/vcl/window.hxx +++ b/vcl/inc/vcl/window.hxx @@ -292,6 +292,7 @@ typedef sal_uInt16 StateChangedType; #define WINDOW_BORDER_ACTIVE ((sal_uInt16)0x0004) #define WINDOW_BORDER_DOUBLEOUT ((sal_uInt16)0x0008) #define WINDOW_BORDER_MENU ((sal_uInt16)0x0010) +#define WINDOW_BORDER_TOPBOTTOM ((sal_uInt16)0x0020) #define WINDOW_BORDER_NOBORDER ((sal_uInt16)0x1000) #define WINDOW_BORDER_REMOVEBORDER ((sal_uInt16)0x2000) diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index 22dff3573389..9d397c2de7d7 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -1199,6 +1199,8 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei // ist, dann Border nach aussen if ( (nBorderStyle & WINDOW_BORDER_DOUBLEOUT) || mpBorderWindow->mbSmallOutBorder ) nStyle |= FRAME_DRAW_DOUBLEOUT; + else if ( nBorderStyle & WINDOW_BORDER_TOPBOTTOM ) + nStyle |= FRAME_DRAW_TOPBOTTOM; else nStyle |= FRAME_DRAW_DOUBLEIN; if ( nBorderStyle & WINDOW_BORDER_MONO ) @@ -1388,6 +1390,8 @@ void ImplSmallBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* // ist, dann Border nach aussen if ( (nBorderStyle & WINDOW_BORDER_DOUBLEOUT) || mpBorderWindow->mbSmallOutBorder ) nStyle |= FRAME_DRAW_DOUBLEOUT; + else if ( nBorderStyle & WINDOW_BORDER_TOPBOTTOM ) + nStyle |= FRAME_DRAW_TOPBOTTOM; else nStyle |= FRAME_DRAW_DOUBLEIN; if ( nBorderStyle & WINDOW_BORDER_MONO ) diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx index 6b6bc1a132f4..878578df7724 100644 --- a/vcl/source/window/decoview.cxx +++ b/vcl/source/window/decoview.cxx @@ -734,6 +734,11 @@ void ImplDrawFrame( OutputDevice *const pDev, Rectangle& rRect, rRect.Right() -= 2; rRect.Bottom() -= 2; break; + + case FRAME_DRAW_TOPBOTTOM: + ++rRect.Top(); + --rRect.Bottom(); + break; } } else @@ -815,6 +820,16 @@ void ImplDrawFrame( OutputDevice *const pDev, Rectangle& rRect, rStyleSettings.GetShadowColor() ); } break; + + case FRAME_DRAW_TOPBOTTOM: + pDev->SetLineColor( rStyleSettings.GetShadowColor() ); + pDev->DrawLine( Point( rRect.Left(), rRect.Top() ), Point( rRect.Right(), rRect.Top() ) ); + pDev->DrawLine( Point( rRect.Left(), rRect.Bottom() ), Point( rRect.Right(), rRect.Bottom() ) ); + + // adjust target rectangle + ++rRect.Top(); + --rRect.Bottom(); + break; } } } -- cgit