1999-06-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gdesktop-icon.[ch]: Removed the background hack for desktop icons. Now the GnomeIconTextItem does the right thing. * gdesktop-icon.c (desktop_icon_reshape): Use the correct size for the icon text item.
Этот коммит содержится в:
родитель
08a568c7c4
Коммит
d579290936
@ -1,3 +1,11 @@
|
||||
1999-06-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||
|
||||
* gdesktop-icon.[ch]: Removed the background hack for desktop
|
||||
icons. Now the GnomeIconTextItem does the right thing.
|
||||
|
||||
* gdesktop-icon.c (desktop_icon_reshape): Use the correct size for
|
||||
the icon text item.
|
||||
|
||||
1999-06-07 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||
|
||||
* gdesktop.c (new_terminal): New function to open a terminal from
|
||||
|
@ -91,15 +91,9 @@ size_changed (GnomeIconTextItem *text, gpointer data)
|
||||
static void
|
||||
canvas_size_allocated (GtkWidget *widget, GtkAllocation *allocation, gpointer data)
|
||||
{
|
||||
DesktopIcon *dicon = data;
|
||||
|
||||
gnome_canvas_set_scroll_region (GNOME_CANVAS (widget), 0, 0, allocation->width, allocation->height);
|
||||
|
||||
gnome_canvas_item_set (dicon->background,
|
||||
"x2", (double) allocation->width,
|
||||
"y2", (double) allocation->height,
|
||||
NULL);
|
||||
|
||||
gnome_canvas_set_scroll_region (GNOME_CANVAS (widget),
|
||||
0, 0,
|
||||
allocation->width, allocation->height);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -116,22 +110,13 @@ desktop_icon_init (DesktopIcon *dicon)
|
||||
dicon->canvas = gnome_canvas_new ();
|
||||
gtk_signal_connect (GTK_OBJECT (dicon->canvas), "size_allocate",
|
||||
(GtkSignalFunc) canvas_size_allocated,
|
||||
dicon);
|
||||
NULL);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (dicon), dicon->canvas);
|
||||
gtk_widget_show (dicon->canvas);
|
||||
|
||||
/* Create the icon and the text items */
|
||||
|
||||
dicon->background = gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (dicon->canvas)),
|
||||
gnome_canvas_rect_get_type (),
|
||||
"x1", 0.0,
|
||||
"y1", 0.0,
|
||||
"x2", 0.0,
|
||||
"y2", 0.0,
|
||||
NULL);
|
||||
gnome_canvas_item_hide (dicon->background);
|
||||
|
||||
dicon->icon = gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (dicon->canvas)),
|
||||
gnome_canvas_image_get_type (),
|
||||
"anchor", GTK_ANCHOR_NW,
|
||||
@ -202,9 +187,6 @@ desktop_icon_realize (GtkWidget *widget)
|
||||
gnome_canvas_item_set (dicon->stipple,
|
||||
"fill_color_gdk", &widget->style->bg[GTK_STATE_SELECTED],
|
||||
NULL);
|
||||
gnome_canvas_item_set (dicon->background,
|
||||
"fill_color_gdk", &widget->style->bg[GTK_STATE_SELECTED],
|
||||
NULL);
|
||||
}
|
||||
|
||||
/* Sets the icon from the specified image. Does not re-create the window shape for the desktop
|
||||
@ -395,8 +377,8 @@ desktop_icon_reshape (DesktopIcon *dicon)
|
||||
|
||||
gnome_canvas_item_get_bounds (dicon->text, &x1, &y1, &x2, &y2);
|
||||
|
||||
text_width = x2 - x1 + 1;
|
||||
text_height = y2 - y1 + 1;
|
||||
text_width = x2 - x1;
|
||||
text_height = y2 - y1;
|
||||
|
||||
/* Calculate new size of widget */
|
||||
|
||||
@ -455,13 +437,10 @@ desktop_icon_select (DesktopIcon *dicon, int sel)
|
||||
g_return_if_fail (dicon != NULL);
|
||||
g_return_if_fail (IS_DESKTOP_ICON (dicon));
|
||||
|
||||
if (sel){
|
||||
if (sel)
|
||||
gnome_canvas_item_show (dicon->stipple);
|
||||
gnome_canvas_item_show (dicon->background);
|
||||
} else {
|
||||
else
|
||||
gnome_canvas_item_hide (dicon->stipple);
|
||||
gnome_canvas_item_hide (dicon->background);
|
||||
}
|
||||
|
||||
gnome_icon_text_item_select (GNOME_ICON_TEXT_ITEM (dicon->text), sel);
|
||||
}
|
||||
|
@ -37,9 +37,8 @@ struct _DesktopIcon {
|
||||
|
||||
GnomeCanvasItem *icon; /* The item that contains the icon */
|
||||
GnomeCanvasItem *text; /* The item that contains the editable text */
|
||||
GnomeCanvasItem *stipple; /* The rectangle used as a stipple when the icon is selected */
|
||||
GnomeCanvasItem *background; /* A background we can control */
|
||||
|
||||
GnomeCanvasItem *stipple; /* The stippled rectangle used when the icon is selected */
|
||||
|
||||
int width, height; /* Total size of the window */
|
||||
|
||||
int icon_x, icon_y; /* Icon offsets */
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user