diff -Nru gtk2-engines-qtcurve-1.8.3~ppa1/ChangeLog gtk2-engines-qtcurve-1.8.6~ppa1/ChangeLog --- gtk2-engines-qtcurve-1.8.3~ppa1/ChangeLog 2010-12-16 22:43:18.000000000 +0000 +++ gtk2-engines-qtcurve-1.8.6~ppa1/ChangeLog 2011-02-15 19:39:15.000000000 +0000 @@ -1,3 +1,34 @@ +1.8.6 +----- +1. Fix compilation against Gtk2 older than 2.20 - yet again! +2. Fix drawing of background underneath menubars - noticeable if menubar + gradient uses alpha. +3. Fix highlighted menu items when shading poup menus. +4. Don't use gradient alpha settings for tooltips or rulers. +5. Fix background of popup menus when set to be shaded as per menubars, was + using inactive and not active titlebar colour! +6. When drawing popup text, where shaded as per titlebar, no need to check + if window is active - it always is. +7. Improve window drag code. + +1.8.5 +----- +1. Fix compilation against Gtk2 older than 2.20 +2. Remove some Gtk3 hacks. +3. Dont draw frame when shadow is set to NONE. +4. Use correct shade for highlighted menuitems when not using the highlight + colour, and the popup is shaded. +5. If using custom menu colours, when drawing selected menuitems always draw as + such - even if not using the highlight colour. + +1.8.4 +----- +1. Fix issues with image based backgrounds. +2. Don't start drag on widget tab labels. +3. Don't remove mouse over colour for pressed combo buttons. +4. Use gtk_rc_parse_string to hide shortcuts, and not GtkSettings +5. Fix KDE style non-editable combos which have has-frame set to FALSE. + 1.8.3 ----- 1. Better fix for problems with Pidgin's tabs and window dragging. diff -Nru gtk2-engines-qtcurve-1.8.3~ppa1/CMakeLists.txt gtk2-engines-qtcurve-1.8.6~ppa1/CMakeLists.txt --- gtk2-engines-qtcurve-1.8.3~ppa1/CMakeLists.txt 2010-12-16 22:43:18.000000000 +0000 +++ gtk2-engines-qtcurve-1.8.6~ppa1/CMakeLists.txt 2011-02-15 19:39:15.000000000 +0000 @@ -8,7 +8,7 @@ set(CPACK_SOURCE_GENERATOR "TBZ2") set(CPACK_PACKAGE_VERSION_MAJOR "1") set(CPACK_PACKAGE_VERSION_MINOR "8") -set(CPACK_PACKAGE_VERSION_PATCH "3") +set(CPACK_PACKAGE_VERSION_PATCH "6") set(CPACK_PACKAGE_CONTACT "Craig Drummond ") set(QTCURVE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}") set(QTCURVE_VERSION_FULL "${QTCURVE_VERSION}.${CPACK_PACKAGE_VERSION_PATCH}") diff -Nru gtk2-engines-qtcurve-1.8.3~ppa1/common/common.h gtk2-engines-qtcurve-1.8.6~ppa1/common/common.h --- gtk2-engines-qtcurve-1.8.3~ppa1/common/common.h 2010-12-16 22:43:18.000000000 +0000 +++ gtk2-engines-qtcurve-1.8.6~ppa1/common/common.h 2011-02-15 19:39:15.000000000 +0000 @@ -674,6 +674,7 @@ WIDGET_MENU_BUTTON, // Qt4 only WIDGET_FOCUS, WIDGET_TAB_FRAME, + WIDGET_TOOLTIP, WIDGET_OTHER } EWidget; diff -Nru gtk2-engines-qtcurve-1.8.3~ppa1/common/config_file.c gtk2-engines-qtcurve-1.8.6~ppa1/common/config_file.c --- gtk2-engines-qtcurve-1.8.3~ppa1/common/config_file.c 2010-12-16 22:43:18.000000000 +0000 +++ gtk2-engines-qtcurve-1.8.6~ppa1/common/config_file.c 2011-02-15 19:39:15.000000000 +0000 @@ -3513,6 +3513,30 @@ else CFG.deleteEntry("customShades"); + if(opts.customAlphas[0]==0 || + exportingStyle || + opts.customAlphas[0]!=def.customAlphas[0] || + opts.customAlphas[1]!=def.customAlphas[1]) + { + QString shadeVal; +#if QT_VERSION >= 0x040000 + QTextStream str(&shadeVal); +#else + QTextStream str(&shadeVal, IO_WriteOnly); +#endif + if(0==opts.customAlphas[0]) + str << 0; + else + for(int i=0; i Fri, 17 Dec 2010 23:29:13 +0100 + -- Emanuele Fri, 04 Mar 2011 23:29:13 +0100 gtk2-engines-qtcurve (1.6.4-1~ppa1) maverick; urgency=low diff -Nru gtk2-engines-qtcurve-1.8.3~ppa1/style/combobox.c gtk2-engines-qtcurve-1.8.6~ppa1/style/combobox.c --- gtk2-engines-qtcurve-1.8.3~ppa1/style/combobox.c 2010-12-16 22:43:18.000000000 +0000 +++ gtk2-engines-qtcurve-1.8.6~ppa1/style/combobox.c 2011-02-15 19:39:15.000000000 +0000 @@ -158,37 +158,48 @@ void qtcComboBoxSetup(GtkWidget *frame, GtkWidget *combo) { - if (combo && frame && !g_object_get_data(G_OBJECT(combo), "QTC_COMBO_BOX_SET")) + if (combo && (frame || !qtcComboHasFrame(combo)) && !g_object_get_data(G_OBJECT(combo), "QTC_COMBO_BOX_SET")) { - GList *children = gtk_container_get_children(GTK_CONTAINER(frame)), - *child = children; - g_object_set_data(G_OBJECT(combo), "QTC_COMBO_BOX_SET", (gpointer)1); qtcComboBoxClearBgndColor(combo); g_object_set_data(G_OBJECT(combo), "QTC_COMBO_BOX_STATE_CHANGE_ID", (gpointer)g_signal_connect(G_OBJECT(combo), "state-changed", G_CALLBACK(qtcComboBoxStateChange), NULL)); - for(; child; child=child->next) + if(frame) { - GtkWidget *boxChild=(GtkWidget *)child->data; - - if(GTK_IS_EVENT_BOX(boxChild)) + GList *children = gtk_container_get_children(GTK_CONTAINER(frame)), + *child = children; + + for(; child; child=child->next) { - g_object_set_data(G_OBJECT(boxChild), "QTC_COMBO_BOX_DESTROY_ID", - (gpointer)g_signal_connect(G_OBJECT(boxChild), "destroy-event", G_CALLBACK(qtcComboBoxDestroy), NULL)); - g_object_set_data(G_OBJECT(boxChild), "QTC_COMBO_BOX_UNREALIZE_ID", - (gpointer)g_signal_connect(G_OBJECT(boxChild), "unrealize", G_CALLBACK(qtcComboBoxDestroy), NULL)); - g_object_set_data(G_OBJECT(boxChild), "QTC_COMBO_BOX_STYLE_SET_ID", - (gpointer)g_signal_connect(G_OBJECT(boxChild), "style-set", G_CALLBACK(qtcComboBoxStyleSet), NULL)); - g_object_set_data(G_OBJECT(boxChild), "QTC_COMBO_BOX_ENTER_ID", - (gpointer)g_signal_connect(G_OBJECT(boxChild), "enter-notify-event", G_CALLBACK(qtcComboBoxEnter), combo)); - g_object_set_data(G_OBJECT(boxChild), "QTC_COMBO_BOX_LEAVE_ID", - (gpointer)g_signal_connect(G_OBJECT(boxChild), "leave-notify-event", G_CALLBACK(qtcComboBoxLeave), combo)); + GtkWidget *boxChild=(GtkWidget *)child->data; + + if(GTK_IS_EVENT_BOX(boxChild)) + { + g_object_set_data(G_OBJECT(boxChild), "QTC_COMBO_BOX_DESTROY_ID", + (gpointer)g_signal_connect(G_OBJECT(boxChild), "destroy-event", G_CALLBACK(qtcComboBoxDestroy), NULL)); + g_object_set_data(G_OBJECT(boxChild), "QTC_COMBO_BOX_UNREALIZE_ID", + (gpointer)g_signal_connect(G_OBJECT(boxChild), "unrealize", G_CALLBACK(qtcComboBoxDestroy), NULL)); + g_object_set_data(G_OBJECT(boxChild), "QTC_COMBO_BOX_STYLE_SET_ID", + (gpointer)g_signal_connect(G_OBJECT(boxChild), "style-set", G_CALLBACK(qtcComboBoxStyleSet), NULL)); + g_object_set_data(G_OBJECT(boxChild), "QTC_COMBO_BOX_ENTER_ID", + (gpointer)g_signal_connect(G_OBJECT(boxChild), "enter-notify-event", G_CALLBACK(qtcComboBoxEnter), combo)); + g_object_set_data(G_OBJECT(boxChild), "QTC_COMBO_BOX_LEAVE_ID", + (gpointer)g_signal_connect(G_OBJECT(boxChild), "leave-notify-event", G_CALLBACK(qtcComboBoxLeave), combo)); + } } - } - if(children) - g_list_free(children); + if(children) + g_list_free(children); + } } } + +gboolean qtcComboHasFrame(GtkWidget *widget) +{ + GValue val = { 0 }; + g_value_init(&val, G_TYPE_BOOLEAN); + g_object_get_property(G_OBJECT(widget), "has-frame", &val); + return g_value_get_boolean(&val); +} diff -Nru gtk2-engines-qtcurve-1.8.3~ppa1/style/combobox.h gtk2-engines-qtcurve-1.8.6~ppa1/style/combobox.h --- gtk2-engines-qtcurve-1.8.3~ppa1/style/combobox.h 2010-12-16 22:43:18.000000000 +0000 +++ gtk2-engines-qtcurve-1.8.6~ppa1/style/combobox.h 2011-02-15 19:39:15.000000000 +0000 @@ -25,5 +25,6 @@ extern gboolean qtcComboBoxIsHovered(GtkWidget *widget); extern gboolean qtcComboBoxHasFocus(GtkWidget *widget, GtkWidget *mapped); extern void qtcComboBoxSetup(GtkWidget *frame, GtkWidget *combo); +extern gboolean qtcComboHasFrame(GtkWidget *widget); #endif diff -Nru gtk2-engines-qtcurve-1.8.3~ppa1/style/compatability.h gtk2-engines-qtcurve-1.8.6~ppa1/style/compatability.h --- gtk2-engines-qtcurve-1.8.3~ppa1/style/compatability.h 2010-12-16 22:43:18.000000000 +0000 +++ gtk2-engines-qtcurve-1.8.6~ppa1/style/compatability.h 2011-02-15 19:39:15.000000000 +0000 @@ -78,7 +78,6 @@ #define qtcWidgetGetState(W) gtk_widget_get_state(W) #define qtcWidgetSetState(W, S) gtk_widget_set_state(W, S) #define qtcWidgetHasFocus(W) gtk_widget_has_focus(W) - #define qtcWidgetState(W) gtk_widget_get_state(W) #define qtcWidgetVisible(W) gtk_widget_get_visible(W) #define qtcWidgetHasDefault(W) gtk_widget_has_default(W) #define qtcWidgetIsSensitive(W) gtk_widget_is_sensitive(W) @@ -141,7 +140,6 @@ #define qtcWidgetGetState(W) ((W)->state) #define qtcWidgetSetState(W, S) ((W)->state=(S)) #define qtcWidgetHasFocus(W) GTK_WIDGET_HAS_FOCUS(W) - #define qtcWidgetState(W) GTK_WIDGET_STATE(W) #define qtcWidgetVisible(W) GTK_WIDGET_VISIBLE(W) #define qtcWidgetHasDefault(W) GTK_WIDGET_HAS_DEFAULT(W) #define qtcWidgetIsSensitive(W) GTK_WIDGET_IS_SENSITIVE(W) @@ -186,13 +184,6 @@ #define QTC_KEY_s GDK_s #define QTC_KEY_S GDK_S - #define WINDOW_PARAM GdkWindow *window, - #define WINDOW_PARAM_VAL window, - #define GDKWINDOW window - #define AREA_PARAM GdkRectangle *area, - #define AREA_PARAM_VAL area, - #define AREA_PARAM_VAL_L area - #endif #endif diff -Nru gtk2-engines-qtcurve-1.8.3~ppa1/style/drawing.c gtk2-engines-qtcurve-1.8.6~ppa1/style/drawing.c --- gtk2-engines-qtcurve-1.8.3~ppa1/style/drawing.c 2010-12-16 22:43:18.000000000 +0000 +++ gtk2-engines-qtcurve-1.8.6~ppa1/style/drawing.c 2011-02-15 19:39:15.000000000 +0000 @@ -199,7 +199,7 @@ pos=0.999; #endif cairo_pattern_add_color_stop_rgba(pt, pos, - CAIRO_COL(col), alpha*grad->stops[i].alpha); + CAIRO_COL(col), WIDGET_TOOLTIP==w || WIDGET_LISTVIEW_HEADER==w ? alpha : alpha*grad->stops[i].alpha); } if(APPEARANCE_AGUA==app && !(topTab || botTab) && (horiz ? height : width)>AGUA_MAX) @@ -1398,8 +1398,8 @@ else if(APPEARANCE_FILE==opts.bgndAppearance) { cairo_save(cr); - cairo_translate(cr, xmod, ymod); - drawBgndImage(cr, style, area, -wx, -wy, ww, wh, col, TRUE, alpha); + cairo_translate(cr, -wx, -wy); + drawBgndImage(cr, style, area, 0, 0, ww, wh, col, TRUE, alpha); cairo_restore(cr); } else @@ -1561,7 +1561,7 @@ gtk_entry_set_invisible_char(GTK_ENTRY(widget), opts.passwordChar); } -void setProgressStripeClipping(cairo_t *cr, AREA_PARAM int x, int y, int width, int height, int animShift, gboolean horiz) +void setProgressStripeClipping(cairo_t *cr, GdkRectangle *area, int x, int y, int width, int height, int animShift, gboolean horiz) { int stripeOffset; @@ -1703,7 +1703,7 @@ } else { - setProgressStripeClipping(cr, AREA_PARAM_VAL xo, yo, wo, ho, animShift, horiz); + setProgressStripeClipping(cr, area, xo, yo, wo, ho, animShift, horiz); drawLightBevel(cr, style, new_state, NULL, x, y, width, height, &itemCols[1], qtcPalette.highlight, ROUNDED_ALL, wid, BORDER_FLAT, (opts.fillProgress || !opts.borderProgress ? 0 : DF_DO_BORDER)|(horiz ? 0 : DF_VERT), widget); @@ -2375,7 +2375,7 @@ cairo_set_source_rgba(crMask, 0, 0, 0, 1); cairo_fill(crMask); if(isToolTip) - gtk_widget_shape_combine_mask(widget, mask, 0, 0); + gtk_widget_shape_combine_mask(widget, mask, x, y); else gdk_window_shape_combine_mask(gtk_widget_get_parent_window(widget), mask, 0, 0); cairo_destroy(crMask); @@ -2412,7 +2412,7 @@ GtkTreeView *treeView, GtkTreePath *path, GtkTreeViewColumn *column) { int cellIndent=levelIndent + expanderSize + 4, - xStart=cellIndent/2, + xStart=x + (cellIndent/2), i, isLastMask=0; gboolean haveChildren=treeViewCellHasChildren(treeView, path), @@ -2497,7 +2497,7 @@ } } -void drawPolygon(WINDOW_PARAM GtkStyle *style, GdkColor *col, GdkRectangle *area, GdkPoint *points, int npoints, gboolean fill) +void drawPolygon(GdkWindow *window, GtkStyle *style, GdkColor *col, GdkRectangle *area, GdkPoint *points, int npoints, gboolean fill) { #if (defined QTC_USE_CAIRO_FOR_ARROWS) || GTK_CHECK_VERSION(2, 90, 0) CAIRO_BEGIN @@ -2540,7 +2540,7 @@ #endif } -void drawArrow(WINDOW_PARAM GtkStyle *style, GdkColor *col, GdkRectangle *area, GtkArrowType arrow_type, +void drawArrow(GdkWindow *window, GtkStyle *style, GdkColor *col, GdkRectangle *area, GtkArrowType arrow_type, gint x, gint y, gboolean small, gboolean fill) { if(small) @@ -2549,25 +2549,25 @@ case GTK_ARROW_UP: { GdkPoint a[]={{x+2,y}, {x,y-2}, {x-2,y}, {x-2,y+1}, {x,y-1}, {x+2,y+1}}; - drawPolygon(WINDOW_PARAM_VAL style, col, area, a, opts.vArrows ? 6 : 3, fill); + drawPolygon(window, style, col, area, a, opts.vArrows ? 6 : 3, fill); break; } case GTK_ARROW_DOWN: { GdkPoint a[]={{x+2,y}, {x,y+2}, {x-2,y}, {x-2,y-1}, {x,y+1}, {x+2,y-1}}; - drawPolygon(WINDOW_PARAM_VAL style, col, area, a, opts.vArrows ? 6 : 3, fill); + drawPolygon(window, style, col, area, a, opts.vArrows ? 6 : 3, fill); break; } case GTK_ARROW_RIGHT: { GdkPoint a[]={{x,y-2}, {x+2,y}, {x,y+2}, {x-1,y+2}, {x+1,y}, {x-1,y-2}}; - drawPolygon(WINDOW_PARAM_VAL style, col, area, a, opts.vArrows ? 6 : 3, fill); + drawPolygon(window, style, col, area, a, opts.vArrows ? 6 : 3, fill); break; } case GTK_ARROW_LEFT: { GdkPoint a[]={{x,y-2}, {x-2,y}, {x,y+2}, {x+1,y+2}, {x-1,y}, {x+1,y-2}}; - drawPolygon(WINDOW_PARAM_VAL style, col, area, a, opts.vArrows ? 6 : 3, fill); + drawPolygon(window, style, col, area, a, opts.vArrows ? 6 : 3, fill); break; } default: @@ -2579,25 +2579,25 @@ case GTK_ARROW_UP: { GdkPoint a[]={{x+3,y+1}, {x,y-2}, {x-3,y+1}, {x-3, y+2}, {x-2, y+2}, {x,y}, {x+2, y+2}, {x+3,y+2}}; - drawPolygon(WINDOW_PARAM_VAL style, col, area, a, opts.vArrows ? 8 : 3, fill); + drawPolygon(window, style, col, area, a, opts.vArrows ? 8 : 3, fill); break; } case GTK_ARROW_DOWN: { GdkPoint a[]={{x+3,y-1}, {x,y+2}, {x-3,y-1}, {x-3,y-2}, {x-2, y-2}, {x,y}, {x+2, y-2}, {x+3,y-2}}; - drawPolygon(WINDOW_PARAM_VAL style, col, area, a, opts.vArrows ? 8 : 3, fill); + drawPolygon(window, style, col, area, a, opts.vArrows ? 8 : 3, fill); break; } case GTK_ARROW_RIGHT: { GdkPoint a[]={{x-1,y+3}, {x+2,y}, {x-1,y-3}, {x-2,y-3}, {x-2, y-2}, {x,y}, {x-2, y+2}, {x-2,y+3}}; - drawPolygon(WINDOW_PARAM_VAL style, col, area, a, opts.vArrows ? 8 : 3, fill); + drawPolygon(window, style, col, area, a, opts.vArrows ? 8 : 3, fill); break; } case GTK_ARROW_LEFT: { GdkPoint a[]={{x+1,y-3}, {x-2,y}, {x+1,y+3}, {x+2,y+3}, {x+2, y+2}, {x,y}, {x+2, y-2}, {x+2,y-3}}; - drawPolygon(WINDOW_PARAM_VAL style, col, area, a, opts.vArrows ? 8 : 3, fill); + drawPolygon(window, style, col, area, a, opts.vArrows ? 8 : 3, fill); break; } default: @@ -2666,7 +2666,7 @@ cairo_translate(cr, x, y); } -void qtcDrawLayout(GtkStyle *style, WINDOW_PARAM GtkStateType state, gboolean use_text, AREA_PARAM gint x, gint y, PangoLayout *layout) +void drawLayout(GtkStyle *style, GdkWindow *window, GtkStateType state, gboolean use_text, GdkRectangle *area, gint x, gint y, PangoLayout *layout) { CAIRO_BEGIN gdk_cairo_set_source_color(cr, use_text || GTK_STATE_INSENSITIVE==state ? &style->text[state] : &style->fg[state]); @@ -2765,7 +2765,7 @@ if(useAlpha) cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); - drawBevelGradientAlpha(cr, area, x, y, width, height, col, true, FALSE, opts.tooltipAppearance, WIDGET_OTHER, useAlpha ? 0.875 : 1.0); + drawBevelGradientAlpha(cr, area, x, y, width, height, col, true, FALSE, opts.tooltipAppearance, WIDGET_TOOLTIP, useAlpha ? 0.875 : 1.0); #if GTK_CHECK_VERSION(2,9,0) if(!rounded) #endif @@ -2900,14 +2900,14 @@ GdkColor *bgnd=qtcPalette.menubar && mb && !isMozilla() && GTK_APP_JAVA!=qtSettings.app ? &qtcPalette.menubar[ORIGINAL_SHADE] : NULL; int round=mb - ? active_mb && opts.roundMbTopOnly - ? ROUNDED_TOP - : ROUNDED_ALL - : ROUNDED_ALL, - new_state=GTK_STATE_PRELIGHT==state ? GTK_STATE_NORMAL : state; + ? active_mb && opts.roundMbTopOnly + ? ROUNDED_TOP + : ROUNDED_ALL + : ROUNDED_ALL, + new_state=GTK_STATE_PRELIGHT==state ? GTK_STATE_NORMAL : state; gboolean stdColors=!mb || (SHADE_BLEND_SELECTED!=opts.shadeMenubars && SHADE_SELECTED!=opts.shadeMenubars); int fillVal=grayItem ? 4 : ORIGINAL_SHADE, - borderVal=opts.borderMenuitems ? 0 : fillVal; + borderVal=opts.borderMenuitems ? 0 : fillVal; if(grayItem && mb && !active_mb && !opts.colorMenubarMouseOver && (opts.borderMenuitems || !IS_FLAT(opts.menuitemAppearance))) @@ -2916,6 +2916,9 @@ if(mb && !opts.roundMbTopOnly && !(opts.square&SQUARE_POPUP_MENUS)) x++, y++, width-=2, height-=2; + if(grayItem && !mb && (USE_LIGHTER_POPUP_MENU || opts.shadePopupMenu)) + itemCols=qtcPalette.menu; + if(!mb && APPEARANCE_FADE==opts.menuitemAppearance) { gboolean reverse=FALSE; /* TODO !!! */ @@ -3075,9 +3078,6 @@ if(opts.popupBorder) { - GdkColor *cols=USE_LIGHTER_POPUP_MENU || opts.shadePopupMenu - ? qtcPalette.menu - : qtcPalette.background; EGradientBorder border=qtcGetGradient(opts.menuBgndAppearance, &opts)->border; if(roundedMenu && !comboMenu) @@ -3087,7 +3087,7 @@ cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_new_path(cr); - cairo_set_source_rgb(cr, CAIRO_COL(cols[STD_BORDER])); + cairo_set_source_rgb(cr, CAIRO_COL(qtcPalette.menu[STD_BORDER])); /*For now dont round combos - getting weird effects with shadow/clipping :-( */ if(roundedMenu && !comboMenu) createPath(cr, x+0.5, y+0.5, width-1, height-1, radius-1, ROUNDED_ALL); @@ -3101,12 +3101,12 @@ if(GB_3D!=border) { cairo_new_path(cr); - cairo_set_source_rgb(cr, CAIRO_COL(cols[0])); + cairo_set_source_rgb(cr, CAIRO_COL(qtcPalette.menu[0])); createTLPath(cr, x+1.5, y+1.5, width-3, height-3, radius-2, ROUNDED_ALL); cairo_stroke(cr); } cairo_new_path(cr); - cairo_set_source_rgb(cr, CAIRO_COL(cols[GB_LIGHT==border ? 0 : FRAME_DARK_SHADOW])); + cairo_set_source_rgb(cr, CAIRO_COL(qtcPalette.menu[GB_LIGHT==border ? 0 : FRAME_DARK_SHADOW])); createBRPath(cr, x+1.5, y+1.5, width-3, height-3, radius-2, ROUNDED_ALL); cairo_stroke(cr); } @@ -3114,11 +3114,11 @@ { if(GB_3D!=border) { - drawHLine(cr, CAIRO_COL(cols[0]), 1.0, x+1, y+1, width-2); - drawVLine(cr, CAIRO_COL(cols[0]), 1.0, x+1, y+1, height-2); + drawHLine(cr, CAIRO_COL(qtcPalette.menu[0]), 1.0, x+1, y+1, width-2); + drawVLine(cr, CAIRO_COL(qtcPalette.menu[0]), 1.0, x+1, y+1, height-2); } - drawHLine(cr, CAIRO_COL(cols[GB_LIGHT==border ? 0 : FRAME_DARK_SHADOW]), 1.0, x+1, y+height-2, width-2); - drawVLine(cr, CAIRO_COL(cols[GB_LIGHT==border ? 0 : FRAME_DARK_SHADOW]), 1.0, x+width-2, y+1, height-2); + drawHLine(cr, CAIRO_COL(qtcPalette.menu[GB_LIGHT==border ? 0 : FRAME_DARK_SHADOW]), 1.0, x+1, y+height-2, width-2); + drawVLine(cr, CAIRO_COL(qtcPalette.menu[GB_LIGHT==border ? 0 : FRAME_DARK_SHADOW]), 1.0, x+width-2, y+1, height-2); } } } @@ -4225,19 +4225,19 @@ if(widget && gtk_widget_has_screen(widget)) { screen = gtk_widget_get_screen(widget); - settings = gtk_settings_get_for_screen(screen); + settings = screen ? gtk_settings_get_for_screen(screen) : NULL; } #if GTK_CHECK_VERSION(2, 90, 0) else if (style->visual) { screen = gdk_visual_get_screen(style->visual); - settings = gtk_settings_get_for_screen(screen); + settings = screen ? gtk_settings_get_for_screen(screen) : NULL; } #else else if(style->colormap) { screen = gdk_colormap_get_screen(style->colormap); - settings = gtk_settings_get_for_screen(screen); + settings = screen ? gtk_settings_get_for_screen(screen) : NULL; } #endif else diff -Nru gtk2-engines-qtcurve-1.8.3~ppa1/style/drawing.h gtk2-engines-qtcurve-1.8.6~ppa1/style/drawing.h --- gtk2-engines-qtcurve-1.8.3~ppa1/style/drawing.h 2010-12-16 22:43:18.000000000 +0000 +++ gtk2-engines-qtcurve-1.8.6~ppa1/style/drawing.h 2011-02-15 19:39:15.000000000 +0000 @@ -135,7 +135,7 @@ gint x, gint y, gint width, gint height); extern void drawEntryField(cairo_t *cr, GtkStyle *style, GtkStateType state, GdkWindow *window, GtkWidget *widget, GdkRectangle *area, gint x, gint y, gint width, gint height, int round, EWidget w); -extern void setProgressStripeClipping(cairo_t *cr, AREA_PARAM int x, int y, int width, int height, int animShift, gboolean horiz); +extern void setProgressStripeClipping(cairo_t *cr, GdkRectangle *area, int x, int y, int width, int height, int animShift, gboolean horiz); extern void drawProgress(cairo_t *cr, GtkStyle *style, GtkStateType state, GtkWidget *widget, GdkRectangle *area, int x, int y, int width, int height, gboolean rev, gboolean isEntryProg); extern void drawProgressGroove(cairo_t *cr, GtkStyle *style, GtkStateType state, GdkWindow *window, GtkWidget *widget, GdkRectangle *area, @@ -154,10 +154,10 @@ extern void clearRoundedMask(GtkWidget *widget, gboolean isToolTip); extern void drawTreeViewLines(cairo_t *cr, GdkColor *col, int x, int y, int h, int depth, int levelIndent, int expanderSize, GtkTreeView *treeView, GtkTreePath *path, GtkTreeViewColumn *column); -extern void drawPolygon(WINDOW_PARAM GtkStyle *style, GdkColor *col, GdkRectangle *area, GdkPoint *points, int npoints, gboolean fill); -extern void drawArrow(WINDOW_PARAM GtkStyle *style, GdkColor *col, GdkRectangle *area, GtkArrowType arrow_type, +extern void drawPolygon(GdkWindow *window, GtkStyle *style, GdkColor *col, GdkRectangle *area, GdkPoint *points, int npoints, gboolean fill); +extern void drawArrow(GdkWindow *window, GtkStyle *style, GdkColor *col, GdkRectangle *area, GtkArrowType arrow_type, gint x, gint y, gboolean small, gboolean fill); -extern void qtcDrawLayout(GtkStyle *style, WINDOW_PARAM GtkStateType state, gboolean use_text, AREA_PARAM gint x, gint y, PangoLayout *layout); +extern void drawLayout(GtkStyle *style, GdkWindow *window, GtkStateType state, gboolean use_text, GdkRectangle *area, gint x, gint y, PangoLayout *layout); extern void fillTab(cairo_t *cr, GtkStyle *style, GtkWidget *widget, GdkRectangle *area, GtkStateType state, GdkColor *col, int x, int y, int width, int height, gboolean horiz, EWidget tab, gboolean grad); extern void colorTab(cairo_t *cr, int x, int y, int width, int height, int round, EWidget tab, gboolean horiz); diff -Nru gtk2-engines-qtcurve-1.8.3~ppa1/style/helpers.c gtk2-engines-qtcurve-1.8.6~ppa1/style/helpers.c --- gtk2-engines-qtcurve-1.8.3~ppa1/style/helpers.c 2010-12-16 22:43:18.000000000 +0000 +++ gtk2-engines-qtcurve-1.8.6~ppa1/style/helpers.c 2011-02-15 19:39:15.000000000 +0000 @@ -1125,7 +1125,7 @@ style=qtcWidgetGetStyle(parent); if(style) - *color = style->bg[qtcWidgetState(parent)]; + *color = style->bg[qtcWidgetGetState(parent)]; } gboolean compositingActive(GtkWidget *widget) @@ -1599,9 +1599,7 @@ { GdkColor color; GdkColor *cols=opts.shadePopupMenu - ? SHADE_WINDOW_BORDER==opts.shadeMenubars - ? qtcPalette.wborder[0] - : qtcPalette.menubar + ? menuColors(TRUE) : qtcPalette.background; if(opts.lighterPopupMenuBgnd) qtcShade(&opts, &cols[ORIGINAL_SHADE], &color, TO_FACTOR(opts.lighterPopupMenuBgnd)); diff -Nru gtk2-engines-qtcurve-1.8.3~ppa1/style/menu.c gtk2-engines-qtcurve-1.8.6~ppa1/style/menu.c --- gtk2-engines-qtcurve-1.8.3~ppa1/style/menu.c 2010-12-16 22:43:18.000000000 +0000 +++ gtk2-engines-qtcurve-1.8.6~ppa1/style/menu.c 2011-02-15 19:39:15.000000000 +0000 @@ -194,7 +194,7 @@ for(child = g_list_first(children); child; child = g_list_next(child)) { if((child->data) && GTK_IS_WIDGET(child->data) && - (qtcWidgetState(GTK_WIDGET(child->data)) != GTK_STATE_INSENSITIVE)) + (qtcWidgetGetState(GTK_WIDGET(child->data)) != GTK_STATE_INSENSITIVE)) { GtkAllocation alloc=qtcWidgetGetAllocation(GTK_WIDGET(child->data)); @@ -224,7 +224,7 @@ for(child = g_list_first(children); child; child = g_list_next(child)) { if((child->data) && GTK_IS_MENU_ITEM(child->data) && - (qtcWidgetState(GTK_WIDGET(child->data)) != GTK_STATE_INSENSITIVE)) + (qtcWidgetGetState(GTK_WIDGET(child->data)) != GTK_STATE_INSENSITIVE)) { GtkWidget *submenu = qtcMenuItemGetSubMenu(GTK_MENU_ITEM(child->data)), *topLevel = submenu ? qtcMenuGetTopLevel(submenu) : NULL; diff -Nru gtk2-engines-qtcurve-1.8.3~ppa1/style/qtcurve.c gtk2-engines-qtcurve-1.8.6~ppa1/style/qtcurve.c --- gtk2-engines-qtcurve-1.8.3~ppa1/style/qtcurve.c 2010-12-16 22:43:18.000000000 +0000 +++ gtk2-engines-qtcurve-1.8.6~ppa1/style/qtcurve.c 2011-02-15 19:39:15.000000000 +0000 @@ -84,19 +84,19 @@ #define STYLE style #define WIDGET_TYPE_NAME(xx) (widget && !strcmp(g_type_name (G_TYPE_FROM_INSTANCE(widget)), (xx))) -static void gtkDrawBox(GtkStyle *style, WINDOW_PARAM GtkStateType state, GtkShadowType shadow, AREA_PARAM +static void gtkDrawBox(GtkStyle *style, GdkWindow *window, GtkStateType state, GtkShadowType shadow, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height); -static void gtkDrawSlider(GtkStyle *style, WINDOW_PARAM GtkStateType state, GtkShadowType shadow, AREA_PARAM +static void gtkDrawSlider(GtkStyle *style, GdkWindow *window, GtkStateType state, GtkShadowType shadow, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height, GtkOrientation orientation); static void qtcLogHandler(const gchar *domain, GLogLevelFlags level, const gchar *msg, gpointer data) { } -static void gtkDrawFlatBox(GtkStyle *style, WINDOW_PARAM GtkStateType state, GtkShadowType shadow, AREA_PARAM +static void gtkDrawFlatBox(GtkStyle *style, GdkWindow *window, GtkStateType state, GtkShadowType shadow, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height) { CAIRO_BEGIN @@ -235,14 +235,14 @@ // if the app hasn't modified bg, draw background gradient if(st && !(st->color_flags[state]>K_RC_BG)) { - drawWindowBgnd(cr, style, area, GDKWINDOW, widget, x, y, width, height); + drawWindowBgnd(cr, style, area, window, widget, x, y, width, height); qtcScrollbarSetup(widget); } else - parent_class->draw_flat_box(style, WINDOW_PARAM_VAL state, shadow, AREA_PARAM_VAL widget, detail, x, y, width, height); + parent_class->draw_flat_box(style, window, state, shadow, area, widget, detail, x, y, width, height); } else if(CUSTOM_BGND && widget && GTK_IS_WINDOW(widget) && !isMenuOrToolTipWindow && - drawWindowBgnd(cr, style, area, GDKWINDOW, widget, x, y, width, height)) + drawWindowBgnd(cr, style, area, window, widget, x, y, width, height)) qtcWindowSetup(widget, GTK_IS_DIALOG(widget) ? opts.dlgOpacity : opts.bgndOpacity); else if(widget && GTK_IS_TREE_VIEW(widget)) { @@ -293,10 +293,12 @@ } else { - double alpha=1.0; - int selX=x, - selW=width, - factor=0; + double alpha=1.0; + int selX=x, + selW=width, + factor=0; + gboolean forceCellStart=FALSE, + forceCellEnd=FALSE; #if GTK_CHECK_VERSION(2, 12, 0) if(!isFixedWidget(widget)) @@ -324,10 +326,13 @@ levelIndent=gtk_tree_view_get_level_indentation(treeView), depth=path ? (int)gtk_tree_path_get_depth(path) : 0; + forceCellStart=TRUE; if(opts.lvLines) drawTreeViewLines(cr, &style->mid[GTK_STATE_ACTIVE], x, y, height, depth, levelIndent, expanderSize, treeView, path, column); } + else if(column && qtcTreeViewCellIsLeftOfExpanderColumn(treeView, column)) + forceCellEnd=TRUE; if((GTK_STATE_SELECTED==state || alpha<1.0) && column==expanderColumn) { @@ -344,13 +349,15 @@ if(GTK_STATE_SELECTED==state || alpha<1.0) { int round=detail && ROUNDED - ? 0!=strstr(detail, "_start") - ? ROUNDED_LEFT - : 0!=strstr(detail, "_end") - ? ROUNDED_RIGHT - : 0!=strstr(detail, "_middle") - ? ROUNDED_NONE - : ROUNDED_ALL + ? forceCellStart && forceCellEnd + : ROUNDED_ALL + ? forceCellStart || 0!=strstr(detail, "_start") + ? ROUNDED_LEFT + : forceCellEnd || 0!=strstr(detail, "_end") + ? ROUNDED_RIGHT + : 0!=strstr(detail, "_middle") + ? ROUNDED_NONE + : ROUNDED_ALL : ROUNDED_NONE; drawSelection(cr, style, state, area, widget, selX, y, selW, height, round, TRUE, alpha, factor); @@ -378,13 +385,13 @@ else if(DETAIL("icon_view_item")) drawSelection(cr, style, state, area, widget, x, y, width, height, ROUNDED_ALL, FALSE, 1.0, 0); else if(GTK_STATE_SELECTED!=state && CUSTOM_BGND && DETAIL("eventbox")) - drawWindowBgnd(cr, style, NULL, GDKWINDOW, widget, x, y, width, height); + drawWindowBgnd(cr, style, NULL, window, widget, x, y, width, height); else if(!(GTK_APP_JAVA==qtSettings.app && widget && GTK_IS_LABEL(widget))) { if(GTK_STATE_PRELIGHT==state && !opts.crHighlight && 0==strcmp(detail, "checkbutton")) ; else - parent_class->draw_flat_box(style, WINDOW_PARAM_VAL state, shadow, AREA_PARAM_VAL widget, detail, x, y, width, height); + parent_class->draw_flat_box(style, window, state, shadow, area, widget, detail, x, y, width, height); /* For SWT (e.g. eclipse) apps. For some reason these only seem to allow a ythickness of at max 2 - but for etching we need 3. So we fake this by drawing the 3rd lines here...*/ @@ -401,7 +408,7 @@ CAIRO_END } -static void gtkDrawHandle(GtkStyle *style, WINDOW_PARAM GtkStateType state, GtkShadowType shadow, AREA_PARAM +static void gtkDrawHandle(GtkStyle *style, GdkWindow *window, GtkStateType state, GtkShadowType shadow, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height, GtkOrientation orientation) { gboolean paf=WIDGET_TYPE_NAME("PanelAppletFrame"); @@ -413,12 +420,12 @@ debugDisplayWidget(widget, 10); sanitizeSize(window, &width, &height); - if(IS_FLAT_BGND(opts.bgndAppearance) || !(widget && drawWindowBgnd(cr, style, area, GDKWINDOW, widget, x, y, width, height))) + if(IS_FLAT_BGND(opts.bgndAppearance) || !(widget && drawWindowBgnd(cr, style, area, window, widget, x, y, width, height))) { // gtk_style_apply_default_background(style, window, widget && !qtcWidgetNoWindow(widget), state, // area, x, y, width, height); if(widget && IMG_NONE!=opts.bgndImage.type) - drawWindowBgnd(cr, style, area, GDKWINDOW, widget, x, y, width, height); + drawWindowBgnd(cr, style, area, window, widget, x, y, width, height); } if(detail && (!strcmp(detail, "paned") || !strcmp(detail+1, "paned"))) @@ -430,7 +437,7 @@ DETAIL("dockitem") || paf) { if(widget && GTK_STATE_INSENSITIVE!=state) - state=qtcWidgetState(widget); + state=qtcWidgetGetState(widget); if(paf) /* The paf here is expected to be on the gnome panel */ if(heightwidth) - drawLines(cr, x+3, y, 3, height, TRUE, (height-8)/2, 0, qtcPalette.background, AREA_PARAM_VAL_L, 5, opts.handles); + drawLines(cr, x+3, y, 3, height, TRUE, (height-8)/2, 0, qtcPalette.background, area, 5, opts.handles); else - drawLines(cr, x, y+3, width, 3, FALSE, (width-8)/2, 0, qtcPalette.background, AREA_PARAM_VAL_L, 5, opts.handles); + drawLines(cr, x, y+3, width, 3, FALSE, (width-8)/2, 0, qtcPalette.background, area, 5, opts.handles); break; case LINE_FLAT: - drawLines(cr, x, y, width, height, height>1), y+(height>>1)-(LARGE_ARR_HEIGHT-pad), FALSE, TRUE); - drawArrow(WINDOW_PARAM_VAL style, arrowColor, AREA_PARAM_VAL_L, GTK_ARROW_DOWN, + drawArrow(window, style, arrowColor, area, GTK_ARROW_DOWN, x+(width>>1), y+(height>>1)+(LARGE_ARR_HEIGHT-pad), FALSE, TRUE); } else { - if(!opts.gtkComboMenus) + GtkWidget *parent=NULL; + if(!opts.gtkComboMenus && !((parent=qtcWidgetGetParent(widget)) && (parent=qtcWidgetGetParent(parent)) && !qtcComboHasFrame(parent))) x+=2; - drawArrow(WINDOW_PARAM_VAL style, arrowColor, AREA_PARAM_VAL_L, GTK_ARROW_DOWN, x+(width>>1), y+(height>>1), FALSE, TRUE); + drawArrow(window, style, arrowColor, area, GTK_ARROW_DOWN, x+(width>>1), y+(height>>1), FALSE, TRUE); + } } } else { - GdkColor *col=onComboEntry || isOnCombo(widget, 0) || isOnListViewHeader(widget, 0) || - isOnButton(widget, 0, 0L) - ? &qtSettings.colors[GTK_STATE_INSENSITIVE==state ? PAL_DISABLED : PAL_ACTIVE] - [COLOR_BUTTON_TEXT] - : &style->text[ARROW_STATE(state)]; - if(onComboEntry && GTK_STATE_ACTIVE==state && opts.unifyCombo) + gboolean combo=onComboEntry || isOnCombo(widget, 0); + int origState=state; + + if (combo && GTK_STATE_ACTIVE==state) + state=GTK_STATE_PRELIGHT; + + { + GdkColor *col=combo || isOnListViewHeader(widget, 0) || isOnButton(widget, 0, 0L) + ? &qtSettings.colors[GTK_STATE_INSENSITIVE==state ? PAL_DISABLED : PAL_ACTIVE] + [COLOR_BUTTON_TEXT] + : &style->text[ARROW_STATE(state)]; + if(onComboEntry && GTK_STATE_ACTIVE==origState && opts.unifyCombo) x--, y--; - drawArrow(WINDOW_PARAM_VAL style, MO_ARROW(false, col), AREA_PARAM_VAL_L, arrow_type, x+(width>>1), y+(height>>1), FALSE, TRUE); + drawArrow(window, style, MO_ARROW(false, col), area, arrow_type, x+(width>>1), y+(height>>1), FALSE, TRUE); + } } } else @@ -633,12 +653,12 @@ col=&style->text[GTK_STATE_SELECTED]; } - drawArrow(WINDOW_PARAM_VAL style, MO_ARROW(isMenuItem, col), AREA_PARAM_VAL_L, arrow_type, x, y, smallArrows, TRUE); + drawArrow(window, style, MO_ARROW(isMenuItem, col), area, arrow_type, x, y, smallArrows, TRUE); } } } -static void drawBox(GtkStyle *style, WINDOW_PARAM GtkStateType state, GtkShadowType shadow, GdkRectangle *area, GtkWidget *widget, +static void drawBox(GtkStyle *style, GdkWindow *window, GtkStateType state, GtkShadowType shadow, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height, gboolean btnDown) { gboolean sbar=isSbarDetail(detail), @@ -775,12 +795,12 @@ } else if(DETAIL("spinbutton")) { - if(IS_FLAT_BGND(opts.bgndAppearance) || !(widget && drawWindowBgnd(cr, style, area, GDKWINDOW, widget, x, y, width, height))) + if(IS_FLAT_BGND(opts.bgndAppearance) || !(widget && drawWindowBgnd(cr, style, area, window, widget, x, y, width, height))) { qtcStyleApplyDefBgnd(widget && !qtcWidgetNoWindow(widget), GTK_STATE_INSENSITIVE==state ? GTK_STATE_INSENSITIVE : GTK_STATE_NORMAL); if(widget && IMG_NONE!=opts.bgndImage.type) - drawWindowBgnd(cr, style, area, GDKWINDOW, widget, x, y, width, height); + drawWindowBgnd(cr, style, area, window, widget, x, y, width, height); } if(opts.unifySpin) @@ -801,7 +821,7 @@ a.x=x+2, a.y=y, a.width=width-2, a.height=height; setCairoClipping(cr, &a); } - drawEntryField(cr, style, state, GDKWINDOW, widget, area, x, y, width, height, rev ? ROUNDED_LEFT : ROUNDED_RIGHT, WIDGET_SPIN); + drawEntryField(cr, style, state, window, widget, area, x, y, width, height, rev ? ROUNDED_LEFT : ROUNDED_RIGHT, WIDGET_SPIN); #if !GTK_CHECK_VERSION(2, 90, 0) if(moz) #endif @@ -846,7 +866,7 @@ qtcWMMoveSetup(widget); if(GTK_IS_TOGGLE_BUTTON(widget)) - drawArrow(WINDOW_PARAM_VAL style, &qtcPalette.background[5], area, GTK_ARROW_RIGHT, + drawArrow(window, style, &qtcPalette.background[5], area, GTK_ARROW_RIGHT, x+width-((LARGE_ARR_WIDTH>>1)+4), y+((height-(LARGE_ARR_HEIGHT>>1))>>1)+1, FALSE, TRUE); } else if(detail &&( button || togglebutton || optionmenu || sbar || hscale || vscale || stepper || slider)) @@ -1024,15 +1044,26 @@ if(WIDGET_COMBO==widgetType && !opts.gtkComboMenus && !isMozilla() && ((parent=qtcWidgetGetParent(widget)) && GTK_IS_COMBO_BOX(parent) && !QTC_COMBO_ENTRY(parent))) { - GtkWidget *mapped=qtcWidgetMapGetWidget(parent, 1); - gboolean changedFocus=qtcComboBoxIsFocusChanged(widget); - qtcWidgetMapSetup(parent, widget, 0); + GtkWidget *mapped=NULL; + gboolean changedFocus=FALSE, + draw=TRUE; + int mod=7; - if(parent && qtcComboBoxIsHovered(parent)) - state=GTK_STATE_PRELIGHT; + if(!opts.gtkComboMenus && !qtcComboHasFrame(parent)) + mod=0, draw=GTK_STATE_ACTIVE==state || GTK_STATE_PRELIGHT==state, qtcComboBoxSetup(NULL, parent); + else + { + changedFocus=qtcComboBoxIsFocusChanged(widget); + mapped=qtcWidgetMapGetWidget(parent, 1); + qtcWidgetMapSetup(parent, widget, 0); - drawLightBevel(cr, style, state, area, x-7, y, width+7, height, &btnColors[bgnd], btnColors, round, - WIDGET_TOOLBAR_BUTTON, BORDER_FLAT, (GTK_STATE_ACTIVE==state ? DF_SUNKEN : 0)|DF_DO_BORDER, widget); + if(parent && qtcComboBoxIsHovered(parent)) + state=GTK_STATE_PRELIGHT; + } + + if(draw) + drawLightBevel(cr, style, state, area, x-mod, y, width+mod, height, &btnColors[bgnd], btnColors, round, + WIDGET_TOOLBAR_BUTTON, BORDER_FLAT, (GTK_STATE_ACTIVE==state ? DF_SUNKEN : 0)|DF_DO_BORDER, widget); if(mapped) { @@ -1083,7 +1114,7 @@ if(GTK_STATE_INSENSITIVE==state && entry && GTK_STATE_INSENSITIVE!=entryState) state=entryState; - drawEntryField(cr, style, state, GDKWINDOW, entry, area, x, y, width, height, rev ? ROUNDED_LEFT : ROUNDED_RIGHT, WIDGET_COMBO_BUTTON); + drawEntryField(cr, style, state, window, entry, area, x, y, width, height, rev ? ROUNDED_LEFT : ROUNDED_RIGHT, WIDGET_COMBO_BUTTON); // Get entry to redraw by setting its state... // ...cant do a queue redraw, as then entry does for the button, else we get stuck in a loop! @@ -1102,7 +1133,7 @@ GTK_IS_SCROLLED_WINDOW(qtcWidgetGetParent(widget)) && GTK_IS_NOTEBOOK(qtcWidgetGetParent(widget)->parent)) drawAreaModColor(cr, area, &qtcPalette.background[ORIGINAL_SHADE], TO_FACTOR(opts.tabBgnd), xo, yo, wo, ho); else if(IS_FLAT_BGND(opts.bgndAppearance) || !(opts.gtkScrollViews && IS_FLAT(opts.sbarBgndAppearance) && - widget && drawWindowBgnd(cr, style, area, GDKWINDOW, widget, xo, yo, wo, ho))) + widget && drawWindowBgnd(cr, style, area, window, widget, xo, yo, wo, ho))) { if(!IS_FLAT(opts.sbarBgndAppearance) && SCROLLBAR_NONE!=opts.scrollbarType) drawBevelGradient(cr, area, xo, yo, wo, ho, &qtcPalette.background[ORIGINAL_SHADE], @@ -1310,11 +1341,11 @@ : width>height; if(scale) - drawSliderGroove(cr, style, state, GDKWINDOW, widget, detail, AREA_PARAM_VAL_L, x, y, width, height, horiz); + drawSliderGroove(cr, style, state, window, widget, detail, area, x, y, width, height, horiz); else if(pbar) - drawProgressGroove(cr, style, state, GDKWINDOW, widget, AREA_PARAM_VAL_L, x, y, width, height, list, horiz); + drawProgressGroove(cr, style, state, window, widget, area, x, y, width, height, list, horiz); else - drawScrollbarGroove(cr, style, state, GDKWINDOW, widget, detail, AREA_PARAM_VAL_L, x, y, width, height, horiz); + drawScrollbarGroove(cr, style, state, window, widget, detail, area, x, y, width, height, horiz); } else if(DETAIL("entry-progress")) { @@ -1324,7 +1355,7 @@ else if(detail && (0==strcmp(detail,"dockitem") || 0==strcmp(detail,"dockitem_bin"))) { if(CUSTOM_BGND && widget) - drawWindowBgnd(cr, style, area, GDKWINDOW, widget, x, y, width, height); + drawWindowBgnd(cr, style, area, window, widget, x, y, width, height); } else if(widget && ( (detail && ( menubar || 0==strcmp(detail, "toolbar") || 0==strcmp(detail, "handlebox") || 0==strcmp(detail,"handlebox_bin") ) ) @@ -1352,8 +1383,8 @@ qtcWindowMenuBarDBus(widget, height); } - if(widget && (opacity!=100 || (CUSTOM_BGND && !drawGradient && !fillBackground))) - drawWindowBgnd(cr, style, area, GDKWINDOW, widget, x, y, width, height); + if(widget && (opacity!=100 || CUSTOM_BGND)) + drawWindowBgnd(cr, style, area, window, widget, x, y, width, height); if(drawGradient) { @@ -1387,7 +1418,7 @@ if(*detail == 'h') orientation = GTK_ORIENTATION_VERTICAL; - gtkDrawHandle(style, WINDOW_PARAM_VAL state, shadow, AREA_PARAM_VAL widget, detail, x, y, width, height, orientation); + gtkDrawHandle(style, window, state, shadow, area, widget, detail, x, y, width, height, orientation); } else if(detail && 0==strcmp(detail+1, "ruler")) { @@ -1410,11 +1441,7 @@ offset+=2; if(isMenuItem && (USE_LIGHTER_POPUP_MENU || opts.shadePopupMenu)) - cols=SHADE_WINDOW_BORDER==opts.shadeMenubars - ? qtcPalette.wborder[0] - : qtcPalette.menu - ? qtcPalette.menu - : qtcPalette.background; + cols=qtcPalette.menu; drawFadedLine(cr, x+1+offset, y+(height>>1), width-(1+offset), 1, &cols[isMenuItem ? MENU_SEP_SHADE : STD_BORDER], area, NULL, TRUE, TRUE, TRUE); @@ -1425,16 +1452,16 @@ { EWidget wt=!detail && GTK_IS_TREE_VIEW(widget) ? WIDGET_PBAR_TROUGH : WIDGET_FRAME; clipPath(cr, x+1, y+1, width-2, height-2, WIDGET_OTHER, RADIUS_INTERNAL, round); - if(IS_FLAT_BGND(opts.bgndAppearance) || !widget || !drawWindowBgnd(cr, style, area, GDKWINDOW, widget, x+1, y+1, width-2, height-2)) + if(IS_FLAT_BGND(opts.bgndAppearance) || !widget || !drawWindowBgnd(cr, style, area, window, widget, x+1, y+1, width-2, height-2)) { drawAreaColor(cr, area, &style->bg[state], x+1, y+1, width-2, height-2); if(widget && IMG_NONE!=opts.bgndImage.type) - drawWindowBgnd(cr, style, area, GDKWINDOW, widget, x, y, width, height); + drawWindowBgnd(cr, style, area, window, widget, x, y, width, height); } unsetCairoClipping(cr); if(WIDGET_PBAR_TROUGH==wt) - drawProgressGroove(cr, style, state, GDKWINDOW, widget, AREA_PARAM_VAL_L, x, y, width, height, TRUE, TRUE); + drawProgressGroove(cr, style, state, window, widget, area, x, y, width, height, TRUE, TRUE); else drawBorder(cr, style, state, area, x, y, width, height, NULL, menuScroll || opts.square&SQUARE_FRAME ? ROUNDED_NONE : ROUNDED_ALL, shadowToBorder(shadow), wt, STD_BORDER); @@ -1442,15 +1469,15 @@ CAIRO_END } -static void gtkDrawBox(GtkStyle *style, WINDOW_PARAM GtkStateType state, GtkShadowType shadow, AREA_PARAM +static void gtkDrawBox(GtkStyle *style, GdkWindow *window, GtkStateType state, GtkShadowType shadow, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height) { sanitizeSize(window, &width, &height); - drawBox(style, WINDOW_PARAM_VAL state, shadow, AREA_PARAM_VAL_L, widget, detail, x, y, width, height, + drawBox(style, window, state, shadow, area, widget, detail, x, y, width, height, GTK_STATE_ACTIVE==state || (GTK_IS_BUTTON(widget) && qtcButtonIsDepressed(widget))); } -static void gtkDrawShadow(GtkStyle *style, WINDOW_PARAM GtkStateType state, GtkShadowType shadow, AREA_PARAM GtkWidget *widget, +static void gtkDrawShadow(GtkStyle *style, GdkWindow *window, GtkStateType state, GtkShadowType shadow, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height) { sanitizeSize(window, &width, &height); @@ -1531,7 +1558,7 @@ drawLightBevel(cr, style, state, area, x, y, width+4, height, &btnColors[bgnd], btnColors, ROUNDED_LEFT, WIDGET_TOOLBAR_BUTTON, BORDER_FLAT, (sunken ? DF_SUNKEN : 0)|DF_DO_BORDER|(qtcComboBoxHasFocus(widget, mapped) ? DF_HAS_FOCUS : 0), widget); - + if(GTK_STATE_PRELIGHT!=state) { if(mapped && GTK_STATE_PRELIGHT==qtcWidgetGetState(mapped)) @@ -1589,7 +1616,7 @@ if(!opts.unifySpin && isSpin) width-=16; #endif - drawEntryField(cr, style, state, GDKWINDOW, widget, area, x, y, width, height, + drawEntryField(cr, style, state, window, widget, area, x, y, width, height, combo || isSpin ? rev ? ROUNDED_RIGHT @@ -1747,10 +1774,13 @@ switch(shadow) { case GTK_SHADOW_NONE: - cairo_new_path(cr); - cairo_rectangle(cr, x+0.5, y+0.5, width-1, height-1); - cairo_set_source_rgb(cr, CAIRO_COL(cols[STD_BORDER])); - cairo_stroke(cr); + if(!frame) + { + cairo_new_path(cr); + cairo_rectangle(cr, x+0.5, y+0.5, width-1, height-1); + cairo_set_source_rgb(cr, CAIRO_COL(cols[STD_BORDER])); + cairo_stroke(cr); + } break; case GTK_SHADOW_IN: case GTK_SHADOW_OUT: @@ -1810,7 +1840,7 @@ // return hovered; // } -static void gtkDrawCheck(GtkStyle *style, WINDOW_PARAM GtkStateType state, GtkShadowType shadow, AREA_PARAM GtkWidget *widget, +static void gtkDrawCheck(GtkStyle *style, GdkWindow *window, GtkStateType state, GtkShadowType shadow, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height) { CAIRO_BEGIN @@ -1818,7 +1848,7 @@ CAIRO_END } -static void gtkDrawOption(GtkStyle *style, WINDOW_PARAM GtkStateType state, GtkShadowType shadow, AREA_PARAM +static void gtkDrawOption(GtkStyle *style, GdkWindow *window, GtkStateType state, GtkShadowType shadow, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height) { CAIRO_BEGIN @@ -1828,11 +1858,11 @@ #define NUM_GCS 5 -static void gtkDrawLayout(GtkStyle *style, WINDOW_PARAM GtkStateType state, gboolean use_text, AREA_PARAM GtkWidget *widget, +static void gtkDrawLayout(GtkStyle *style, GdkWindow *window, GtkStateType state, gboolean use_text, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, PangoLayout *layout) { if(IS_PROGRESS) - qtcDrawLayout(style, WINDOW_PARAM_VAL state, use_text, AREA_PARAM_VAL x, y, layout); + drawLayout(style, window, state, use_text, area, x, y, layout); else { QtCurveStyle *qtcurveStyle=(QtCurveStyle *)style; @@ -1843,7 +1873,7 @@ #else gboolean activeMb=mb ? GTK_MENU_SHELL(mb)->active : FALSE; #endif - gboolean selectedText=opts.useHighlightForMenu && isMenuItem && + gboolean selectedText=(opts.useHighlightForMenu || opts.customMenuTextColor) && isMenuItem && (opts.colorMenubarMouseOver ? GTK_STATE_PRELIGHT==state : ((!mb || activeMb) && GTK_STATE_PRELIGHT==state)), @@ -1860,14 +1890,13 @@ GtkNotebook *nb=mb || isMenuItem || !GTK_IS_LABEL(widget) || !parent || !GTK_IS_NOTEBOOK(parent) ? NULL : GTK_NOTEBOOK(parent); #endif GdkColor prevColors[NUM_GCS]; - gboolean activeWindow=TRUE; int i=0; if(DEBUG_ALL==qtSettings.debug) printf(DEBUG_PREFIX "%s %s %d %d %d %d %d %s ", __FUNCTION__, pango_layout_get_text(layout), x, y, state, use_text, IS_MENU_ITEM(widget), detail ? detail : "NULL"), debugDisplayWidget(widget, 10); - if(DETAIL("cellrenderertext") && widget && GTK_STATE_INSENSITIVE==qtcWidgetState(widget)) + if(DETAIL("cellrenderertext") && widget && GTK_STATE_INSENSITIVE==qtcWidgetGetState(widget)) state=GTK_STATE_INSENSITIVE; #ifndef READ_INACTIVE_PAL /* If we reead the inactive palette, then there is no need for the following... */ @@ -1878,9 +1907,6 @@ state=GTK_STATE_SELECTED; #endif - if(opts.shadeMenubarOnlyWhenActive) - activeWindow=qtcWindowIsActive(gtk_widget_get_toplevel(widget)); - if(!isMenuItem && GTK_STATE_PRELIGHT==state) state=GTK_STATE_NORMAL; @@ -1921,7 +1947,9 @@ } else if(isMenuItem) { - if(/*opts.shadePopupMenu || */(mb && (activeWindow || SHADE_WINDOW_BORDER==opts.shadeMenubars))) + gboolean activeWindow=mb && opts.shadeMenubarOnlyWhenActive && widget ? qtcWindowIsActive(gtk_widget_get_toplevel(widget)) : TRUE; + + if((opts.shadePopupMenu && GTK_STATE_PRELIGHT==state) || (mb && (activeWindow || SHADE_WINDOW_BORDER==opts.shadeMenubars))) { if(SHADE_WINDOW_BORDER==opts.shadeMenubars) { @@ -2036,12 +2064,10 @@ if(!opts.useHighlightForMenu && (isMenuItem || mb) && GTK_STATE_INSENSITIVE!=state) state=GTK_STATE_NORMAL; - qtcDrawLayout(style, WINDOW_PARAM_VAL selectedText ? GTK_STATE_SELECTED : state, use_text || selectedText, AREA_PARAM_VAL - x, y, layout); + drawLayout(style, window, selectedText ? GTK_STATE_SELECTED : state, use_text || selectedText, area, x, y, layout); if(opts.embolden && def_but) - qtcDrawLayout(style, WINDOW_PARAM_VAL selectedText ? GTK_STATE_SELECTED : state, use_text || selectedText, AREA_PARAM_VAL - x+1, y, layout); + drawLayout(style, window, selectedText ? GTK_STATE_SELECTED : state, use_text || selectedText, area, x+1, y, layout); if(swapColors) for(i=0; i<5; ++i) @@ -2055,7 +2081,7 @@ return renderIcon(style, source, direction, state, size, widget, detail); } -static void gtkDrawTab(GtkStyle *style, WINDOW_PARAM GtkStateType state, GtkShadowType shadow, AREA_PARAM +static void gtkDrawTab(GtkStyle *style, GdkWindow *window, GtkStateType state, GtkShadowType shadow, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height) { QtCurveStyle *qtcurveStyle = (QtCurveStyle *)style; @@ -2079,14 +2105,14 @@ if(opts.doubleGtkComboArrow) { int pad=opts.vArrows ? 0 : 1; - drawArrow(WINDOW_PARAM_VAL style, arrowColor, AREA_PARAM_VAL_L, GTK_ARROW_UP, x, y+(height>>1)-(LARGE_ARR_HEIGHT-pad), FALSE, TRUE); - drawArrow(WINDOW_PARAM_VAL style, arrowColor, AREA_PARAM_VAL_L, GTK_ARROW_DOWN, x, y+(height>>1)+(LARGE_ARR_HEIGHT-pad), FALSE, TRUE); + drawArrow(window, style, arrowColor, area, GTK_ARROW_UP, x, y+(height>>1)-(LARGE_ARR_HEIGHT-pad), FALSE, TRUE); + drawArrow(window, style, arrowColor, area, GTK_ARROW_DOWN, x, y+(height>>1)+(LARGE_ARR_HEIGHT-pad), FALSE, TRUE); } else - drawArrow(WINDOW_PARAM_VAL style, arrowColor, AREA_PARAM_VAL_L, GTK_ARROW_DOWN, x, y+(height>>1), FALSE, TRUE); + drawArrow(window, style, arrowColor, area, GTK_ARROW_DOWN, x, y+(height>>1), FALSE, TRUE); } -static void gtkDrawBoxGap(GtkStyle *style, WINDOW_PARAM GtkStateType state, GtkShadowType shadow, AREA_PARAM +static void gtkDrawBoxGap(GtkStyle *style, GdkWindow *window, GtkStateType state, GtkShadowType shadow, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height, GtkPositionType gapSide, gint gapX, gint gapWidth) { @@ -2109,7 +2135,7 @@ CAIRO_END } -static void gtkDrawExtension(GtkStyle *style, WINDOW_PARAM GtkStateType state, GtkShadowType shadow, AREA_PARAM +static void gtkDrawExtension(GtkStyle *style, GdkWindow *window, GtkStateType state, GtkShadowType shadow, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height, GtkPositionType gapSide) { if(DEBUG_ALL==qtSettings.debug) printf(DEBUG_PREFIX "%s %d %d %d %d %d %d %d %s ", __FUNCTION__, state, shadow, gapSide, x, y, width, height, @@ -2126,10 +2152,10 @@ CAIRO_END } else - parent_class->draw_extension(style, WINDOW_PARAM_VAL state, shadow, AREA_PARAM_VAL widget, detail, x, y, width, height, gapSide); + parent_class->draw_extension(style, window, state, shadow, area, widget, detail, x, y, width, height, gapSide); } -static void gtkDrawSlider(GtkStyle *style, WINDOW_PARAM GtkStateType state, GtkShadowType shadow, AREA_PARAM +static void gtkDrawSlider(GtkStyle *style, GdkWindow *window, GtkStateType state, GtkShadowType shadow, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height, GtkOrientation orientation) { gboolean scrollbar=DETAIL("slider"), @@ -2197,7 +2223,7 @@ state=GTK_STATE_PRELIGHT; #endif - drawBox(style, WINDOW_PARAM_VAL state, shadow, area, widget, !scrollbar ? "qtc-slider" : "slider", x, y, width, height, FALSE); + drawBox(style, window, state, shadow, area, widget, !scrollbar ? "qtc-slider" : "slider", x, y, width, height, FALSE); /* Orientation is always vertical with Mozilla, why? Anyway this hack should be OK - as we only draw dashes when slider is larger than 'min' pixels... */ @@ -2244,7 +2270,7 @@ CAIRO_END } -static void gtkDrawShadowGap(GtkStyle *style, WINDOW_PARAM GtkStateType state, GtkShadowType shadow, AREA_PARAM +static void gtkDrawShadowGap(GtkStyle *style, GdkWindow *window, GtkStateType state, GtkShadowType shadow, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height, GtkPositionType gapSide, gint gapX, gint gapWidth) { @@ -2254,7 +2280,7 @@ CAIRO_END } -static void gtkDrawHLine(GtkStyle *style, WINDOW_PARAM GtkStateType state, AREA_PARAM GtkWidget *widget, +static void gtkDrawHLine(GtkStyle *style, GdkWindow *window, GtkStateType state, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x1, gint x2, gint y) { gboolean tbar=DETAIL("toolbar"); @@ -2309,11 +2335,7 @@ offset+=2; if(USE_LIGHTER_POPUP_MENU || opts.shadePopupMenu) - cols=SHADE_WINDOW_BORDER==opts.shadeMenubars - ? qtcPalette.wborder[0] - : qtcPalette.menu - ? qtcPalette.menu - : qtcPalette.background; + cols=qtcPalette.menu; if(offset && isFakeGtk()) offset+=2; @@ -2328,7 +2350,7 @@ CAIRO_END } -static void gtkDrawVLine(GtkStyle *style, WINDOW_PARAM GtkStateType state, AREA_PARAM GtkWidget *widget, +static void gtkDrawVLine(GtkStyle *style, GdkWindow *window, GtkStateType state, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint y1, gint y2, gint x) { FN_CHECK @@ -2371,7 +2393,7 @@ CAIRO_END } -static void gtkDrawFocus(GtkStyle *style, WINDOW_PARAM GtkStateType state, AREA_PARAM GtkWidget *widget, const gchar *detail, +static void gtkDrawFocus(GtkStyle *style, GdkWindow *window, GtkStateType state, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height) { if(GTK_IS_EDITABLE(widget)) @@ -2504,7 +2526,7 @@ return; if(FOCUS_STANDARD==opts.focus) - parent_class->draw_focus(style, WINDOW_PARAM_VAL state, AREA_PARAM_VAL widget, detail, x, y, width, height); + parent_class->draw_focus(style, window, state, area, widget, detail, x, y, width, height); else { gboolean drawRounded=ROUNDED; @@ -2604,7 +2626,7 @@ } } -static void gtkDrawResizeGrip(GtkStyle *style, WINDOW_PARAM GtkStateType state, AREA_PARAM GtkWidget *widget, +static void gtkDrawResizeGrip(GtkStyle *style, GdkWindow *window, GtkStateType state, GdkRectangle *area, GtkWidget *widget, const gchar *detail, GdkWindowEdge edge, gint x, gint y, gint width, gint height) { FN_CHECK @@ -2613,11 +2635,11 @@ int size=SIZE_GRIP_SIZE-2; /* Clear background */ - if(IS_FLAT_BGND(opts.bgndAppearance) || !(widget && drawWindowBgnd(cr, style, area, GDKWINDOW, widget, x, y, width, height))) + if(IS_FLAT_BGND(opts.bgndAppearance) || !(widget && drawWindowBgnd(cr, style, area, window, widget, x, y, width, height))) { // gtk_style_apply_default_background(style, window, FALSE, state, area, x, y, width, height); if(widget && IMG_NONE!=opts.bgndImage.type) - drawWindowBgnd(cr, style, area, GDKWINDOW, widget, x, y, width, height); + drawWindowBgnd(cr, style, area, window, widget, x, y, width, height); } switch(edge) @@ -2630,7 +2652,7 @@ GdkPoint a[]={{ x+width, (y+height)-size}, { x+width, y+height}, {(x+width)-size, y+height}}; - drawPolygon(WINDOW_PARAM_VAL style, &qtcPalette.background[2], area, a, 3, TRUE); + drawPolygon(window, style, &qtcPalette.background[2], area, a, 3, TRUE); break; } case GDK_WINDOW_EDGE_SOUTH_WEST: @@ -2638,7 +2660,7 @@ GdkPoint a[]={{(x+width)-size, (y+height)-size}, { x+width, y+height}, {(x+width)-size, y+height}}; - drawPolygon(WINDOW_PARAM_VAL style, &qtcPalette.background[2], area, a, 3, TRUE); + drawPolygon(window, style, &qtcPalette.background[2], area, a, 3, TRUE); break; } case GDK_WINDOW_EDGE_NORTH_EAST: @@ -2646,13 +2668,13 @@ case GDK_WINDOW_EDGE_NORTH_WEST: // TODO!! default: - parent_class->draw_resize_grip(style, WINDOW_PARAM_VAL state, AREA_PARAM_VAL widget, detail, edge, x, y, width, height); + parent_class->draw_resize_grip(style, window, state, area, widget, detail, edge, x, y, width, height); } CAIRO_END } -static void gtkDrawExpander(GtkStyle *style, WINDOW_PARAM GtkStateType state, AREA_PARAM GtkWidget *widget, +static void gtkDrawExpander(GtkStyle *style, GdkWindow *window, GtkStateType state, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, GtkExpanderStyle expander_style) { if(DEBUG_ALL==qtSettings.debug) printf(DEBUG_PREFIX "%s %d %s ", __FUNCTION__, state, detail ? detail : "NULL"), @@ -2669,10 +2691,10 @@ y-=(LV_SIZE/2.0)+0.5; if(GTK_EXPANDER_COLLAPSED==expander_style) - drawArrow(WINDOW_PARAM_VAL style, col, AREA_PARAM_VAL_L, reverseLayout(widget) ? GTK_ARROW_LEFT : GTK_ARROW_RIGHT, + drawArrow(window, style, col, area, reverseLayout(widget) ? GTK_ARROW_LEFT : GTK_ARROW_RIGHT, x+(LARGE_ARR_WIDTH>>1), y+LARGE_ARR_HEIGHT, FALSE, fill); else - drawArrow(WINDOW_PARAM_VAL style, col, AREA_PARAM_VAL_L, GTK_ARROW_DOWN, x+(LARGE_ARR_WIDTH>>1), y+LARGE_ARR_HEIGHT, FALSE, fill); + drawArrow(window, style, col, area, GTK_ARROW_DOWN, x+(LARGE_ARR_WIDTH>>1), y+LARGE_ARR_HEIGHT, FALSE, fill); } static void styleRealize(GtkStyle *style) @@ -2881,8 +2903,9 @@ #if !GTK_CHECK_VERSION(2, 90, 0) /* Gtk3:TODO !!! */ if(opts.dlgOpacity<100 || opts.bgndOpacity<100 || opts.menuBgndOpacity<100 || qtSettings.useAlpha) { - GdkColormap *colormap = gdk_screen_get_rgba_colormap(gdk_screen_get_default()); - + GdkScreen *screen = gdk_screen_get_default(); + GdkColormap *colormap = screen ? gdk_screen_get_rgba_colormap(screen) : NULL; + if (colormap) { gtk_widget_push_colormap(colormap); diff -Nru gtk2-engines-qtcurve-1.8.3~ppa1/style/qt_settings.c gtk2-engines-qtcurve-1.8.6~ppa1/style/qt_settings.c --- gtk2-engines-qtcurve-1.8.3~ppa1/style/qt_settings.c 2010-12-16 22:43:18.000000000 +0000 +++ gtk2-engines-qtcurve-1.8.6~ppa1/style/qt_settings.c 2011-02-15 19:39:15.000000000 +0000 @@ -2429,8 +2429,6 @@ g_object_set(settings, "gtk-alternative-button-order", TRUE, NULL); gtk_settings_set_long_property(settings, "gtk-menu-popup-delay", opts.menuDelay, "KDE-Settings"); - if(opts.hideShortcutUnderline && NULL==gtk_check_version(2, 20, 0)) - g_object_set(settings, "gtk-auto-mnemonics", TRUE, NULL); } if(qtSettings.fonts[FONT_GENERAL]) @@ -2817,7 +2815,10 @@ } if(!opts.menuIcons) - gtk_rc_parse_string("gtk-menu-images = 0"); + gtk_rc_parse_string("gtk-menu-images=0"); + + if(opts.hideShortcutUnderline) + gtk_rc_parse_string("gtk-auto-mnemonics=1"); if(LINE_1DOT==opts.splitters) gtk_rc_parse_string("style \""RC_SETTING"Spl\" { GtkPaned::handle_size=7 GtkPaned::handle_width = 7 } " diff -Nru gtk2-engines-qtcurve-1.8.3~ppa1/style/tab.c gtk2-engines-qtcurve-1.8.6~ppa1/style/tab.c --- gtk2-engines-qtcurve-1.8.3~ppa1/style/tab.c 2010-12-16 22:43:18.000000000 +0000 +++ gtk2-engines-qtcurve-1.8.6~ppa1/style/tab.c 2011-02-15 19:39:15.000000000 +0000 @@ -379,8 +379,12 @@ for(i = 0; ipath, path)) { @@ -261,4 +261,45 @@ } } +gboolean qtcTreeViewCellIsLeftOfExpanderColumn(GtkTreeView *treeView, GtkTreeViewColumn *column) +{ + // check expander column + GtkTreeViewColumn *expanderColumn=gtk_tree_view_get_expander_column(treeView); + + if(!expanderColumn || column == expanderColumn) + return FALSE; + else + { + gboolean found=FALSE, + isLeft=FALSE; + + // get all columns + GList *columns=gtk_tree_view_get_columns(treeView), + *child; + + for(child = g_list_first(columns); child; child = g_list_next(child)) + { + if(!GTK_IS_TREE_VIEW_COLUMN(child->data)) + continue; + else + { + GtkTreeViewColumn *childCol=GTK_TREE_VIEW_COLUMN(child->data); + if(childCol == expanderColumn) + { + if(found) + isLeft = TRUE; + } + else if(found) + break; + else if(column == childCol) + found = TRUE; + } + } + + if(columns) + g_list_free(columns); + return isLeft; + } +} + #endif // GTK_CHECK_VERSION(2, 12, 0) diff -Nru gtk2-engines-qtcurve-1.8.3~ppa1/style/treeview.h gtk2-engines-qtcurve-1.8.6~ppa1/style/treeview.h --- gtk2-engines-qtcurve-1.8.3~ppa1/style/treeview.h 2010-12-16 22:43:18.000000000 +0000 +++ gtk2-engines-qtcurve-1.8.6~ppa1/style/treeview.h 2011-02-15 19:39:15.000000000 +0000 @@ -24,5 +24,6 @@ extern void qtcTreeViewGetCell(GtkTreeView *treeView, GtkTreePath **path, GtkTreeViewColumn **column, int x, int y, int width, int height); extern void qtcTreeViewSetup(GtkWidget *widget); extern gboolean qtcTreeViewIsCellHovered(GtkWidget *widget, GtkTreePath *path, GtkTreeViewColumn *column); +extern gboolean qtcTreeViewCellIsLeftOfExpanderColumn(GtkTreeView *treeView, GtkTreeViewColumn *column); #endif diff -Nru gtk2-engines-qtcurve-1.8.3~ppa1/style/wmmove.c gtk2-engines-qtcurve-1.8.6~ppa1/style/wmmove.c --- gtk2-engines-qtcurve-1.8.3~ppa1/style/wmmove.c 2010-12-16 22:43:18.000000000 +0000 +++ gtk2-engines-qtcurve-1.8.6~ppa1/style/wmmove.c 2011-02-15 19:39:15.000000000 +0000 @@ -35,6 +35,32 @@ static int qtcWMMoveLastY=-1; static int qtcWMMoveTimer=0; static GtkWidget *qtcWMMoveDragWidget=NULL; +//! keep track of the last rejected button event to reject it again if passed to some parent widget +/*! this spares some time (by not processing the same event twice), and prevents some bugs */ + GdkEventButton *qtcWMMoveLastRejectedEvent=NULL; + +static int qtcWMMoveBtnReleaseSignalId=0; +static int qtcWMMoveBtnReleaseHookId=0; + +static gboolean qtcWMMoveDragEnd(); + +static gboolean qtcWMMoveBtnReleaseHook(GSignalInvocationHint *a, guint b, const GValue *c, gpointer d) +{ + if(qtcWMMoveDragWidget) + qtcWMMoveDragEnd(); + return TRUE; +} + +static qtcWMMoveRegisterBtnReleaseHook() +{ + if(0==qtcWMMoveBtnReleaseSignalId && 0==qtcWMMoveBtnReleaseHookId) + { + qtcWMMoveBtnReleaseSignalId = g_signal_lookup("button-release-event", GTK_TYPE_WIDGET); + if(qtcWMMoveBtnReleaseSignalId) + qtcWMMoveBtnReleaseHookId = g_signal_add_emission_hook(qtcWMMoveBtnReleaseSignalId, + (GQuark)0L, qtcWMMoveBtnReleaseHook, 0L, 0L); + } +} static void qtcWMMoveStopTimer() { @@ -48,6 +74,7 @@ qtcWMMoveLastX=-1; qtcWMMoveLastY=-1; qtcWMMoveDragWidget=NULL; + qtcWMMoveLastRejectedEvent=NULL; qtcWMMoveStopTimer(); } @@ -58,8 +85,6 @@ qtcWMMoveDragWidget=widget; } -static gboolean qtcWMMoveButtonRelease(GtkWidget *widget, GdkEventButton *event, gpointer user_data); - static void qtcWMMoveTrigger(GtkWidget *w, int x, int y) { XEvent xev; @@ -82,33 +107,53 @@ XSendEvent(GDK_DISPLAY_XDISPLAY(display), GDK_WINDOW_XID(root), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev); /* force a release as some widgets miss it... */ - qtcWMMoveButtonRelease(w, NULL, NULL); + qtcWMMoveDragEnd(w); } static gboolean qtcWMMoveWithinWidget(GtkWidget *widget, GdkEventButton *event) { - GdkWindow *window = gtk_widget_get_parent_window(widget); + // get top level widget + GtkWidget *topLevel=gtk_widget_get_toplevel(widget);; + GdkWindow *window = topLevel ? gtk_widget_get_window(topLevel) : NULL; if(window) { - GtkAllocation alloc=GTK_IS_NOTEBOOK(widget) ? qtcTabGetTabbarRect(GTK_NOTEBOOK(widget)) : qtcWidgetGetAllocation(widget); - int nx=0, - ny=0; + GtkAllocation allocation; + int wx=0, wy=0, nx=0, ny=0; + + // translate widget position to topLevel + gtk_widget_translate_coordinates(widget, topLevel, wx, wy, &wx, &wy); - // Need to get absolute co-ordinates... + // translate to absolute coordinates gdk_window_get_origin(window, &nx, &ny); - alloc.x+=nx; - alloc.y+=ny; + wx += nx; + wy += ny; - return alloc.x<=event->x_root && alloc.y<=event->y_root && - (alloc.x+alloc.width)>event->x_root &&(alloc.y+alloc.height)>event->y_root; + // get widget size. + // for notebooks, only consider the tabbar rect + if(GTK_IS_NOTEBOOK(widget)) + { + GtkAllocation widgetAlloc=qtcWidgetGetAllocation(widget); + allocation=qtcTabGetTabbarRect(GTK_NOTEBOOK(widget)); + allocation.x += wx - widgetAlloc.x; + allocation.y += wy - widgetAlloc.y; + } + else + { + allocation = qtcWidgetGetAllocation(widget); + allocation.x = wx; + allocation.y = wy; + } + + return allocation.x<=event->x_root && allocation.y<=event->y_root && + (allocation.x+allocation.width)>event->x_root &&(allocation.y+allocation.height)>event->y_root; } return TRUE; } -static gboolean isBlackListed(GObject *object) +static gboolean qtcWMMoveIsBlackListed(GObject *object) { - static const char *widgets[]={ "GtkPizza", "GladeDesignLayout", "MetaFrames" , 0 }; + static const char *widgets[]={ "GtkPizza", "GladeDesignLayout", "MetaFrames", "SPHRuler", "SPVRuler", 0 }; int i; @@ -132,7 +177,8 @@ // cast child to GtkWidget if(GTK_IS_WIDGET(child->data)) { - GtkWidget* childWidget=GTK_WIDGET(child->data); + GtkWidget *childWidget=GTK_WIDGET(child->data); + GdkWindow *window=NULL; // check widget state and type if(GTK_STATE_PRELIGHT==qtcWidgetGetState(childWidget)) @@ -140,45 +186,29 @@ // if widget is prelight, we don't need to check where event happen, // any prelight widget indicate we can't do a move usable = FALSE; + continue; } - else if(GTK_IS_NOTEBOOK( childWidget ) ) - { - inNoteBook = TRUE; - } - else if(event && qtcWMMoveWithinWidget(childWidget, event)) + + window = gtk_widget_get_window(childWidget); + if(!(window && gdk_window_is_visible(window))) + continue; + + if(GTK_IS_NOTEBOOK(childWidget)) + inNoteBook = true; + + if(!(event && qtcWMMoveWithinWidget(childWidget, event))) + continue; + + // check special cases for which grab should not be enabled + if( + (qtcWMMoveIsBlackListed(G_OBJECT(childWidget))) || + (GTK_IS_NOTEBOOK(widget) && qtcTabIsLabel(GTK_NOTEBOOK(widget), childWidget)) || + (GTK_IS_BUTTON(childWidget) && qtcWidgetGetState(childWidget) != GTK_STATE_INSENSITIVE) || + (gtk_widget_get_events(childWidget) & (GDK_BUTTON_PRESS_MASK|GDK_BUTTON_RELEASE_MASK)) || + (GTK_IS_MENU_ITEM(childWidget)) || + (GTK_IS_SCROLLED_WINDOW(childWidget) && (!inNoteBook || gtk_widget_is_focus(childWidget)))) { - GdkWindow *window = gtk_widget_get_window(childWidget); - if(window && gdk_window_is_visible(window)) - { - // TODO: one could probably check here whether widget is enabled or not, - // and accept if widget is disabled. - if(isBlackListed(G_OBJECT(childWidget))) - { - usable = FALSE; - } - else if(GTK_IS_BUTTON(childWidget) && qtcWidgetGetState(childWidget)!=GTK_STATE_INSENSITIVE) - { - usable = false; - } - else if(gtk_widget_get_events(childWidget)&(GDK_BUTTON_PRESS_MASK|GDK_BUTTON_RELEASE_MASK)) - { - // widget listening to press event - usable = FALSE; - } - else if(GTK_IS_MENU_ITEM(childWidget)) - { - // deal with menu item, GtkMenuItem only listen to - // GDK_BUTTON_PRESS_MASK when state == GTK_STATE_PRELIGHT - // so previous check are invalids :( - usable = FALSE; - } - else if(GTK_IS_SCROLLED_WINDOW(childWidget) && (!inNoteBook || gtk_widget_is_focus( childWidget))) - { - // Scrolled do not send release events - // to parents so not usable - usable = FALSE; - } - } + usable = false; } // if child is a container and event has been accepted so far, also check it, recursively @@ -195,14 +225,17 @@ static gboolean qtcWMMoveUseEvent(GtkWidget *widget, GdkEventButton *event) { + if(qtcWMMoveLastRejectedEvent && qtcWMMoveLastRejectedEvent==event) + return FALSE; + if(!GTK_IS_CONTAINER(widget)) return TRUE; // if widget is a notebook, accept if there is no hovered tab if(GTK_IS_NOTEBOOK(widget)) return !qtcTabHasVisibleArrows(GTK_NOTEBOOK(widget)) && -1==qtcTabCurrentHoveredIndex(widget) && qtcWMMoveChildrenUseEvent(widget, event, FALSE); - - return qtcWMMoveChildrenUseEvent(widget, event, FALSE); + else + return qtcWMMoveChildrenUseEvent(widget, event, FALSE); } static gboolean qtcWWMoveStartDelayedDrag(gpointer data) @@ -221,6 +254,7 @@ qtcWMMoveTimer=g_timeout_add(qtSettings.startDragTime, (GSourceFunc)qtcWWMoveStartDelayedDrag, NULL); return TRUE; } + qtcWMMoveLastRejectedEvent=event; return FALSE; } @@ -235,11 +269,11 @@ return FALSE; } -static gboolean qtcWMMoveDragEnd(GtkWidget *widget) +static gboolean qtcWMMoveDragEnd() { - if (widget==qtcWMMoveDragWidget) + if (qtcWMMoveDragWidget) { - gtk_grab_remove(widget); + //gtk_grab_remove(widget); gdk_pointer_ungrab(CurrentTime); qtcWMMoveReset(); return TRUE; @@ -248,11 +282,6 @@ return FALSE; } -static gboolean qtcWMMoveButtonRelease(GtkWidget *widget, GdkEventButton *event, gpointer user_data) -{ - return qtcWMMoveDragEnd(widget); -} - static void qtcWMMoveCleanup(GtkWidget *widget) { if (g_object_get_data(G_OBJECT(widget), "QTC_WM_MOVE_HACK_SET")) @@ -269,8 +298,6 @@ (gint)g_object_steal_data(G_OBJECT(widget), "QTC_WM_MOVE_STYLE_SET_ID")); g_signal_handler_disconnect(G_OBJECT(widget), (gint)g_object_steal_data(G_OBJECT(widget), "QTC_WM_MOVE_BUTTON_PRESS_ID")); - g_signal_handler_disconnect(G_OBJECT(widget), - (gint)g_object_steal_data(G_OBJECT(widget), "QTC_WM_MOVE_BUTTON_RELEASE_ID")); g_object_steal_data(G_OBJECT(widget), "QTC_WM_MOVE_HACK_SET"); } } @@ -308,7 +335,7 @@ static gboolean qtcWMMoveLeave(GtkWidget *widget, GdkEventMotion *event, gpointer user_data) { - return qtcWMMoveDragEnd(widget); + return qtcWMMoveDragEnd(); } void qtcWMMoveSetup(GtkWidget *widget) @@ -327,9 +354,20 @@ if(GTK_IS_NOTEBOOK(parent) && qtcTabIsLabel(GTK_NOTEBOOK(parent), widget)) return; + /* + check event mask (for now we only need to do that for GtkWindow) + The idea is that if the window has been set to recieve button_press and button_release events + (which is not done by default), it likely means that it does something with such events, + in which case we should not use them for grabbing + */ + if(0==strcmp(g_type_name(qtcWidgetType(widget)), "GtkWindow") && + (gtk_widget_get_events(widget) & (GDK_BUTTON_PRESS_MASK|GDK_BUTTON_RELEASE_MASK) ) ) + return; + if (widget && !isFakeGtk() && !g_object_get_data(G_OBJECT(widget), "QTC_WM_MOVE_HACK_SET")) { gtk_widget_add_events(widget, GDK_BUTTON_RELEASE_MASK|GDK_BUTTON_PRESS_MASK|GDK_LEAVE_NOTIFY_MASK|GDK_BUTTON1_MOTION_MASK); + qtcWMMoveRegisterBtnReleaseHook(); g_object_set_data(G_OBJECT(widget), "QTC_WM_MOVE_HACK_SET", (gpointer)1); g_object_set_data(G_OBJECT(widget), "QTC_WM_MOVE_MOTION_ID", (gpointer)g_signal_connect(G_OBJECT(widget), "motion-notify-event", G_CALLBACK(qtcWMMoveMotion), NULL)); @@ -341,7 +379,5 @@ (gpointer)g_signal_connect(G_OBJECT(widget), "style-set", G_CALLBACK(qtcWMMoveStyleSet), NULL)); g_object_set_data(G_OBJECT(widget), "QTC_WM_MOVE_BUTTON_PRESS_ID", (gpointer)g_signal_connect(G_OBJECT(widget), "button-press-event", G_CALLBACK(qtcWMMoveButtonPress), widget)); - g_object_set_data(G_OBJECT(widget), "QTC_WM_MOVE_BUTTON_RELEASE_ID", - (gpointer)g_signal_connect(G_OBJECT(widget), "button-release-event", G_CALLBACK(qtcWMMoveButtonRelease), widget)); } }