public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Andreas HAttel (dilfridge)" <dilfridge@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] gentoo-x86 commit in kde-base/kdelibs/files: kdelibs-4.7.1-clearbutton.patch
Date: Fri, 23 Sep 2011 21:32:05 +0000 (UTC)	[thread overview]
Message-ID: <20110923213205.9F57F2004C@flycatcher.gentoo.org> (raw)

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);
             }
         }
     }






                 reply	other threads:[~2011-09-23 21:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110923213205.9F57F2004C@flycatcher.gentoo.org \
    --to=dilfridge@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox