[Pkg-kde-commits] rev 1327 - in people/chrsmrtn/qt-x11-free/debian: . patches

Christopher Martin chrsmrtn-guest at costa.debian.org
Tue Jul 19 04:10:54 UTC 2005


Author: chrsmrtn-guest
Date: 2005-07-19 04:10:53 +0000 (Tue, 19 Jul 2005)
New Revision: 1327

Added:
   people/chrsmrtn/qt-x11-free/debian/patches/32_gtkstyle.patch
Modified:
   people/chrsmrtn/qt-x11-free/debian/changelog
   people/chrsmrtn/qt-x11-free/debian/patches/00list
Log:
gtkstyle patch, as requested.


Modified: people/chrsmrtn/qt-x11-free/debian/changelog
===================================================================
--- people/chrsmrtn/qt-x11-free/debian/changelog	2005-07-19 01:07:11 UTC (rev 1326)
+++ people/chrsmrtn/qt-x11-free/debian/changelog	2005-07-19 04:10:53 UTC (rev 1327)
@@ -29,6 +29,9 @@
   * Apply packaging patches from Brian Nelson to allow Qt3 to co-exist
     with Qt4 packages. (Closes: #306879)
 
+  * Add the gtkstyle patch, in order to better support Bluecurve.
+    (Closes: #316108)
+
   * Bump libfreetype6-dev build-depends to >= 2.1.10 to work around API
     breakage.
 

Modified: people/chrsmrtn/qt-x11-free/debian/patches/00list
===================================================================
--- people/chrsmrtn/qt-x11-free/debian/patches/00list	2005-07-19 01:07:11 UTC (rev 1326)
+++ people/chrsmrtn/qt-x11-free/debian/patches/00list	2005-07-19 04:10:53 UTC (rev 1327)
@@ -18,3 +18,4 @@
 28_qtc_png-gamma-fix.dpatch
 30_gcc4_build.dpatch
 31_gcc4_buildkey.dpatch
+32_gtkstyle.patch

Added: people/chrsmrtn/qt-x11-free/debian/patches/32_gtkstyle.patch
===================================================================
--- people/chrsmrtn/qt-x11-free/debian/patches/32_gtkstyle.patch	2005-07-19 01:07:11 UTC (rev 1326)
+++ people/chrsmrtn/qt-x11-free/debian/patches/32_gtkstyle.patch	2005-07-19 04:10:53 UTC (rev 1327)
@@ -0,0 +1,135 @@
+#! /bin/sh -e
+
+if [ $# -lt 1 ]; then
+    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+    exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+    -patch) patch -p1 ${patch_opts} < $0;;
+    -unpatch) patch -R -p1 ${patch_opts} < $0;;
+    *)
+        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+        exit 1;;
+esac
+
+exit 0
+
+ at DPATCH@
+--- qt.orig/src/widgets/qmenubar.cpp
++++ qt.patched/src/widgets/qmenubar.cpp
+@@ -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.orig/src/widgets/qpopupmenu.cpp
++++ qt.patched/src/widgets/qpopupmenu.cpp
+@@ -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
+ 
+ /*
+ 
+@@ -2290,8 +2292,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;
+@@ -2304,7 +2316,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.orig/src/kernel/qnamespace.h
++++ qt.patched/src/kernel/qnamespace.h
+@@ -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
+ 




More information about the Pkg-kde-commits mailing list