diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-11-30 13:14:41 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-11-30 13:14:41 -0600 |
commit | beb8adf263fc48b76da0eccba506daa657a16fe3 (patch) | |
tree | 1b3e041f71a7950f09ccb67a2d59a3447e22081a /tdegtk/tdegtk-draw.cpp | |
parent | 791f39d38c9adba16dbe88528b4ad19c217ffb8c (diff) | |
download | gtk3-tqt-engine-beb8adf263fc48b76da0eccba506daa657a16fe3.tar.gz gtk3-tqt-engine-beb8adf263fc48b76da0eccba506daa657a16fe3.zip |
Set GTK event passthrough on startup
Fix menu item text highlight color
Diffstat (limited to 'tdegtk/tdegtk-draw.cpp')
-rw-r--r-- | tdegtk/tdegtk-draw.cpp | 30 |
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) { |