[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    [PATCH] KFontRequester and KColorButton
From:       Peter Hedlund <peter () peterandlinda ! com>
Date:       2004-12-10 2:22:19
Message-ID: 200412091822.19764.peter () peterandlinda ! com
[Download RAW message or body]

Hi all,

The attached patch addresses two issues:

1. By adding a call to setFocusProxy(m_button) in the constructor of 
KFontRequester, the widget behaves properly in the tab order of a dialog.

2. Currently KColorButton eats all keyboard input except Copy and Paste. With 
this patch all other keyboard input is propagated back to QPushButton. That 
way the color button can be activated with the space bar and other buttons 
(e.g. Cancel and OK) in a dialog behave properly when a color button has the 
focus.

OK to commit?

Thanks,
Peter

["kdeui.diff" (text/x-diff)]

Index: kcolorbutton.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kcolorbutton.cpp,v
retrieving revision 1.37
diff -U3 -r1.37 kcolorbutton.cpp
--- kcolorbutton.cpp	21 Aug 2004 14:54:03 -0000	1.37
+++ kcolorbutton.cpp	10 Dec 2004 02:10:22 -0000
@@ -150,6 +150,8 @@
     KColorDrag::decode( QApplication::clipboard()->data( QClipboard::Clipboard ), color );
     setColor( color );
   }
+  else
+    QPushButton::keyPressEvent(e);
 }
 
 void KColorButton::mousePressEvent( QMouseEvent *e)
Index: kfontrequester.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kfontrequester.cpp,v
retrieving revision 1.4
diff -U3 -r1.4 kfontrequester.cpp
--- kfontrequester.cpp	8 Jun 2003 00:54:00 -0000	1.4
+++ kfontrequester.cpp	10 Dec 2004 02:10:24 -0000
@@ -38,6 +38,7 @@
   m_button = new QPushButton( i18n( "Choose..." ), this, "m_button" );
 
   m_sampleLabel->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
+  setFocusProxy(m_button);
 
   layout->addWidget( m_sampleLabel, 1 );
   layout->addWidget( m_button );


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic