Improve focus and keyboard interaction with projectselector

This kills the event filter since it is not really neccessary.
Most combo boxes should be disabled by default now. I Removed
redundant focus widgets from the keyboard chain and I
indicate that the list has focus by saturation.
This commit is contained in:
Jens Bache-Wiig
2010-03-09 11:14:19 +01:00
parent 1b86bc50c1
commit 76fe997a45
3 changed files with 14 additions and 63 deletions

View File

@@ -643,6 +643,7 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
case CE_ComboBoxLabel:
if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(option)) {
if (panelWidget(widget)) {
painter->save();
QRect editRect = subControlRect(CC_ComboBox, cb, SC_ComboBoxEditField, widget);
QPalette customPal = cb->palette;
@@ -671,13 +672,18 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
customPal.setBrush(QPalette::All, QPalette::ButtonText, QColor(0, 0, 0, 70));
QString text = option->fontMetrics.elidedText(cb->currentText, Qt::ElideRight, editRect.width());
drawItemText(painter, editRect.translated(0, 1),
visualAlignment(option->direction, Qt::AlignLeft | Qt::AlignVCenter),
customPal, cb->state & State_Enabled, text, QPalette::ButtonText);
if ((option->state & State_Enabled))
drawItemText(painter, editRect.translated(0, 1),
visualAlignment(option->direction, Qt::AlignLeft | Qt::AlignVCenter),
customPal, cb->state & State_Enabled, text, QPalette::ButtonText);
else
painter->setOpacity(0.8);
customPal.setBrush(QPalette::All, QPalette::ButtonText, Utils::StyleHelper::panelTextColor());
drawItemText(painter, editRect,
visualAlignment(option->direction, Qt::AlignLeft | Qt::AlignVCenter),
customPal, cb->state & State_Enabled, text, QPalette::ButtonText);
painter->restore();
} else {
QProxyStyle::drawControl(element, option, painter, widget);
}