rpms/qt/devel qt-3.3.3-gtkstyle.patch,NONE,1.1 qt.spec,1.66,1.67

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Wed Mar 23 14:07:58 UTC 2005


Update of /cvs/dist/rpms/qt/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv17205

Modified Files:
	qt.spec 
Added Files:
	qt-3.3.3-gtkstyle.patch 
Log Message:
add GtkStyle patch from Peter Backlund #141125


qt-3.3.3-gtkstyle.patch:
 kernel/qnamespace.h    |    6 ++++--
 widgets/qmenubar.cpp   |   26 ++++++++++++++++++++++----
 widgets/qpopupmenu.cpp |   16 ++++++++++++++--
 3 files changed, 40 insertions(+), 8 deletions(-)

--- NEW FILE qt-3.3.3-gtkstyle.patch ---
--- qt-x11-free-3.3.3.orig/src/widgets/qmenubar.cpp	2004-08-05 16:42:21.000000000 +0200
+++ qt-x11-free-3.3.3/src/widgets/qmenubar.cpp	2004-12-03 17:26:43.000000000 +0100
@@ -228,6 +228,10 @@
 static const int motifItemHMargin	= 5;	// menu item hor text margin
 static const int motifItemVMargin	= 4;	// menu item ver text margin
 
+// The others are 0
+static const int gtkItemHMargin = 8;
+static const int gtkItemVMargin = 8;
+
 /*
 
 +-----------------------------
@@ -292,7 +296,14 @@
     setFrameStyle( QFrame::MenuBarPanel | QFrame::Raised );
 
     QFontMetrics fm = fontMetrics();
-    int h = 2*motifBarVMargin + fm.height() + motifItemVMargin + 2*frameWidth() + 2*motifItemFrame;
+
+    int h;
+    int gs = style().styleHint(QStyle::SH_GUIStyle);
+    if (gs == GtkStyle) {
+        h = fm.height() + gtkItemVMargin;
+    } else {
+        h = 2*motifBarVMargin + fm.height() + motifItemVMargin + 2*frameWidth() + 2*motifItemFrame;
+    }
 
     setGeometry( 0, 0, width(), h );
 
@@ -944,12 +955,19 @@
 	    h = QMAX( mi->pixmap()->height() + 4, QApplication::globalStrut().height() );
 	} else if ( !mi->text().isNull() ) {	// text item
 	    QString s = mi->text();
-	    w = fm.boundingRect( s ).width()
-		+ 2*motifItemHMargin;
+        if ( gs == GtkStyle ) {
+            w = fm.boundingRect( s ).width() + 2*gtkItemHMargin;
+        } else {
+	        w = fm.boundingRect( s ).width() + 2*motifItemHMargin;
+        }
 	    w -= s.contains('&')*fm.width('&');
 	    w += s.contains("&&")*fm.width('&');
 	    w = QMAX( w, QApplication::globalStrut().width() );
-	    h = QMAX( fm.height() + motifItemVMargin, QApplication::globalStrut().height() );
+        if (gs == GtkStyle ) {
+            h = QMAX( fm.height() + gtkItemVMargin, QApplication::globalStrut().height() );
+        } else {
+	        h = QMAX( fm.height() + motifItemVMargin, QApplication::globalStrut().height() );
+        }
 	} else if ( mi->isSeparator() ) {	// separator item
 	    if ( style().styleHint(QStyle::SH_GUIStyle) == MotifStyle )
 		separator = i; //### only motif?
--- qt-x11-free-3.3.3.orig/src/widgets/qpopupmenu.cpp	2004-08-05 16:42:21.000000000 +0200
+++ qt-x11-free-3.3.3/src/widgets/qpopupmenu.cpp	2004-12-03 17:43:50.000000000 +0100
@@ -65,6 +65,8 @@
 static const int motifArrowHMargin	= 6;	// arrow horizontal margin
 static const int motifArrowVMargin	= 2;	// arrow vertical margin
 
+static const int gtkArrowHMargin	= 0;	// arrow horizontal margin
+static const int gtkArrowVMargin	= 0;	// arrow vertical margin
 
 /*
 
@@ -2289,8 +2291,18 @@
     QRect r( itemGeometry( actItem ) );
     QPoint p;
     QSize ps = popup->sizeHint();
+    // GUI Style
+    int gs = style().styleHint(QStyle::SH_GUIStyle);
+    int arrowHMargin, arrowVMargin;
+    if (gs == GtkStyle) {
+        arrowHMargin = gtkArrowHMargin;
+        arrowVMargin = gtkArrowVMargin;
+    } else {
+        arrowHMargin = motifArrowHMargin;
+        arrowVMargin = motifArrowVMargin;
+    }
     if( QApplication::reverseLayout() ) {
-	p = QPoint( r.left() + motifArrowHMargin - ps.width(), r.top() + motifArrowVMargin );
+	p = QPoint( r.left() + arrowHMargin - ps.width(), r.top() + arrowVMargin );
 	p = mapToGlobal( p );
 
 	bool right = FALSE;
@@ -2303,7 +2315,7 @@
 	if ( right )
 	    p.setX( mapToGlobal( r.topRight() ).x() );
     } else {
-	p = QPoint( r.right() - motifArrowHMargin, r.top() + motifArrowVMargin );
+	p = QPoint( r.right() - arrowHMargin, r.top() + arrowVMargin );
 	p = mapToGlobal( p );
 
 	bool left = FALSE;
--- qt-x11-free-3.3.3.orig/src/kernel/qnamespace.h	2004-08-05 16:42:10.000000000 +0200
+++ qt-x11-free-3.3.3/src/kernel/qnamespace.h	2004-11-29 22:22:26.000000000 +0100
@@ -294,7 +294,8 @@
 #ifdef QT_NO_COMPAT
     enum GUIStyle {
 	WindowsStyle = 1,     // ### Qt 4.0: either remove the obsolete enums or clean up compat vs.
-	MotifStyle = 4        // ### QT_NO_COMPAT by reordering or combination into one enum.
+	MotifStyle = 4,       // ### QT_NO_COMPAT by reordering or combination into one enum.
+    GtkStyle = 6          // Gtk compability mode
     };
 #else
     enum GUIStyle {
@@ -302,7 +303,8 @@
 	WindowsStyle,
 	Win3Style, // OBSOLETE
 	PMStyle, // OBSOLETE
-	MotifStyle
+	MotifStyle,
+    GtkStyle = 6          // Gtk compability mode
     };
 #endif
 


Index: qt.spec
===================================================================
RCS file: /cvs/dist/rpms/qt/devel/qt.spec,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -r1.66 -r1.67
--- qt.spec	4 Mar 2005 18:18:40 -0000	1.66
+++ qt.spec	23 Mar 2005 14:07:56 -0000	1.67
@@ -82,11 +82,11 @@
 Summary: The shared library for the Qt GUI toolkit.
 Name: qt
 Version: %{ver}
-Release: 9
+Release: 10
 Epoch: 1
 License: GPL/QPL
 Group: System Environment/Libraries
-Buildroot: %{_tmppath}/%{name}-root
+Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root
 Url: http://www.troll.no
 Source: ftp://ftp.troll.no/qt/source/qt-x11-free-%{version}.tar.bz2
 Source1: qtrc
@@ -103,6 +103,7 @@
 Patch16: qt-x11-free-3.3.4-fullscreen.patch
 Patch17: qt-x11-free-3.3.4-gcc4.patch
 Patch18: qt-x11-free-3.3.4-gcc4-buildkey.patch
+Patch19: qt-3.3.3-gtkstyle.patch 
 
 # immodule patches
 Patch50: qt-x11-immodule-unified-qt3.3.4-20041203.diff.bz2
@@ -304,6 +305,7 @@
 %patch16 -p1 -b .size
 %patch17 -p1 -b .gcc4
 %patch18 -p1 -b .key
+%patch19 -p1 -b .gtk
 
 %if %{immodule}
 %patch50 -p1
@@ -699,6 +701,9 @@
 
 
 %changelog
+* Wed Mar 23 2005 Than Ngo <than at redhat.com> 1:3.3.4-10
+- add GtkStyle patch from Peter Backlund #141125
+
 * Fri Mar 04 2005 Than Ngo <than at redhat.com> 1:3.3.4-9
 - fix buildkey issue with gcc-4
 




More information about the fedora-cvs-commits mailing list