[gimp/gtk3-port: 82/231] app: port the colormap editor to GTK+ 3.0
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gtk3-port: 82/231] app: port the colormap editor to GTK+ 3.0
- Date: Sun, 13 Dec 2015 18:43:25 +0000 (UTC)
commit 1be4befe818721b79367e59cceffb63a3d72ab86
Author: Michael Natterer <mitch gimp org>
Date: Thu Oct 28 02:30:42 2010 +0200
app: port the colormap editor to GTK+ 3.0
app/widgets/gimpcolormapeditor.c | 28 ++++++++--------------------
1 files changed, 8 insertions(+), 20 deletions(-)
---
diff --git a/app/widgets/gimpcolormapeditor.c b/app/widgets/gimpcolormapeditor.c
index 4c56076..0fcbcdd 100644
--- a/app/widgets/gimpcolormapeditor.c
+++ b/app/widgets/gimpcolormapeditor.c
@@ -74,8 +74,8 @@ static PangoLayout *
static void gimp_colormap_editor_update_entries (GimpColormapEditor *editor);
-static gboolean gimp_colormap_preview_expose (GtkWidget *widget,
- GdkEventExpose *event,
+static gboolean gimp_colormap_preview_draw (GtkWidget *widget,
+ cairo_t *cr,
GimpColormapEditor *editor);
static void gimp_colormap_editor_entry_clicked (GimpPaletteView *view,
@@ -165,8 +165,8 @@ gimp_colormap_editor_init (GimpColormapEditor *editor)
gtk_container_add (GTK_CONTAINER (frame), editor->view);
gtk_widget_show (editor->view);
- g_signal_connect (editor->view, "expose-event",
- G_CALLBACK (gimp_colormap_preview_expose),
+ g_signal_connect (editor->view, "draw",
+ G_CALLBACK (gimp_colormap_preview_draw),
editor);
g_signal_connect (editor->view, "entry-clicked",
@@ -192,13 +192,11 @@ gimp_colormap_editor_init (GimpColormapEditor *editor)
gtk_box_pack_end (GTK_BOX (editor), table, FALSE, FALSE, 0);
gtk_widget_show (table);
- editor->index_adjustment = (GtkAdjustment *)
- gtk_adjustment_new (0, 0, 0, 1, 10, 0);
+ editor->index_adjustment = gtk_adjustment_new (0, 0, 0, 1, 10, 0);
editor->index_spinbutton = gtk_spin_button_new (editor->index_adjustment,
1.0, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (editor->index_spinbutton),
TRUE);
-
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Color index:"), 0.0, 0.5,
editor->index_spinbutton, 1, TRUE);
@@ -501,13 +499,12 @@ gimp_colormap_editor_create_layout (GtkWidget *widget)
}
static gboolean
-gimp_colormap_preview_expose (GtkWidget *widget,
- GdkEventExpose *event,
- GimpColormapEditor *editor)
+gimp_colormap_preview_draw (GtkWidget *widget,
+ cairo_t *cr,
+ GimpColormapEditor *editor)
{
GimpImageEditor *image_editor = GIMP_IMAGE_EDITOR (editor);
GtkStyle *style;
- cairo_t *cr;
GtkAllocation allocation;
gint width, height;
gint y;
@@ -516,18 +513,11 @@ gimp_colormap_preview_expose (GtkWidget *widget,
gimp_image_get_base_type (image_editor->image) == GIMP_INDEXED)
return FALSE;
- cr = gdk_cairo_create (event->window);
- gdk_cairo_region (cr, event->region);
- cairo_clip (cr);
-
style = gtk_widget_get_style (widget);
gdk_cairo_set_source_color (cr, &style->fg[gtk_widget_get_state (widget)]);
gtk_widget_get_allocation (widget, &allocation);
- if (! gtk_widget_get_has_window (widget))
- cairo_translate (cr, allocation.x, allocation.y);
-
if (! editor->layout)
editor->layout = gimp_colormap_editor_create_layout (editor->view);
@@ -541,8 +531,6 @@ gimp_colormap_preview_expose (GtkWidget *widget,
cairo_move_to (cr, BORDER, MAX (y, 0));
pango_cairo_show_layout (cr, editor->layout);
- cairo_destroy (cr);
-
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]