Set a sensible default window size in plain mode

This commit is contained in:
Christian Dywan 2012-09-12 00:43:38 +02:00
parent ca07fe3cec
commit f185bcb42d

View file

@ -2064,6 +2064,14 @@ main (int argc,
GtkWidget* web_view = webkit_web_view_new (); GtkWidget* web_view = webkit_web_view_new ();
gchar* uri = midori_prepare_uri ( gchar* uri = midori_prepare_uri (
(uris != NULL && uris[0]) ? uris[0] : "http://www.example.com"); (uris != NULL && uris[0]) ? uris[0] : "http://www.example.com");
gint width, height;
GdkRectangle monitor;
GdkScreen* screen = gtk_window_get_screen (GTK_WINDOW (window));
gdk_screen_get_monitor_geometry (screen, 0, &monitor);
width = monitor.width / 1.7; height = monitor.height / 1.7;
gtk_window_set_default_size (GTK_WINDOW (window), width, height);
gtk_container_add (GTK_CONTAINER (window), scrolled); gtk_container_add (GTK_CONTAINER (window), scrolled);
gtk_container_add (GTK_CONTAINER (scrolled), web_view); gtk_container_add (GTK_CONTAINER (scrolled), web_view);
g_signal_connect (window, "delete-event", g_signal_connect (window, "delete-event",