aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti2013-03-20 14:22:02 (EDT)
committerCarolyn MacLeod2013-04-09 10:56:46 (EDT)
commit5d04592d2679fae964a79278571d01aa1543fae7 (patch)
treefaaa68da8054f53ce19144d2f318d24f4447f99a
parent7d667984c27290eaffb9812a29939951ffc7f1f5 (diff)
downloadeclipse.platform.swt-5d04592d2679fae964a79278571d01aa1543fae7.zip
eclipse.platform.swt-5d04592d2679fae964a79278571d01aa1543fae7.tar.gz
eclipse.platform.swt-5d04592d2679fae964a79278571d01aa1543fae7.tar.bz2
Bug 399560 - [GTK3] CoolBar item handles only shown when CoolBar style includes SWT.FLAT
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/emulated/coolbar/org/eclipse/swt/widgets/CoolBar.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Control.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Control.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Control.java2
8 files changed, 14 insertions, 11 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
index 08d9de9..567d22c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
@@ -566,6 +566,7 @@ public class OS extends C {
public static final byte[] GTK_STYLE_CLASS_TOOLTIP = ascii("tooltip");
public static final byte[] GTK_STYLE_CLASS_VIEW = ascii("view");
public static final byte[] GTK_STYLE_CLASS_CELL = ascii("cell");
+ public static final byte[] GTK_STYLE_CLASS_PANE_SEPARATOR = ascii("pane-separator");
/** Properties */
public static final byte[] active = ascii("active");
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java
index 6369e78..9897762 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java
@@ -897,7 +897,7 @@ boolean drawFocusRing () {
return hasBorder ();
}
-boolean drawGripper (int x, int y, int width, int height, boolean vertical) {
+boolean drawGripper (GC gc, int x, int y, int width, int height, boolean vertical) {
return false;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
index 2e723aa..f7dabc4 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
@@ -1219,7 +1219,7 @@ boolean dragDetect (int x, int y, boolean filter, boolean [] consume) {
return dragging;
}
-boolean drawGripper (int x, int y, int width, int height, boolean vertical) {
+boolean drawGripper (GC gc, int x, int y, int width, int height, boolean vertical) {
return false;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/emulated/coolbar/org/eclipse/swt/widgets/CoolBar.java b/bundles/org.eclipse.swt/Eclipse SWT/emulated/coolbar/org/eclipse/swt/widgets/CoolBar.java
index a427a10..f5b7f75 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/emulated/coolbar/org/eclipse/swt/widgets/CoolBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/emulated/coolbar/org/eclipse/swt/widgets/CoolBar.java
@@ -711,7 +711,7 @@ void onPaint(Event event) {
/* Draw gripper. */
if (!isLocked) {
rect = fixRectangle(bounds.x, bounds.y, CoolItem.MINIMUM_WIDTH, bounds.height);
- if (!flat) nativeGripper = drawGripper(rect.x, rect.y, rect.width, rect.height, vertical);
+ if (!flat) nativeGripper = drawGripper(gc, rect.x, rect.y, rect.width, rect.height, vertical);
if (!nativeGripper) {
int grabberTrim = 2;
int grabberHeight = bounds.height - (2 * grabberTrim) - 1;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
index c929cf0..ad27691 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
@@ -159,17 +159,19 @@ void drawBackground (Control control, long /*int*/ window, long /*int*/ cr, long
OS.g_object_unref (gdkGC);
}
-boolean drawGripper (int x, int y, int width, int height, boolean vertical) {
+boolean drawGripper (GC gc, int x, int y, int width, int height, boolean vertical) {
long /*int*/ paintHandle = paintHandle ();
long /*int*/ window = gtk_widget_get_window (paintHandle);
if (window == 0) return false;
int orientation = vertical ? OS.GTK_ORIENTATION_HORIZONTAL : OS.GTK_ORIENTATION_VERTICAL;
if ((style & SWT.MIRRORED) != 0) x = getClientWidth () - width - x;
if (OS.GTK3) {
- long /*int*/ cairo = OS.gdk_cairo_create (window);
- long /*int*/ context = OS.gtk_widget_get_style_context(paintHandle);
- OS.gtk_render_handle(context, cairo, x, y, width, height);
- Cairo.cairo_destroy (cairo);
+ long /*int*/ context = OS.gtk_widget_get_style_context (paintHandle);
+ OS.gtk_style_context_save (context);
+ OS.gtk_style_context_add_class (context, OS.GTK_STYLE_CLASS_PANE_SEPARATOR);
+ OS.gtk_style_context_set_state (context, OS.GTK_STATE_FLAG_NORMAL);
+ OS.gtk_render_handle (context, gc.handle, x, y, width, height);
+ OS.gtk_style_context_restore (context);
} else {
OS.gtk_paint_handle (OS.gtk_widget_get_style (paintHandle), window, OS.GTK_STATE_NORMAL, OS.GTK_SHADOW_OUT, null, paintHandle, new byte [1], x, y, width, height, orientation);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Control.java
index 13f9e37..d19c9e1 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Control.java
@@ -787,7 +787,7 @@ boolean dragDetect (int button, int count, int stateMask, int x, int y) {
boolean dragDetect (int x, int y, boolean force, boolean [] consume) {
return true;
}
-boolean drawGripper (int x, int y, int width, int height, boolean vertical) {
+boolean drawGripper (GC gc, int x, int y, int width, int height, boolean vertical) {
return false;
}
void enableWidget (boolean enabled) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Control.java
index 961b385..72eddfb 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Control.java
@@ -658,7 +658,7 @@ int defaultForeground () {
return display.WIDGET_FOREGROUND;
}
-boolean drawGripper (int x, int y, int width, int height, boolean vertical) {
+boolean drawGripper (GC gc, int x, int y, int width, int height, boolean vertical) {
return false;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Control.java
index 28500a5..322bcfe 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Control.java
@@ -843,7 +843,7 @@ void enableWidget (boolean enabled) {
OS.UIElement_IsEnabled (handle, enabled);
}
-boolean drawGripper (int x, int y, int width, int height, boolean vertical) {
+boolean drawGripper (GC gc, int x, int y, int width, int height, boolean vertical) {
return false;
}