Blame SOURCES/qt-3.3.3-gtkstyle.patch

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