[Xfce4-commits] r27579 - xfce4-settings/trunk/xfce4-settings-manager

Nick Schermer nickschermer at gmail.com
Mon Aug 25 16:31:41 CEST 2008


2008/8/25 Brian Tarricone <kelnos at xfce.org>:
> Author: kelnos
> Date: 2008-08-25 14:04:12 +0000 (Mon, 25 Aug 2008)
> New Revision: 27579
>
> Modified:
>   xfce4-settings/trunk/xfce4-settings-manager/main.c
>   xfce4-settings/trunk/xfce4-settings-manager/xfce-settings-manager-dialog.c
> Log:
> improve initial dialog sizing -- do 2/3 the width and height of the screen
>
> i'm not sure if this will look the best everwhere (esp on hi-res screens),
> but it works well on my laptop, and at least attempts to adapt to different
> screen sizes

Well that will make the dialog look huge on my screen (1680x1050).
Maybe we can try
something like this:

-----8<-----
#define MAX_DIALOG_WIDTH (600)
#define MAX_DIALOG_HEIGHT (480)

gdk_display_get_pointer (gtk_widget_get_display (dialog), &screen, &x,
&y, NULL);
monitor = gdk_screen_get_monitor_at_point (screen, x, y);
gdk_screen_get_monitor_geometry(screen, monitor, &geom);

width = MIN (geom.width * 2 / 3, MAX_DIALOG_WIDTH);
height = MIN (geom.height * 2 / 3, MAX_DIALOG_HEIGHT);
x = geom.x + (geom.width - win_width) / 2;
y = geom.y + (geom.height - win_height) /2;

gtk_window_set_screen (GTK_WINDOW (dialog), screen);
gtk_window_set_default_size (GTK_WINDOW(dialog), width, height);
gtk_window_move (GTK_WINDOW(dialog), x, y);
-----8<-----

It will center the dialog on the monitor with the pointer, using 2/3
of the geometry size, maxing at 600x480 (or something else, duno).

Nick



More information about the Xfce4-dev mailing list