diff options
author | Timothy Pearson <[email protected]> | 2012-11-19 02:10:46 -0600 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2012-11-19 02:10:46 -0600 |
commit | 114c26e88f3814bc9d864faa0b46b00c19b8513b (patch) | |
tree | caaabb45f76279fc883401aa2985be7a1e5e693e /tdegtk/tdegtk-draw.cpp | |
parent | 2f93dfb8bfc66c98675499cde3f54fe90049e3ce (diff) | |
download | gtk3-tqt-engine-114c26e88f3814bc9d864faa0b46b00c19b8513b.tar.gz gtk3-tqt-engine-114c26e88f3814bc9d864faa0b46b00c19b8513b.zip |
Add GtkSwitch support
Speed up drawing operations on newer GTK/Cairo versions
Diffstat (limited to 'tdegtk/tdegtk-draw.cpp')
-rw-r--r-- | tdegtk/tdegtk-draw.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tdegtk/tdegtk-draw.cpp b/tdegtk/tdegtk-draw.cpp index 21bd704..2bd54e8 100644 --- a/tdegtk/tdegtk-draw.cpp +++ b/tdegtk/tdegtk-draw.cpp @@ -1586,6 +1586,22 @@ tdegtk_draw_common_background (DRAW_ARGS) // Do nothing } + else if (gtk_widget_path_is_type(path, GTK_TYPE_SWITCH)) { + TQStringList objectTypes; + objectTypes.append(TQSCROLLBAR_OBJECT_NAME_STRING); + TQPalette objectPalette = tqApp->palette(objectTypes); + + TQStyleControlElementData ceData; + TQStyle::ControlElementFlags elementFlags = TQStyle::CEF_None; + ceData.widgetObjectTypes = objectTypes; + ceData.rect = boundingRect; + ceData.orientation = (gtk_theming_engine_has_class(engine, GTK_STYLE_CLASS_VERTICAL))?TQt::Vertical:TQt::Horizontal; + ceData.startStep = 0; + + // Draw frame + tqApp->style().drawPrimitive(TQStyle::PE_PanelLineEdit, &p, boundingRect, gtkToTQtColorGroup(engine, state), gtkToTQtStyleFlags(engine, state, TQT3WT_NONE, widget) | ((ceData.orientation == TQt::Horizontal)?TQStyle::Style_Horizontal:TQStyle::Style_Default)); + } + else if ((gtk_theming_engine_has_class(engine, GTK_STYLE_CLASS_BACKGROUND)) || (gtk_widget_path_is_type(path, GTK_TYPE_EXPANDER)) || (gtk_widget_path_is_type(path, GTK_TYPE_BOX)) @@ -2515,6 +2531,22 @@ tdegtk_draw_slider (DRAW_ARGS, draw_slider_frame(engine, cr, x, y, width, height, path, state, widget); } + else if (gtk_widget_path_is_type(path, GTK_TYPE_SWITCH)) { + TQStringList objectTypes; + objectTypes.append(TQSCROLLBAR_OBJECT_NAME_STRING); + TQPalette objectPalette = tqApp->palette(objectTypes); + + TQStyleControlElementData ceData; + TQStyle::ControlElementFlags elementFlags = TQStyle::CEF_None; + ceData.widgetObjectTypes = objectTypes; + ceData.rect = boundingRect; + ceData.orientation = (gtk_theming_engine_has_class(engine, GTK_STYLE_CLASS_VERTICAL))?TQt::Vertical:TQt::Horizontal; + ceData.startStep = 0; + + // Draw slider + tqApp->style().drawPrimitive(TQStyle::PE_ScrollBarSlider, &p, boundingRect, gtkToTQtColorGroup(engine, state), gtkToTQtStyleFlags(engine, state, TQT3WT_NONE, widget) | ((ceData.orientation == TQt::Horizontal)?TQStyle::Style_Horizontal:TQStyle::Style_Default)); + } + else { DEBUG_FILL_BACKGROUND_WITH_COLOR(p,255,0,255); printf("[WARNING] tdegtk_draw_slider() nonfunctional for widget with path '%s'\n\r", gtk_widget_path_to_string (gtk_theming_engine_get_path(engine))); fflush(stdout); |