gtk-demo: Don't rely on gdk_cursor_get_image
This function is only implemented on X11. Instead, just use a fixed set of cursor images from resources.
@ -155,7 +155,43 @@ RESOURCES = \
|
||||
css_pixbufs.css \
|
||||
css_shadows.css \
|
||||
cssview.css \
|
||||
reset.css
|
||||
reset.css \
|
||||
alias_cursor.png \
|
||||
all_scroll_cursor.png \
|
||||
cell_cursor.png \
|
||||
col_resize_cursor.png \
|
||||
copy_cursor.png \
|
||||
crosshair_cursor.png \
|
||||
default_cursor.png \
|
||||
e_resize_cursor.png \
|
||||
ew_resize_cursor.png \
|
||||
grabbing_cursor.png \
|
||||
grab_cursor.png \
|
||||
hand_cursor.png \
|
||||
help_cursor.png \
|
||||
move_cursor.png \
|
||||
ne_resize_cursor.png \
|
||||
nesw_resize_cursor.png \
|
||||
none_cursor.png \
|
||||
no_drop_cursor.png \
|
||||
not_allowed_cursor.png \
|
||||
n_resize_cursor.png \
|
||||
ns_resize_cursor.png \
|
||||
nw_resize_cursor.png \
|
||||
nwse_resize_cursor.png \
|
||||
pointer_cursor.png \
|
||||
progress_cursor.png \
|
||||
row_resize_cursor.png \
|
||||
se_resize_cursor.png \
|
||||
s_resize_cursor.png \
|
||||
sw_resize_cursor.png \
|
||||
text_cursor.png \
|
||||
vertical_text_cursor.png \
|
||||
wait_cursor.png \
|
||||
w_resize_cursor.png \
|
||||
zoom_in_cursor.png \
|
||||
zoom_out_cursor.png
|
||||
|
||||
|
||||
iconthemedir = $(datadir)/icons/hicolor
|
||||
|
||||
|
BIN
demos/gtk-demo/alias_cursor.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
demos/gtk-demo/all_scroll_cursor.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
demos/gtk-demo/cell_cursor.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
demos/gtk-demo/col_resize_cursor.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
demos/gtk-demo/copy_cursor.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
demos/gtk-demo/crosshair_cursor.png
Normal file
After Width: | Height: | Size: 985 B |
@ -51,8 +51,15 @@ add_button (GtkWidget *section,
|
||||
if (cursor == NULL)
|
||||
image = gtk_image_new_from_icon_name ("image-missing", GTK_ICON_SIZE_MENU);
|
||||
else
|
||||
image = gtk_image_new_from_pixbuf (gdk_cursor_get_image (cursor));
|
||||
gtk_widget_set_size_request (image, 24, 24);
|
||||
{
|
||||
gchar *path;
|
||||
|
||||
path = g_strdup_printf ("/cursors/%s_cursor.png", css_name);
|
||||
g_strdelimit (path, "-", '_');
|
||||
image = gtk_image_new_from_resource (path);
|
||||
g_free (path);
|
||||
}
|
||||
gtk_widget_set_size_request (image, 32, 32);
|
||||
button = gtk_button_new ();
|
||||
gtk_container_add (GTK_CONTAINER (button), image);
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (button), "image-button");
|
||||
|
BIN
demos/gtk-demo/default_cursor.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
@ -47,6 +47,43 @@
|
||||
<file>cssview.css</file>
|
||||
<file>reset.css</file>
|
||||
</gresource>
|
||||
<gresource prefix="/cursors">
|
||||
<file>alias_cursor.png</file>
|
||||
<file>all_scroll_cursor.png</file>
|
||||
<file>cell_cursor.png</file>
|
||||
<file>col_resize_cursor.png</file>
|
||||
<file>copy_cursor.png</file>
|
||||
<file>crosshair_cursor.png</file>
|
||||
<file>default_cursor.png</file>
|
||||
<file>e_resize_cursor.png</file>
|
||||
<file>ew_resize_cursor.png</file>
|
||||
<file>grabbing_cursor.png</file>
|
||||
<file>grab_cursor.png</file>
|
||||
<file>hand_cursor.png</file>
|
||||
<file>help_cursor.png</file>
|
||||
<file>move_cursor.png</file>
|
||||
<file>ne_resize_cursor.png</file>
|
||||
<file>nesw_resize_cursor.png</file>
|
||||
<file>no_drop_cursor.png</file>
|
||||
<file>none_cursor.png</file>
|
||||
<file>not_allowed_cursor.png</file>
|
||||
<file>n_resize_cursor.png</file>
|
||||
<file>ns_resize_cursor.png</file>
|
||||
<file>nw_resize_cursor.png</file>
|
||||
<file>nwse_resize_cursor.png</file>
|
||||
<file>pointer_cursor.png</file>
|
||||
<file>progress_cursor.png</file>
|
||||
<file>row_resize_cursor.png</file>
|
||||
<file>se_resize_cursor.png</file>
|
||||
<file>s_resize_cursor.png</file>
|
||||
<file>sw_resize_cursor.png</file>
|
||||
<file>text_cursor.png</file>
|
||||
<file>vertical_text_cursor.png</file>
|
||||
<file>wait_cursor.png</file>
|
||||
<file>w_resize_cursor.png</file>
|
||||
<file>zoom_in_cursor.png</file>
|
||||
<file>zoom_out_cursor.png</file>
|
||||
</gresource>
|
||||
<gresource prefix="/iconview">
|
||||
<file preprocess="to-pixdata">gnome-fs-directory.png</file>
|
||||
<file preprocess="to-pixdata">gnome-fs-regular.png</file>
|
||||
|
BIN
demos/gtk-demo/e_resize_cursor.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
demos/gtk-demo/ew_resize_cursor.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
demos/gtk-demo/grab_cursor.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
demos/gtk-demo/grabbing_cursor.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
demos/gtk-demo/hand_cursor.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
demos/gtk-demo/help_cursor.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
demos/gtk-demo/move_cursor.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
demos/gtk-demo/n_resize_cursor.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
demos/gtk-demo/ne_resize_cursor.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
demos/gtk-demo/nesw_resize_cursor.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
demos/gtk-demo/no_drop_cursor.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
demos/gtk-demo/none_cursor.png
Normal file
After Width: | Height: | Size: 182 B |
BIN
demos/gtk-demo/not_allowed_cursor.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
demos/gtk-demo/ns_resize_cursor.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
demos/gtk-demo/nw_resize_cursor.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
demos/gtk-demo/nwse_resize_cursor.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
demos/gtk-demo/pointer_cursor.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
demos/gtk-demo/progress_cursor.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
demos/gtk-demo/row_resize_cursor.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
demos/gtk-demo/s_resize_cursor.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
demos/gtk-demo/se_resize_cursor.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
demos/gtk-demo/sw_resize_cursor.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
demos/gtk-demo/text_cursor.png
Normal file
After Width: | Height: | Size: 844 B |
BIN
demos/gtk-demo/vertical_text_cursor.png
Normal file
After Width: | Height: | Size: 823 B |
BIN
demos/gtk-demo/w_resize_cursor.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
demos/gtk-demo/wait_cursor.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
demos/gtk-demo/zoom_in_cursor.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
demos/gtk-demo/zoom_out_cursor.png
Normal file
After Width: | Height: | Size: 2.1 KiB |