[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdelibs/kstyles/plastik
From: Sandro Giessl <sandro () giessl ! com>
Date: 2005-08-22 17:57:15
Message-ID: 1124733435.312750.8608.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 452156 by giessl:
focus highlight for editable lineedits, spinboxes, comboboxes
M +5 -23 plastik.cpp
--- trunk/KDE/kdelibs/kstyles/plastik/plastik.cpp #452155:452156
@@ -1006,10 +1006,7 @@
// SFlags sflags = flags;
// PrimitiveElement pe;
- // TODO: focus highlight
- bool hasFocus = false;
-// if (sw)
-// hasFocus = sw->hasFocus();
+ bool hasFocus = flags & State_HasFocus;
const QColor buttonColor = \
enabled?pal.button().color():pal.background().color();
const QColor inputColor = \
enabled?pal.base().color():pal.background().color(); @@ -1149,8 +1146,7 @@
if (const QStyleOptionComboBox *cb = qstyleoption_cast<const \
QStyleOptionComboBox *>(opt) ) editable = cb->editable;
- // TODO: focus highlight
- bool hasFocus = false;
+ bool hasFocus = flags & State_HasFocus;
const QColor buttonColor = \
enabled?pal.button().color():pal.background().color();
const QColor inputColor = \
enabled?(editable?pal.base().color():pal.button().color() ):pal.background().color(); \
@@ -1383,8 +1379,9 @@ case Generic::Frame:
{
bool isReadOnly = false;
- bool isEnabled = true;
- bool hasFocus = false;
+ bool isEnabled = flags & State_Enabled;
+ bool hasFocus = flags & State_HasFocus;
+
// TODO: fixme...
// // panel is highlighted by default if it has focus, but if we \
have access to the // // widget itself we can try to avoid \
highlighting in case it's readOnly or disabled. @@ -1392,26 +1389,11 @@
// {
// QLineEdit* lineEdit = \
dynamic_cast<QLineEdit*>(p->device()); // isReadOnly = \
lineEdit->isReadOnly();
-// isEnabled = lineEdit->isEnabled();
// }
uint contourFlags = Draw_Left|Draw_Right|Draw_Top|Draw_Bottom|
\
Round_UpperLeft|Round_UpperRight|Round_BottomLeft|Round_BottomRight;
-// TODO: fixme...
-// // HACK!!
-// //
-// // In order to draw nice edges in khtml, we need to paint \
alpha-blended.
-// // On the other hand, we can't paint alpha-blended in normal \
widgets.
-// //
-// // In this place there is no reliable way to detect if we are \
in khtml; the
-// // only thing we know is that khtml buffers its widgets into \
a pixmap. So
-// // when the paint device is a QPixmap, chances are high that \
we are in khtml.
-// // It's possible that this breaks other things, so let's see \
how it works...
-// if (p->device() && dynamic_cast<QPixmap*>(p->device() ) ) {
-// contourFlags += Draw_AlphaBlend;
-// }
-
if ( _inputFocusHighlight && hasFocus && !isReadOnly && \
isEnabled) {
renderContour(p, r, pal.background().color(),
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic