[Webkit-unassigned] [Bug 116804] HTML Form Controls Rendered as if they are disabled in QT5 with Windows Vista application Style
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue May 28 17:31:08 PDT 2013
https://bugs.webkit.org/show_bug.cgi?id=116804
--- Comment #2 from Stephen <sfcheng at gmail.com> 2013-05-28 17:29:40 PST ---
After some digging, I found the cause of the problem inside the file RenderThemeQStyle.cpp near the following code:
ControlPart RenderThemeQStyle::initializeCommonQStyleOptions(QStyleFacadeOption &option, RenderObject* o) const
{
// Default bits: no focus, no mouse over
option.state &= ~(QStyleFacade::State_HasFocus | QStyleFacade::State_MouseOver);
if (isReadOnlyControl(o))
// Readonly is supported on textfields.
option.state |= QStyleFacade::State_ReadOnly;
option.direction = Qt::LeftToRight;
if (isHovered(o))
option.state |= QStyleFacade::State_MouseOver;
setPaletteFromPageClientIfExists(option.palette);
if (!isEnabled(o)) {
option.palette.setCurrentColorGroup(QPalette::Disabled);
option.state &= ~QStyleFacade::State_Enabled;
}
...
}
During the initialization of the style options, the State_Enabled bit is removed if the control is disabled. However, in the constructor of the option, the state is initialized as State_None, which means disabled. We need either initialize the state as State_Enabled or add a "else" clause after the last "if" as shown below:
if (!isEnabled(o)) {
option.palette.setCurrentColorGroup(QPalette::Disabled);
option.state &= ~QStyleFacade::State_Enabled;
}
else
{
option.state |= QStyleFacade::State_Enabled;
}
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list