From b069f7b995ae04ea69b208da3e18cb84e38ce2f2 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Wed, 7 Apr 1999 01:49:22 +0000 Subject: [PATCH] 1999-04-06 Federico Mena Quintero * glayout.c (create_container): Use gtk_window_set_default_size(), not gtk_widget_set_usize(). * gdesktop.c (get_slot_from_pos): Clamp the slot positions to be inside the screen. * gmain.c (gnome_check_super_user): Improved the message a bit. --- gnome/ChangeLog | 10 ++++++++++ gnome/gdesktop.c | 9 +++++++-- gnome/glayout.c | 5 +++-- gnome/gmain.c | 5 +++-- gnome/gscreen.c | 6 ++++-- 5 files changed, 27 insertions(+), 8 deletions(-) diff --git a/gnome/ChangeLog b/gnome/ChangeLog index eba463dc5..8951bb008 100644 --- a/gnome/ChangeLog +++ b/gnome/ChangeLog @@ -1,3 +1,13 @@ +1999-04-06 Federico Mena Quintero + + * glayout.c (create_container): Use gtk_window_set_default_size(), + not gtk_widget_set_usize(). + + * gdesktop.c (get_slot_from_pos): Clamp the slot positions to be + inside the screen. + + * gmain.c (gnome_check_super_user): Improved the message a bit. + 1999-04-06 David Martin * gcmd.c: marked message for translation. diff --git a/gnome/gdesktop.c b/gnome/gdesktop.c index eecd4a682..b3d84e927 100644 --- a/gnome/gdesktop.c +++ b/gnome/gdesktop.c @@ -134,8 +134,13 @@ static DesktopIconInfo *desktop_icon_info_new (char *filename, char *url, char * static void get_slot_from_pos (int x, int y, int *u, int *v) { - *u = (x + DESKTOP_SNAP_X / 2) / DESKTOP_SNAP_X; - *v = (y + DESKTOP_SNAP_Y / 2) / DESKTOP_SNAP_Y; + int uu, vv; + + uu = (x + DESKTOP_SNAP_X / 2) / DESKTOP_SNAP_X; + vv = (y + DESKTOP_SNAP_Y / 2) / DESKTOP_SNAP_Y; + + *u = CLAMP (uu, 0, layout_cols - 1); + *v = CLAMP (vv, 0, layout_rows - 1); } /* Looks for a free slot in the layout_slots array and returns the coordinates diff --git a/gnome/glayout.c b/gnome/glayout.c index 3246752d3..d008ffd41 100644 --- a/gnome/glayout.c +++ b/gnome/glayout.c @@ -728,9 +728,10 @@ create_container (Dlg_head *h, char *name, char *geometry) /* Geometry configuration */ if (width != -1 && height != -1) - gtk_widget_set_usize (GTK_WIDGET (app), width, height); + gtk_window_set_default_size (GTK_WINDOW (app), width, height); else - gtk_widget_set_usize (GTK_WIDGET (app), 540, 360); + gtk_window_set_default_size (GTK_WINDOW (app), 540, 360); + if (xpos != -1 && ypos != -1) gtk_widget_set_uposition (GTK_WIDGET (app), xpos, ypos); diff --git a/gnome/gmain.c b/gnome/gmain.c index f8ddfc6a0..e746b2968 100644 --- a/gnome/gmain.c +++ b/gnome/gmain.c @@ -630,8 +630,9 @@ gnome_check_super_user (void) return; warning_dlg = gnome_message_box_new ( - _("You are running the GNOME Midnight Commander as root. \n\n" - "You will not be protected from severly damaging your system."), + _("You are running the GNOME File Manager as root.\n\n" + "As root, you can damage your system if you are not careful, and the " + "GNOME File Manager will not stop you from doing it."), GNOME_MESSAGE_BOX_WARNING, GNOME_STOCK_BUTTON_OK, NULL); diff --git a/gnome/gscreen.c b/gnome/gscreen.c index 41fce677d..0778a81b6 100644 --- a/gnome/gscreen.c +++ b/gnome/gscreen.c @@ -2305,14 +2305,16 @@ create_and_setup_pane (WPanel *panel) else size = 0; } - +#if 0 + gtk_paned_set_position (GTK_PANED (pane), size); +#else /* * Hack: set the default startup size for the pane without * using _set_usize which would set the minimal size */ GTK_PANED (pane)->child1_size = size; GTK_PANED (pane)->position_set = TRUE; - +#endif gtk_widget_show (pane); return pane;