1
1

Fixes for desktop icons - Federico

Этот коммит содержится в:
Miguel de Icaza 1998-10-23 14:31:02 +00:00
родитель 652cd17475
Коммит 772cae09e0
2 изменённых файлов: 17 добавлений и 4 удалений

Просмотреть файл

@ -17,6 +17,7 @@
static void desktop_icon_class_init (DesktopIconClass *class);
static void desktop_icon_init (DesktopIcon *dicon);
static void desktop_icon_realize (GtkWidget *widget);
static GtkWindowClass *parent_class;
@ -55,6 +56,8 @@ desktop_icon_class_init (DesktopIconClass *class)
widget_class = (GtkWidgetClass *) class;
parent_class = gtk_type_class (gtk_window_get_type ());
widget_class->realize = desktop_icon_realize;
}
/* Computes and sets a new window shape for the desktop icon */
@ -196,6 +199,18 @@ desktop_icon_init (DesktopIcon *dicon)
dicon);
}
static void
desktop_icon_realize (GtkWidget *widget)
{
g_return_if_fail (widget != NULL);
g_return_if_fail (IS_DESKTOP_ICON (widget));
if (GTK_WIDGET_CLASS (parent_class)->realize)
(* GTK_WIDGET_CLASS (parent_class)->realize) (widget);
/* FIXME: set the appropriate WM hints for desktop icons */
}
GtkWidget *
desktop_icon_new (char *image_file, char *text)
{

Просмотреть файл

@ -171,8 +171,6 @@ desktop_icon_set_position (desktop_icon_t *di)
}
}
gtk_widget_size_request (di->widget, &di->widget->requisition);
if (icons_snap_to_grid){
if (x == -1){
x = current_x;
@ -195,7 +193,7 @@ desktop_icon_set_position (desktop_icon_t *di)
x = current_x;
y = current_y;
current_y += di->widget->requisition.height + 8;
current_y += DESKTOP_ICON (di)->height + 8;
if (current_y > gdk_screen_height ()){
current_x += SNAP_X;
current_y = 0;
@ -1073,10 +1071,10 @@ post_setup_desktop_icon (desktop_icon_t *di, int show)
/* 2. Double clicking executes the command */
gtk_signal_connect (GTK_OBJECT (child->data), "button_press_event", GTK_SIGNAL_FUNC (dentry_button_click), di);
#endif
if (show)
gtk_widget_show (di->widget);
#endif
/* lower the window */
gdk_window_lower (di->widget->window);
}