Set a sensible default window size in plain mode
This commit is contained in:
parent
ca07fe3cec
commit
f185bcb42d
1 changed files with 8 additions and 0 deletions
|
@ -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",
|
||||||
|
|
Loading…
Reference in a new issue