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

List:       kde-usability
Subject:    Re: Minicli Polishing
From:       "Aaron J. Seigo" <aseigo () olympusproject ! org>
Date:       2002-09-16 0:58:23
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sunday 15 September 2002 11:53, Martijn Klingens wrote:
> > there is only one way to find out. i just got a patch for keramik that
> > isn't perfect, but allows one to start to see the effect...
>
> Hmm, can you post the patch here or mail me in private?

courtesy of SadEagle, and the result of about 10 minutes of discussion and 
hacking. i'm using it right now and it seems to work ...

i don't think an line under would work well, since config pages have a bold 
title with a line under them ... and there are some places that a groupbox is 
indeed more appropriate (e.g. in kcalc's main window, the base and angle 
areas)... 

> Hmm, it was code and I originally wanted to make the patch non-intrusive.
> If you think it's fine to convert it to .ui files it will be my greatest
> pleasure, since it's not kdelibs stuff and coded widgets are a royal pain
> in the ass to maintain and to write.

a ui file would be terrific. =)

- -- 
Aaron J. Seigo
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

"Everything should be made as simple as possible, but not simpler"
    - Albert Einstein
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9hSyw1rcusafx20MRApFdAKCGgDy31P1nRhe0YlxJu/2iEvas2gCdEtZZ
8p/uQ2eXRQk0RvhEaxrJQZw=
=ABGZ
-----END PGP SIGNATURE-----

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

? TODO.txt
? changes.diff
Index: keramik.cpp
===================================================================
RCS file: /home/kde/kdelibs/kstyles/keramik/keramik.cpp,v
retrieving revision 1.75
diff -u -3 -p -r1.75 keramik.cpp
--- keramik.cpp	2002/09/15 00:48:04	1.75
+++ keramik.cpp	2002/09/15 05:00:21
@@ -36,6 +36,7 @@
 #include <qcombobox.h>
 #include <qdrawutil.h>
 #include <qframe.h>
+#include <qgroupbox.h>
 #include <qheader.h>
 #include <qintdict.h>
 #include <qlistbox.h>
@@ -281,11 +282,14 @@ void KeramikStyle::polish(QWidget* widge
 		listbox->setLineWidth( 4 );
 		listbox->setBackgroundMode( NoBackground );
 		widget->installEventFilter( this );
-
 	} else if (widget->inherits("QToolBarExtensionWidget")) {
 		widget->installEventFilter(this);
 		//widget->setBackgroundMode( NoBackground );
  	}
+	else if ( widget->inherits("QGroupBox") )
+	{
+		widget->installEventFilter(this);
+	}
 	else if ( !qstrcmp( widget->name(), kdeToolbarWidget ) ) {
 		widget->setBackgroundMode( NoBackground );
 		widget->installEventFilter(this);
@@ -739,6 +743,8 @@ void KeramikStyle::drawPrimitive( Primit
 
 			// GENERAL PANELS
 			// -------------------------------------------------------------------
+		case PE_GroupBoxFrame:
+			break; //Very fancy !
 		case PE_Panel:
 		{
 			if (kickerMode)
@@ -2186,7 +2192,6 @@ QRect KeramikStyle::querySubControlMetri
 	return KStyle::querySubControlMetrics( control, widget, subcontrol, opt );
 }
 
-
 #include <config.h>
 
 #ifdef HAVE_X11_EXTENSIONS_SHAPE_H
@@ -2195,6 +2200,15 @@ QRect KeramikStyle::querySubControlMetri
 #include <X11/extensions/shape.h>
 #endif
 
+class KeramikCallDrawContents: public QFrame
+{
+public:
+	/*static*/ void callDrawContents(QPainter* p)
+	{
+		drawContents(p);
+	}
+};
+
 bool KeramikStyle::eventFilter( QObject* object, QEvent* event )
 {
 	if (KStyle::eventFilter( object, event ))
@@ -2255,6 +2269,22 @@ bool KeramikStyle::eventFilter( QObject*
 			  rects, 5, ShapeSet, YXSorted);
 	}
 #endif
+	else if ( event->type() == QEvent::Paint && object->inherits("QGroupBox") )
+	{
+		//### Quick hack, this is *far* from correct.
+		QGroupBox* box = static_cast<QGroupBox*>(object);
+		QPainter p(box);
+		QFont f = p.font();
+		f.setBold(true);
+		p.setFont(f);
+		drawItem(&p, box->rect(), ShowPrefix | AlignAuto | AlignTop, 
+					box->colorGroup(), box->isEnabled(), 0, box->title());
+		
+		//###Mega hack!
+		((KeramikCallDrawContents*)box)->callDrawContents(&p);
+		p.end();
+		return true; //Override the event.. 
+	}
 	else if ( event->type() == QEvent::Paint && object->inherits("QListBox") )
 	{
 		static bool recursion = false;
Index: keramik.h
===================================================================
RCS file: /home/kde/kdelibs/kstyles/keramik/keramik.h,v
retrieving revision 1.16
diff -u -3 -p -r1.16 keramik.h
--- keramik.h	2002/09/15 00:48:04	1.16
+++ keramik.h	2002/09/15 05:00:21
@@ -114,10 +114,6 @@ public:
 	                              const QWidget* widget,
 	                              SubControl subcontrol,
 	                              const QStyleOption& opt = QStyleOption::Default ) const;
-	// Fix Qt3's wacky image positions
-/*	QPixmap stylePixmap( StylePixmap stylepixmap,
-					const QWidget* widget = 0,
-					const QStyleOption& = QStyleOption::Default ) const;*/
 
 protected:
 	mutable bool maskMode; //Ugly round trip flag to permit masking with little code;

_______________________________________________
kde-usability mailing list
kde-usability@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-usability

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

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