Kaydet (Commit) 94a4d899 authored tarafından Caolán McNamara's avatar Caolán McNamara Kaydeden (comit) Andras Timar

gtk3: draw disabled menubars entries with disabled text color

Change-Id: I9188c6071f62d13a688c1eb6b14b1ac3f7dc77d4
(cherry picked from commit 67d0aee9)
üst 89216357
...@@ -1878,7 +1878,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, ...@@ -1878,7 +1878,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext,
// contained. The application itself should check for this! // contained. The application itself should check for this!
// Otherwise it could happen entries are disabled due to // Otherwise it could happen entries are disabled due to
// asynchronous loading // asynchronous loading
if (!pData->bEnabled) if (!pData->bEnabled || !pWindow->IsEnabled())
{ {
nTextStyle |= DrawTextFlags::Disable; nTextStyle |= DrawTextFlags::Disable;
nSymbolStyle |= DrawSymbolFlags::Disable; nSymbolStyle |= DrawSymbolFlags::Disable;
...@@ -1892,7 +1892,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, ...@@ -1892,7 +1892,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext,
if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_MENU_SEPARATOR)) if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_MENU_SEPARATOR))
{ {
ControlState nState = ControlState::NONE; ControlState nState = ControlState::NONE;
if (pData->bEnabled) if (pData->bEnabled && !pWindow->IsEnabled())
nState |= ControlState::ENABLED; nState |= ControlState::ENABLED;
if (bHighlighted) if (bHighlighted)
nState |= ControlState::SELECTED; nState |= ControlState::SELECTED;
...@@ -1948,7 +1948,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, ...@@ -1948,7 +1948,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext,
if (pData->bChecked) if (pData->bChecked)
nState |= ControlState::PRESSED; nState |= ControlState::PRESSED;
if (pData->bEnabled) if (pData->bEnabled && !pWindow->IsEnabled())
nState |= ControlState::ENABLED; nState |= ControlState::ENABLED;
if (bHighlighted) if (bHighlighted)
...@@ -2019,6 +2019,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, ...@@ -2019,6 +2019,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext,
aTmpPos.Y() = aPos.Y(); aTmpPos.Y() = aPos.Y();
aTmpPos.Y() += nTextOffsetY; aTmpPos.Y() += nTextOffsetY;
DrawTextFlags nStyle = nTextStyle | DrawTextFlags::Mnemonic; DrawTextFlags nStyle = nTextStyle | DrawTextFlags::Mnemonic;
if (pData->bIsTemporary) if (pData->bIsTemporary)
nStyle |= DrawTextFlags::Disable; nStyle |= DrawTextFlags::Disable;
MetricVector* pVector = bLayout ? &mpLayoutData->m_aUnicodeBoundRects : NULL; MetricVector* pVector = bLayout ? &mpLayoutData->m_aUnicodeBoundRects : NULL;
...@@ -2088,7 +2089,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, ...@@ -2088,7 +2089,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext,
aSpacing = nOuterSpaceX; aSpacing = nOuterSpaceX;
} }
if (pData->bEnabled) if (pData->bEnabled && !pWindow->IsEnabled())
nState |= ControlState::ENABLED; nState |= ControlState::ENABLED;
if (bHighlighted) if (bHighlighted)
nState |= ControlState::SELECTED; nState |= ControlState::SELECTED;
......
...@@ -993,6 +993,10 @@ void MenuBarWindow::StateChanged( StateChangedType nType ) ...@@ -993,6 +993,10 @@ void MenuBarWindow::StateChanged( StateChangedType nType )
ApplySettings(*this); ApplySettings(*this);
Invalidate(); Invalidate();
} }
else if (nType == StateChangedType::Enable)
{
Invalidate();
}
else if(pMenu) else if(pMenu)
{ {
pMenu->ImplKillLayoutData(); pMenu->ImplKillLayoutData();
......
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