diff options
author | Andreas K. Hüttel <dilfridge@gentoo.org> | 2011-09-23 21:32:05 +0000 |
---|---|---|
committer | Andreas K. Hüttel <dilfridge@gentoo.org> | 2011-09-23 21:32:05 +0000 |
commit | 5ddc657d05d3afcada3b92ea114be6035a7d2251 (patch) | |
tree | 0d4a6a83d87c6c6cf8419649be2c523b7c7e56ff /kde-base/kdelibs/files | |
parent | Remove <herd>no-herd</herd>. (diff) | |
download | gentoo-2-5ddc657d05d3afcada3b92ea114be6035a7d2251.tar.gz gentoo-2-5ddc657d05d3afcada3b92ea114be6035a7d2251.tar.bz2 gentoo-2-5ddc657d05d3afcada3b92ea114be6035a7d2251.zip |
Beautifying-the-clearbutton revbump
(Portage version: 2.1.10.19/cvs/Linux x86_64)
Diffstat (limited to 'kde-base/kdelibs/files')
-rw-r--r-- | kde-base/kdelibs/files/kdelibs-4.7.1-clearbutton.patch | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/kde-base/kdelibs/files/kdelibs-4.7.1-clearbutton.patch b/kde-base/kdelibs/files/kdelibs-4.7.1-clearbutton.patch new file mode 100644 index 000000000000..c177b28b4c25 --- /dev/null +++ b/kde-base/kdelibs/files/kdelibs-4.7.1-clearbutton.patch @@ -0,0 +1,82 @@ +commit 07d20a558da67fb9f849e2b20c52cf275ea01794 +Author: Andrea Iacovitti <aiacovitti@libero.it> +Date: Sat Sep 17 10:12:04 2011 +0200 + + -Do not set WA_OpaquePaintEvent attribute for line edit clearButton + (should fix the not transparent background bug) + -Optimize a bit the code to enable/disable it + + BUG: 230024 + CCBUG: 280226 + FIXED-IN: 4.7.2 + +diff --git a/kdeui/widgets/klineedit.cpp b/kdeui/widgets/klineedit.cpp +index 715e182..c919b99 100644 +--- a/kdeui/widgets/klineedit.cpp ++++ b/kdeui/widgets/klineedit.cpp +@@ -291,6 +291,7 @@ void KLineEdit::setClearButtonShown(bool show) + } + + d->clearButton = new KLineEditButton(this); ++ d->clearButton->setObjectName("KLineEditButton"); + d->clearButton->setCursor( Qt::ArrowCursor ); + d->clearButton->setToolTip( i18nc( "@action:button Clear current text in the line edit", "Clear text" ) ); + +diff --git a/khtml/khtmlview.cpp b/khtml/khtmlview.cpp +index 1db9b1a..28dbac3 100644 +--- a/khtml/khtmlview.cpp ++++ b/khtml/khtmlview.cpp +@@ -1363,7 +1363,7 @@ void KHTMLView::mouseMoveEvent( QMouseEvent * _mouse ) + if (kw && kw->m_kwp->isRedirected()) + setCursor = false; + else if (QLineEdit* le = qobject_cast<QLineEdit*>(rw->widget())) { +- QList<QWidget*> wl = qFindChildren<QWidget *>( le, "KHTMLLineEditButton" ); ++ QList<QWidget*> wl = qFindChildren<QWidget *>( le, "KLineEditButton" ); + // force arrow cursor above lineedit clear button + foreach (QWidget*w, wl) { + if (w->underMouse()) { +@@ -1942,7 +1942,10 @@ static void handleWidget(QWidget* w, KHTMLView* view, bool recurse=true) + w->setAttribute( Qt::WA_NoSystemBackground ); + + w->setAttribute(Qt::WA_WState_InPaintEvent); +- w->setAttribute(Qt::WA_OpaquePaintEvent); ++ ++ if (!(w->objectName() == "KLineEditButton")) ++ w->setAttribute(Qt::WA_OpaquePaintEvent); ++ + w->installEventFilter(view); + + if (!recurse) +diff --git a/khtml/rendering/render_form.cpp b/khtml/rendering/render_form.cpp +index 845db1a..3302920 100644 +--- a/khtml/rendering/render_form.cpp ++++ b/khtml/rendering/render_form.cpp +@@ -1044,20 +1044,21 @@ void RenderLineEdit::setStyle(RenderStyle* _style) + RenderFormElement::setStyle( _style ); + + widget()->setAlignment(textAlignment()); ++ + bool showClearButton = (!shouldDisableNativeBorders() && !_style->hasBackgroundImage()); +- widget()->setClearButtonShown( showClearButton ); +- if (showClearButton) { ++ ++ if (!showClearButton && widget()->isClearButtonShown()) { ++ widget()->setClearButtonShown(false); ++ } ++ else if (showClearButton && !widget()->isClearButtonShown()) { ++ widget()->setClearButtonShown(true); + QObjectList children = widget()->children(); + foreach (QObject* object, children) { + QWidget *w = qobject_cast<QWidget*>(object); +- if (w && !w->isWindow()) { ++ if (w && !w->isWindow() && (w->objectName() == "KLineEditButton")) { + // this duplicates KHTMLView's handleWidget but this widget + // is created on demand, so it might not be here at ChildPolished time +- w->setObjectName("KHTMLLineEditButton"); + w->installEventFilter(view()); +- w->setAttribute(Qt::WA_NoSystemBackground); +- w->setAttribute(Qt::WA_WState_InPaintEvent); +- w->setAttribute(Qt::WA_OpaquePaintEvent); + } + } + } |