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.
This commit is contained in:
parent
2fad80a6bd
commit
d1f2cb63d9
@ -1,5 +1,8 @@
|
||||
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)
|
||||
|
@ -1,5 +1,8 @@
|
||||
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)
|
||||
|
@ -1,5 +1,8 @@
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user