Commit d1f2cb63 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

Use a named cursor with the name "color-picker", when available.

2005-06-14  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkcolorsel.c (make_picker_cursor): Use a named cursor
	with the name "color-picker", when available.
parent 2fad80a6
2005-06-14 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkcolorsel.c (make_picker_cursor): Use a named cursor
with the name "color-picker", when available.
* gdk/gdk.symbols:
* gdk/gdkcursor.h:
* gdk/x11/gdkcursor-x11.c (gdk_cursor_get_image)
......
2005-06-14 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkcolorsel.c (make_picker_cursor): Use a named cursor
with the name "color-picker", when available.
* gdk/gdk.symbols:
* gdk/gdkcursor.h:
* gdk/x11/gdkcursor-x11.c (gdk_cursor_get_image)
......
2005-06-14 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkcolorsel.c (make_picker_cursor): Use a named cursor
with the name "color-picker", when available.
* gdk/gdk.symbols:
* gdk/gdkcursor.h:
* gdk/x11/gdkcursor-x11.c (gdk_cursor_get_image)
......
......@@ -1175,24 +1175,34 @@ static GdkCursor *
make_picker_cursor (GdkScreen *screen)
{
GdkCursor *cursor;
GdkColor bg = { 0, 0xffff, 0xffff, 0xffff };
GdkColor fg = { 0, 0x0000, 0x0000, 0x0000 };
GdkWindow *window = gdk_screen_get_root_window (screen);
GdkPixmap *pixmap =
gdk_bitmap_create_from_data (window, (gchar *) dropper_bits,
DROPPER_WIDTH, DROPPER_HEIGHT);
GdkPixmap *mask =
gdk_bitmap_create_from_data (window, (gchar *) dropper_mask,
DROPPER_WIDTH, DROPPER_HEIGHT);
cursor = gdk_cursor_new_from_name (gdk_screen_get_display (screen),
"color-picker");
cursor = gdk_cursor_new_from_pixmap (pixmap, mask, &fg, &bg,
DROPPER_X_HOT, DROPPER_Y_HOT);
g_object_unref (pixmap);
g_object_unref (mask);
if (!cursor)
{
GdkColor bg = { 0, 0xffff, 0xffff, 0xffff };
GdkColor fg = { 0, 0x0000, 0x0000, 0x0000 };
GdkWindow *window;
GdkPixmap *pixmap, *mask;
window = gdk_screen_get_root_window (screen);
pixmap =
gdk_bitmap_create_from_data (window, (gchar *) dropper_bits,
DROPPER_WIDTH, DROPPER_HEIGHT);
mask =
gdk_bitmap_create_from_data (window, (gchar *) dropper_mask,
DROPPER_WIDTH, DROPPER_HEIGHT);
cursor = gdk_cursor_new_from_pixmap (pixmap, mask, &fg, &bg,
DROPPER_X_HOT, DROPPER_Y_HOT);
g_object_unref (pixmap);
g_object_unref (mask);
}
return cursor;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment