From 0ee1f62b1333c5bccc4cba4db8afa50e80bd4fc2 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 19 Oct 2011 04:31:26 +0000 Subject: Fix additional GTK theme engine problems git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/gtk-qt-engine@1259599 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/qt_qt_wrapper.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'src/qt_qt_wrapper.cpp') diff --git a/src/qt_qt_wrapper.cpp b/src/qt_qt_wrapper.cpp index 3560df1..6ada4ed 100644 --- a/src/qt_qt_wrapper.cpp +++ b/src/qt_qt_wrapper.cpp @@ -1018,7 +1018,7 @@ void drawCheckBox(GdkWindow* window, GtkStyle* style, GtkStateType state, int ch { if (!gtkQtEnable) return; - + int realH = tqApp->tqstyle().tqpixelMetric(TQStyle::PM_IndicatorHeight); int realW = tqApp->tqstyle().tqpixelMetric(TQStyle::PM_IndicatorWidth); @@ -1039,7 +1039,7 @@ void drawCheckBox(GdkWindow* window, GtkStyle* style, GtkStateType state, int ch // We cheat, and draw them over the expected area. int xOffset = (realW - w) / 2; int yOffset = (realH - h) / 2; - + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x - xOffset, y - yOffset, realW, realH); g_object_unref(pix); @@ -1049,10 +1049,10 @@ void drawMenuCheck(GdkWindow* window, GtkStyle* style, GtkStateType state, int x { if (!gtkQtEnable) return; - + TQCheckBox checkbox(0); - - /* A previous version of the function followed the sizehints exclusively + + /* A previous version of the function followed the sizehints exclusively Now follow w and h provided by GTK, but if the checkmark is too big we might have to scale it */ /* int w1 = checkbox.tqsizeHint().width(); @@ -1074,7 +1074,7 @@ void drawMenuCheck(GdkWindow* window, GtkStyle* style, GtkStateType state, int x else painter.fillRect(0, 0, w, h, tqApp->tqpalette().active().brush(TQColorGroup::Background)); tqApp->tqstyle().tqdrawPrimitive(TQStyle::PE_CheckMark, &painter, TQRect(0, 0, w, h), tqApp->tqpalette().active(), sflags); - + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h); g_object_unref(pix); @@ -1084,7 +1084,7 @@ void drawRadioButton(GdkWindow* window, GtkStyle* style, GtkStateType state, int { if (!gtkQtEnable) return; - + int realH = tqApp->tqstyle().tqpixelMetric(TQStyle::PM_IndicatorHeight); int realW = tqApp->tqstyle().tqpixelMetric(TQStyle::PM_IndicatorWidth); @@ -1363,7 +1363,7 @@ void drawMenuItem(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, { if (!gtkQtEnable) return; - + if ((w < 1) || (h < 1)) return; @@ -1372,7 +1372,7 @@ void drawMenuItem(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, TQPopupMenu pm; TQMenuData md; TQMenuItem* mi = md.findItem(md.insertItem("")); - + TQStyleOption opt(mi, 16, 16); TQStyle::SFlags sflags = TQStyle::Style_Active | TQStyle::Style_Enabled; @@ -2091,7 +2091,7 @@ void setRcProperties(GtkRcStyle* rc_style, int forceRecreate) stream << parse_rc_string("GtkButton::default-border = { 0, 0, 0, 0 }", "*"); stream << parse_rc_string("GtkButton::default-outside-border = {0, 0, 0, 0}", "*"); #ifdef USE_NATIVE_GTK_BUTTON_DRAWING - stream << parse_rc_string("GtkButton::inner-border = {0, 0, 0, 0}", "*"); + stream << parse_rc_string("GtkButton::inner-border = {2, 2, 2, 2}", "*"); #else if (tde_showIconsOnPushButtons) { stream << parse_rc_string("GtkButton::inner-border = {10, 10, 2, 2}", "*"); // Allow space for the icon on either side of the text @@ -2116,6 +2116,9 @@ void setRcProperties(GtkRcStyle* rc_style, int forceRecreate) stream << parse_rc_string("ythickness = 1", "*.GtkButton"); stream << parse_rc_string("fg[NORMAL] = {0, 0, 0}", "gtk-tooltips.GtkLabel", false); + stream << parse_rc_string("xthickness = 1", "*.GtkButton.*"); + stream << parse_rc_string("ythickness = 1", "*.GtkButton.*"); + stream << parse_rc_string("GtkButton::inner-border = {0, 0, 0, 0}", "*GtkToolbar*GtkButton*"); stream << parse_rc_string("GtkButton::inner-border = {0, 0, 0, 0}", "*GtkToolbar*GtkToggleButton*"); stream << parse_rc_string("GtkButton::inner-border = {0, 0, 0, 0}", "*GtkNotebook*GtkButton*"); -- cgit v1.2.3