public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in kde-base/kdelibs/files: kdelibs-4.7.1-clearbutton.patch
@ 2011-09-23 21:32 Andreas HAttel (dilfridge)
  0 siblings, 0 replies; only message in thread
From: Andreas HAttel (dilfridge) @ 2011-09-23 21:32 UTC (permalink / raw
  To: gentoo-commits

dilfridge    11/09/23 21:32:05

  Added:                kdelibs-4.7.1-clearbutton.patch
  Log:
  Beautifying-the-clearbutton revbump
  
  (Portage version: 2.1.10.19/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  kde-base/kdelibs/files/kdelibs-4.7.1-clearbutton.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/kde-base/kdelibs/files/kdelibs-4.7.1-clearbutton.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/kde-base/kdelibs/files/kdelibs-4.7.1-clearbutton.patch?rev=1.1&content-type=text/plain

Index: kdelibs-4.7.1-clearbutton.patch
===================================================================
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);
             }
         }
     }






^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-09-23 21:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-23 21:32 [gentoo-commits] gentoo-x86 commit in kde-base/kdelibs/files: kdelibs-4.7.1-clearbutton.patch Andreas HAttel (dilfridge)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox