diff options
author | Berke Viktor <bviktor@hexchat.org> | 2013-05-11 15:58:52 +0200 |
---|---|---|
committer | Berke Viktor <bviktor@hexchat.org> | 2013-05-11 15:58:52 +0200 |
commit | 85c7e07351b9538e480dc2899fdeb8a70ecf8e74 (patch) | |
tree | 8355dfcde9d5b0af1f2e6b6fe936a81bfd127a30 /src/fe-gtk/servlistgui.c | |
parent | fde85c79dfa81f704da7f41d0284feea245ea7be (diff) |
Set up window sizes correctly
Diffstat (limited to 'src/fe-gtk/servlistgui.c')
-rw-r--r-- | src/fe-gtk/servlistgui.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/src/fe-gtk/servlistgui.c b/src/fe-gtk/servlistgui.c index f0c04f6e..bccd9dc7 100644 --- a/src/fe-gtk/servlistgui.c +++ b/src/fe-gtk/servlistgui.c @@ -41,14 +41,12 @@ /* servlistgui.c globals */ static GtkWidget *serverlist_win = NULL; -static GtkWidget *networks_tree; /* network TreeView */ -#ifdef WIN32 -static int win_width = 324; -static int win_height = 426; -#else -static int win_width = 364; -static int win_height = 478; -#endif +static GtkWidget *networks_tree; /* network TreeView */ + +static int netlist_win_width = 0; /* don't hardcode pixels, just use as much as needed by default, save if resized */ +static int netlist_win_height = 0; +static int netedit_win_width = 0; +static int netedit_win_height = 0; /* global user info */ static GtkWidget *entry_nick1; @@ -662,7 +660,15 @@ static gboolean servlist_configure_cb (GtkWindow *win, GdkEventConfigure *event, gpointer none) { /* remember the window size */ - gtk_window_get_size (win, &win_width, &win_height); + gtk_window_get_size (win, &netlist_win_width, &netlist_win_height); + return FALSE; +} + +static gboolean +servlist_edit_configure_cb (GtkWindow *win, GdkEventConfigure *event, gpointer none) +{ + /* remember the window size */ + gtk_window_get_size (win, &netedit_win_width, &netedit_win_height); return FALSE; } @@ -679,6 +685,8 @@ servlist_edit_cb (GtkWidget *but, gpointer none) "changed", G_CALLBACK (servlist_server_row_cb), NULL); g_signal_connect (G_OBJECT (edit_win), "delete_event", G_CALLBACK (servlist_editwin_delete_cb), 0); + g_signal_connect (G_OBJECT (edit_win), "configure_event", + G_CALLBACK (servlist_edit_configure_cb), 0); g_signal_connect (G_OBJECT (edit_trees[SERVER_TREE]), "key_press_event", G_CALLBACK (servlist_serv_keypress_cb), 0); gtk_widget_show (edit_win); @@ -983,7 +991,6 @@ servlist_autojoinedit (ircnet *net, char *channel, gboolean add) win = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_container_set_border_width (GTK_CONTAINER (win), 4); gtk_window_set_title (GTK_WINDOW (win), _(DISPLAY_NAME": Favorite Channels (Auto-Join List)")); - gtk_window_set_default_size (GTK_WINDOW (win), 354, 256); gtk_window_set_position (GTK_WINDOW (win), GTK_WIN_POS_MOUSE); if (edit_win) gtk_window_set_transient_for (GTK_WINDOW (win), GTK_WINDOW (edit_win)); @@ -1579,7 +1586,7 @@ servlist_open_edit (GtkWidget *parent, ircnet *net) gtk_container_set_border_width (GTK_CONTAINER (editwindow), 4); snprintf (buf, sizeof (buf), _(DISPLAY_NAME": Edit %s"), net->name); gtk_window_set_title (GTK_WINDOW (editwindow), buf); - gtk_window_set_default_size (GTK_WINDOW (editwindow), 354, 0); + gtk_window_set_default_size (GTK_WINDOW (editwindow), netedit_win_width, netedit_win_height); gtk_window_set_position (GTK_WINDOW (editwindow), GTK_WIN_POS_MOUSE); gtk_window_set_transient_for (GTK_WINDOW (editwindow), GTK_WINDOW (parent)); gtk_window_set_modal (GTK_WINDOW (editwindow), TRUE); @@ -1826,7 +1833,7 @@ servlist_open_networks (void) servlist = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_container_set_border_width (GTK_CONTAINER (servlist), 4); gtk_window_set_title (GTK_WINDOW (servlist), _(DISPLAY_NAME": Network List")); - gtk_window_set_default_size (GTK_WINDOW (servlist), win_width, win_height); + gtk_window_set_default_size (GTK_WINDOW (servlist), netlist_win_width, netlist_win_height); gtk_window_set_position (GTK_WINDOW (servlist), GTK_WIN_POS_MOUSE); gtk_window_set_role (GTK_WINDOW (servlist), "servlist"); gtk_window_set_type_hint (GTK_WINDOW (servlist), GDK_WINDOW_TYPE_HINT_DIALOG); |