Merge pull request #298 from TingPing/vertical

Save pane height and restore on start
This commit is contained in:
RichardHitt 2012-12-02 20:08:40 -08:00
commit 5fdcdedd9e
3 changed files with 18 additions and 0 deletions

View File

@ -435,6 +435,7 @@ const struct prefs vars[] =
{"gui_lagometer", P_OFFINT (hex_gui_lagometer), TYPE_INT}, {"gui_lagometer", P_OFFINT (hex_gui_lagometer), TYPE_INT},
{"gui_lang", P_OFFINT (hex_gui_lang), TYPE_INT}, {"gui_lang", P_OFFINT (hex_gui_lang), TYPE_INT},
{"gui_mode_buttons", P_OFFINT (hex_gui_mode_buttons), TYPE_BOOL}, {"gui_mode_buttons", P_OFFINT (hex_gui_mode_buttons), TYPE_BOOL},
{"gui_pane_divider_position", P_OFFINT (hex_gui_pane_divider_position), TYPE_INT},
{"gui_pane_left_size", P_OFFINT (hex_gui_pane_left_size), TYPE_INT}, {"gui_pane_left_size", P_OFFINT (hex_gui_pane_left_size), TYPE_INT},
{"gui_pane_right_size", P_OFFINT (hex_gui_pane_right_size), TYPE_INT}, {"gui_pane_right_size", P_OFFINT (hex_gui_pane_right_size), TYPE_INT},
{"gui_pane_right_size_min", P_OFFINT (hex_gui_pane_right_size_min), TYPE_INT}, {"gui_pane_right_size_min", P_OFFINT (hex_gui_pane_right_size_min), TYPE_INT},

View File

@ -252,6 +252,7 @@ struct hexchatprefs
int hex_gui_dialog_width; int hex_gui_dialog_width;
int hex_gui_lagometer; int hex_gui_lagometer;
int hex_gui_lang; int hex_gui_lang;
int hex_gui_pane_divider_position;
int hex_gui_pane_left_size; int hex_gui_pane_left_size;
int hex_gui_pane_right_size; int hex_gui_pane_right_size;
int hex_gui_pane_right_size_min; int hex_gui_pane_right_size_min;

View File

@ -2542,6 +2542,12 @@ mg_create_userlist (session_gui *gui, GtkWidget *box)
gui->button_box = mg_create_userlistbuttons (vbox); gui->button_box = mg_create_userlistbuttons (vbox);
} }
static void
mg_vpane_cb (GtkPaned *pane, GParamSpec *param, session_gui *gui)
{
prefs.hex_gui_pane_divider_position = gtk_paned_get_position (pane);
}
static void static void
mg_leftpane_cb (GtkPaned *pane, GParamSpec *param, session_gui *gui) mg_leftpane_cb (GtkPaned *pane, GParamSpec *param, session_gui *gui)
{ {
@ -2570,6 +2576,10 @@ mg_add_pane_signals (session_gui *gui)
G_CALLBACK (mg_rightpane_cb), gui); G_CALLBACK (mg_rightpane_cb), gui);
g_signal_connect (G_OBJECT (gui->hpane_left), "notify::position", g_signal_connect (G_OBJECT (gui->hpane_left), "notify::position",
G_CALLBACK (mg_leftpane_cb), gui); G_CALLBACK (mg_leftpane_cb), gui);
g_signal_connect (G_OBJECT (gui->vpane_left), "notify::position",
G_CALLBACK (mg_vpane_cb), gui);
g_signal_connect (G_OBJECT (gui->vpane_right), "notify::position",
G_CALLBACK (mg_vpane_cb), gui);
return FALSE; return FALSE;
} }
@ -2756,6 +2766,12 @@ mg_place_userlist_and_chanview_real (session_gui *gui, GtkWidget *userlist, GtkW
} }
} }
if (mg_is_userlist_and_tree_combined () && prefs.hex_gui_pane_divider_position != 0)
{
gtk_paned_set_position (GTK_PANED (gui->vpane_left), prefs.hex_gui_pane_divider_position);
gtk_paned_set_position (GTK_PANED (gui->vpane_right), prefs.hex_gui_pane_divider_position);
}
if (unref_chanview) if (unref_chanview)
g_object_unref (chanview); g_object_unref (chanview);
if (unref_userlist) if (unref_userlist)