@@ -307,22 +307,23 @@ protected virtual Rectangle DisplayingRectangle
307307 get
308308 {
309309 Rectangle rect = ClientRectangle ;
310+ Boolean flat = PluginCore . PluginBase . MainForm . GetThemeColor ( "AutoHideWindowControl.BackColor" ) != Color . Empty ;
310311
311312 // exclude the border and the splitter
312313 if ( DockState == DockState . DockBottomAutoHide )
313314 {
314- rect . Y += 2 + Measures . SplitterSize ;
315- rect . Height -= 2 + Measures . SplitterSize ;
315+ rect . Y += flat ? 1 : 2 + Measures . SplitterSize ;
316+ rect . Height -= flat ? 1 : 2 + Measures . SplitterSize ;
316317 }
317318 else if ( DockState == DockState . DockRightAutoHide )
318319 {
319- rect . X += 2 + Measures . SplitterSize ;
320- rect . Width -= 2 + Measures . SplitterSize ;
320+ rect . X += flat ? 1 : 2 + Measures . SplitterSize ;
321+ rect . Width -= flat ? 1 : 2 + Measures . SplitterSize ;
321322 }
322323 else if ( DockState == DockState . DockTopAutoHide )
323- rect . Height -= 2 + Measures . SplitterSize ;
324+ rect . Height -= flat ? 1 : 2 + Measures . SplitterSize ;
324325 else if ( DockState == DockState . DockLeftAutoHide )
325- rect . Width -= 2 + Measures . SplitterSize ;
326+ rect . Width -= flat ? 1 : 2 + Measures . SplitterSize ;
326327
327328 return rect ;
328329 }
@@ -331,24 +332,25 @@ protected virtual Rectangle DisplayingRectangle
331332 protected override void OnLayout ( LayoutEventArgs levent )
332333 {
333334 DockPadding . All = 0 ;
335+ Boolean flat = PluginCore . PluginBase . MainForm . GetThemeColor ( "AutoHideWindowControl.BackColor" ) != Color . Empty ;
334336 if ( DockState == DockState . DockLeftAutoHide )
335337 {
336- DockPadding . Right = 2 ;
338+ DockPadding . Right = flat ? 1 : 2 ;
337339 m_splitter . Dock = DockStyle . Right ;
338340 }
339341 else if ( DockState == DockState . DockRightAutoHide )
340342 {
341- DockPadding . Left = 2 ;
343+ DockPadding . Left = flat ? 1 : 2 ;
342344 m_splitter . Dock = DockStyle . Left ;
343345 }
344346 else if ( DockState == DockState . DockTopAutoHide )
345347 {
346- DockPadding . Bottom = 2 ;
348+ DockPadding . Bottom = flat ? 1 : 2 ;
347349 m_splitter . Dock = DockStyle . Bottom ;
348350 }
349351 else if ( DockState == DockState . DockBottomAutoHide )
350352 {
351- DockPadding . Top = 2 ;
353+ DockPadding . Top = flat ? 1 : 2 ;
352354 m_splitter . Dock = DockStyle . Top ;
353355 }
354356
@@ -374,22 +376,35 @@ protected override void OnPaint(PaintEventArgs e)
374376 {
375377 // Draw the border
376378 Graphics g = e . Graphics ;
377-
379+ Color border = PluginCore . PluginBase . MainForm . GetThemeColor ( "AutoHideWindowControl.BackColor" ) ;
378380 if ( DockState == DockState . DockBottomAutoHide )
379- g . DrawLine ( SystemPens . ControlLightLight , 0 , 1 , ClientRectangle . Right , 1 ) ;
381+ {
382+ if ( border != Color . Empty ) g . DrawLine ( new Pen ( border ) , 0 , 1 , ClientRectangle . Right , 1 ) ;
383+ else g . DrawLine ( SystemPens . ControlLightLight , 0 , 1 , ClientRectangle . Right , 1 ) ;
384+ }
380385 else if ( DockState == DockState . DockRightAutoHide )
381- g . DrawLine ( SystemPens . ControlLightLight , 1 , 0 , 1 , ClientRectangle . Bottom ) ;
386+ {
387+ if ( border != Color . Empty ) g . DrawLine ( new Pen ( border ) , 1 , 0 , 1 , ClientRectangle . Bottom ) ;
388+ else g . DrawLine ( SystemPens . ControlLightLight , 1 , 0 , 1 , ClientRectangle . Bottom ) ;
389+ }
382390 else if ( DockState == DockState . DockTopAutoHide )
383391 {
384- g . DrawLine ( SystemPens . ControlDark , 0 , ClientRectangle . Height - 2 , ClientRectangle . Right , ClientRectangle . Height - 2 ) ;
385- g . DrawLine ( SystemPens . ControlDarkDark , 0 , ClientRectangle . Height - 1 , ClientRectangle . Right , ClientRectangle . Height - 1 ) ;
392+ if ( border != Color . Empty ) g . DrawLine ( new Pen ( border ) , 0 , ClientRectangle . Height - 1 , ClientRectangle . Right , ClientRectangle . Height - 1 ) ;
393+ else
394+ {
395+ g . DrawLine ( SystemPens . ControlDark , 0 , ClientRectangle . Height - 2 , ClientRectangle . Right , ClientRectangle . Height - 2 ) ;
396+ g . DrawLine ( SystemPens . ControlDarkDark , 0 , ClientRectangle . Height - 1 , ClientRectangle . Right , ClientRectangle . Height - 1 ) ;
397+ }
386398 }
387399 else if ( DockState == DockState . DockLeftAutoHide )
388400 {
389- g . DrawLine ( SystemPens . ControlDark , ClientRectangle . Width - 2 , 0 , ClientRectangle . Width - 2 , ClientRectangle . Bottom ) ;
390- g . DrawLine ( SystemPens . ControlDarkDark , ClientRectangle . Width - 1 , 0 , ClientRectangle . Width - 1 , ClientRectangle . Bottom ) ;
401+ if ( border != Color . Empty ) g . DrawLine ( new Pen ( border ) , 0 , ClientRectangle . Height - 1 , ClientRectangle . Right , ClientRectangle . Height - 1 ) ;
402+ else
403+ {
404+ g . DrawLine ( SystemPens . ControlDark , ClientRectangle . Width - 2 , 0 , ClientRectangle . Width - 2 , ClientRectangle . Bottom ) ;
405+ g . DrawLine ( SystemPens . ControlDarkDark , ClientRectangle . Width - 1 , 0 , ClientRectangle . Width - 1 , ClientRectangle . Bottom ) ;
406+ }
391407 }
392-
393408 base . OnPaint ( e ) ;
394409 }
395410
@@ -610,4 +625,5 @@ internal void RefreshAutoHideStrip()
610625 }
611626
612627 }
628+
613629}
0 commit comments