summaryrefslogtreecommitdiffstats
path: root/tdegtk/tdegtk-draw.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tdegtk/tdegtk-draw.cpp')
-rw-r--r--tdegtk/tdegtk-draw.cpp30
1 files changed, 29 insertions, 1 deletions
diff --git a/tdegtk/tdegtk-draw.cpp b/tdegtk/tdegtk-draw.cpp
index 9d4e8e2..1829289 100644
--- a/tdegtk/tdegtk-draw.cpp
+++ b/tdegtk/tdegtk-draw.cpp
@@ -114,6 +114,20 @@ static TQPalette::ColorGroup gtkToTQPaletteColorGroup(GtkThemingEngine* engine,
return cg;
}
+// Keep this in sync with gtkToTQtColorGroup() above
+static TQColorGroup gtkToTQColorGroup(GtkThemingEngine* engine, GtkStateFlags state, TQPalette &basePalette) {
+ TQColorGroup cg = basePalette.active();
+
+ if (state & GTK_STATE_FLAG_INSENSITIVE) {
+ cg = basePalette.disabled();
+ }
+ else {
+ cg = basePalette.active();
+ }
+
+ return cg;
+}
+
static TQStyle::SFlags gtkToTQtStyleFlags(GtkThemingEngine* engine, GtkStateFlags state, TQt3WidgetType wt, GtkWidget* widget) {
TQStyle::SFlags sflags = TQStyle::Style_Default;
@@ -1141,7 +1155,21 @@ tdegtk_draw_arrow (GtkThemingEngine *engine,
else {
pe = TQStyle::PE_ArrowRight;
}
- tqApp->style().drawPrimitive(pe, p, boundingRect, gtkToTQtColorGroup(engine, state), gtkToTQtStyleFlags(engine, state, TQT3WT_NONE, widget));
+
+ TQt3WidgetType tqt3WidgetType = TQT3WT_NONE;
+ TQStringList objectTypes;
+ objectTypes.append(TQWIDGET_OBJECT_NAME_STRING);
+ if ((gtk_theming_engine_has_class(engine, GTK_STYLE_CLASS_MENU)) || (gtk_theming_engine_has_class(engine, GTK_STYLE_CLASS_MENUITEM))) {
+ GtkWidget* parent(widget?gtk_widget_get_parent(widget):0L);
+ if (!GTK_IS_MENU_BAR(parent)) {
+ objectTypes.clear();
+ objectTypes.append(TQPOPUPMENU_OBJECT_NAME_STRING);
+ tqt3WidgetType = TQT3WT_TQMenuItem;
+ }
+ }
+ TQPalette objectPalette = tqApp->palette(objectTypes);
+
+ tqApp->style().drawPrimitive(pe, p, boundingRect, gtkToTQColorGroup(engine, state, objectPalette), gtkToTQtStyleFlags(engine, state, tqt3WidgetType, widget));
}
if (p) {