summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-06-30 09:48:39 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-06-30 12:18:10 +0100
commit88b336b86585508ee947a97334cb184f5b0671e0 (patch)
tree9c51b43f58de6298a355195f16a63558609c3f33 /vcl/source
parent43f21855d2da0ad446511f3b09c5d0898410668a (diff)
gtk3: draw disabled menubars entries with disabled text color
Change-Id: I9188c6071f62d13a688c1eb6b14b1ac3f7dc77d4 (cherry picked from commit 67d0aee921ae7c10bfd823097db73d7f125faa3a)
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/window/menu.cxx9
-rw-r--r--vcl/source/window/menubarwindow.cxx4
2 files changed, 9 insertions, 4 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 7acd139a3312..8f2a93fc6043 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -1878,7 +1878,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext,
// contained. The application itself should check for this!
// Otherwise it could happen entries are disabled due to
// asynchronous loading
- if (!pData->bEnabled)
+ if (!pData->bEnabled || !pWindow->IsEnabled())
{
nTextStyle |= DrawTextFlags::Disable;
nSymbolStyle |= DrawSymbolFlags::Disable;
@@ -1892,7 +1892,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext,
if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_MENU_SEPARATOR))
{
ControlState nState = ControlState::NONE;
- if (pData->bEnabled)
+ if (pData->bEnabled && !pWindow->IsEnabled())
nState |= ControlState::ENABLED;
if (bHighlighted)
nState |= ControlState::SELECTED;
@@ -1948,7 +1948,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext,
if (pData->bChecked)
nState |= ControlState::PRESSED;
- if (pData->bEnabled)
+ if (pData->bEnabled && !pWindow->IsEnabled())
nState |= ControlState::ENABLED;
if (bHighlighted)
@@ -2019,6 +2019,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext,
aTmpPos.Y() = aPos.Y();
aTmpPos.Y() += nTextOffsetY;
DrawTextFlags nStyle = nTextStyle | DrawTextFlags::Mnemonic;
+
if (pData->bIsTemporary)
nStyle |= DrawTextFlags::Disable;
MetricVector* pVector = bLayout ? &mpLayoutData->m_aUnicodeBoundRects : NULL;
@@ -2088,7 +2089,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext,
aSpacing = nOuterSpaceX;
}
- if (pData->bEnabled)
+ if (pData->bEnabled && !pWindow->IsEnabled())
nState |= ControlState::ENABLED;
if (bHighlighted)
nState |= ControlState::SELECTED;
diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx
index 9d44a9edaf5f..fb542a474b12 100644
--- a/vcl/source/window/menubarwindow.cxx
+++ b/vcl/source/window/menubarwindow.cxx
@@ -993,6 +993,10 @@ void MenuBarWindow::StateChanged( StateChangedType nType )
ApplySettings(*this);
Invalidate();
}
+ else if (nType == StateChangedType::Enable)
+ {
+ Invalidate();
+ }
else if(pMenu)
{
pMenu->ImplKillLayoutData();