mirror of https://github.com/GNOME/gimp.git
app: port to GtkWidget::draw()
This commit is contained in:
parent
691069947f
commit
8f8d62167d
|
@ -44,8 +44,8 @@ static void gimp_handle_bar_get_property (GObject *object,
|
|||
GValue *value,
|
||||
GParamSpec *pspec);
|
||||
|
||||
static gboolean gimp_handle_bar_expose (GtkWidget *widget,
|
||||
GdkEventExpose *eevent);
|
||||
static gboolean gimp_handle_bar_draw (GtkWidget *widget,
|
||||
cairo_t *cr);
|
||||
static gboolean gimp_handle_bar_button_press (GtkWidget *widget,
|
||||
GdkEventButton *bevent);
|
||||
static gboolean gimp_handle_bar_button_release (GtkWidget *widget,
|
||||
|
@ -71,7 +71,7 @@ gimp_handle_bar_class_init (GimpHandleBarClass *klass)
|
|||
object_class->set_property = gimp_handle_bar_set_property;
|
||||
object_class->get_property = gimp_handle_bar_get_property;
|
||||
|
||||
widget_class->expose_event = gimp_handle_bar_expose;
|
||||
widget_class->draw = gimp_handle_bar_draw;
|
||||
widget_class->button_press_event = gimp_handle_bar_button_press;
|
||||
widget_class->button_release_event = gimp_handle_bar_button_release;
|
||||
widget_class->motion_notify_event = gimp_handle_bar_motion_notify;
|
||||
|
@ -141,12 +141,11 @@ gimp_handle_bar_get_property (GObject *object,
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gimp_handle_bar_expose (GtkWidget *widget,
|
||||
GdkEventExpose *eevent)
|
||||
gimp_handle_bar_draw (GtkWidget *widget,
|
||||
cairo_t *cr)
|
||||
{
|
||||
GimpHandleBar *bar = GIMP_HANDLE_BAR (widget);
|
||||
GtkAllocation allocation;
|
||||
cairo_t *cr;
|
||||
gint x, y;
|
||||
gint width, height;
|
||||
gint i;
|
||||
|
@ -158,16 +157,6 @@ gimp_handle_bar_expose (GtkWidget *widget,
|
|||
width = allocation.width - 2 * x;
|
||||
height = allocation.height - 2 * y;
|
||||
|
||||
if (! gtk_widget_get_has_window (widget))
|
||||
{
|
||||
x += allocation.x;
|
||||
y += allocation.y;
|
||||
}
|
||||
|
||||
cr = gdk_cairo_create (gtk_widget_get_window (widget));
|
||||
gdk_cairo_region (cr, eevent->region);
|
||||
cairo_clip (cr);
|
||||
|
||||
cairo_set_line_width (cr, 1.0);
|
||||
cairo_translate (cr, 0.5, 0.5);
|
||||
|
||||
|
@ -210,8 +199,6 @@ gimp_handle_bar_expose (GtkWidget *widget,
|
|||
}
|
||||
}
|
||||
|
||||
cairo_destroy (cr);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue