diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2016-09-22 18:27:49 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2016-09-22 20:13:09 +0200 |
commit | 843b9d5dba5098c2676491dda66bed31e57f4329 (patch) | |
tree | 45f5e6fc2d7b448c230a35551ebbe7710e9b492d /vcl/source/window/menubarwindow.cxx | |
parent | 0de3368e4d82d579b8e2550391e142607cbb6aa8 (diff) |
VCL add support for rollover menubars
KDE theme engines can explicitly support rollover menubars via
styleHint( QStyle::SH_MenuBar_MouseTracking ).
So this adds support for this feature to the vcl::Menu.
Change-Id: Ica923ff2d06cfd54e548ba858b3d90f70d9c255a
Diffstat (limited to 'vcl/source/window/menubarwindow.cxx')
-rw-r--r-- | vcl/source/window/menubarwindow.cxx | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx index 812fff476862..6ab3f8b5b84a 100644 --- a/vcl/source/window/menubarwindow.cxx +++ b/vcl/source/window/menubarwindow.cxx @@ -592,7 +592,17 @@ void MenuBarWindow::HighlightItem(vcl::RenderContext& rRenderContext, sal_uInt16 Rectangle aRect = Rectangle(Point(nX, 1), Size(pData->aSz.Width(), GetOutputSizePixel().Height() - 2)); rRenderContext.Push(PushFlags::CLIPREGION); rRenderContext.IntersectClipRegion(aRect); - bool bRollover = nPos != nHighlightedItem; + bool bRollover, bHighlight; + if (!ImplGetSVData()->maNWFData.mbRolloverMenubar) + { + bHighlight = true; + bRollover = nPos != nHighlightedItem; + } + else + { + bRollover = nPos == nRolloveredItem; + bHighlight = nPos == nHighlightedItem; + } if (rRenderContext.IsNativeControlSupported(ControlType::Menubar, ControlPart::MenuItem) && rRenderContext.IsNativeControlSupported(ControlType::Menubar, ControlPart::Entire)) { @@ -630,7 +640,7 @@ void MenuBarWindow::HighlightItem(vcl::RenderContext& rRenderContext, sal_uInt16 rRenderContext.DrawRect(aRect); } rRenderContext.Pop(); - pMenu->ImplPaint(rRenderContext, 0, 0, pData, true/*bHighlight*/, false, bRollover); + pMenu->ImplPaint(rRenderContext, 0, 0, pData, bHighlight, false, bRollover); } return; } @@ -875,6 +885,8 @@ void MenuBarWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle&) pMenu->ImplPaint(rRenderContext, 0); if (nHighlightedItem != ITEMPOS_INVALID) HighlightItem(rRenderContext, nHighlightedItem); + else if (ImplGetSVData()->maNWFData.mbRolloverMenubar && nRolloveredItem != ITEMPOS_INVALID) + HighlightItem(rRenderContext, nRolloveredItem); // in high contrast mode draw a separating line on the lower edge if (!rRenderContext.IsNativeControlSupported( ControlType::Menubar, ControlPart::Entire) && |