X-Git-Url: https://git.wpitchoune.net/gitweb/?p=ptask.git;a=blobdiff_plain;f=src%2Fui.c;h=acfa2b6b62766bc9b420c96a3dd3ed6deeecb142;hp=4fabb8c8ec93a7566fc43896f6e48cabfcb2e24b;hb=0136d7d490c7766920f0b46dc3b2b15a0f988c5f;hpb=61287c36e0005dbb1353fe87840170964e95c262 diff --git a/src/ui.c b/src/ui.c index 4fabb8c..acfa2b6 100644 --- a/src/ui.c +++ b/src/ui.c @@ -30,6 +30,8 @@ static GtkComboBox *w_status; static GSettings *gsettings; static GtkWindow *window; +static GtkPaned *vpaned; +static GtkPaned *hpaned; int newtask_clicked_cbk(GtkButton *btn, gpointer data) { @@ -40,18 +42,24 @@ int newtask_clicked_cbk(GtkButton *btn, gpointer data) static void save_settings(GtkWindow *window, GSettings *settings) { - int w, h, x, y; + int w, h, x, y, pos; gtk_window_get_size(window, &w, &h); gtk_window_get_position(window, &x, &y); - log_debug("save_settings(): x=%d, y=%d, w=%d, h=%d", x, y, w, h); + log_fct("x=%d, y=%d, w=%d, h=%d", x, y, w, h); g_settings_set_int(settings, "window-width", w); g_settings_set_int(settings, "window-height", h); g_settings_set_int(settings, "window-x", x); g_settings_set_int(settings, "window-y", y); + pos = gtk_paned_get_position(vpaned); + g_settings_set_int(settings, "spliter-vertical-pos", pos); + + pos = gtk_paned_get_position(hpaned); + g_settings_set_int(settings, "spliter-horizontal-pos", pos); + ui_tasktree_save_settings(settings); g_settings_sync(); @@ -97,7 +105,7 @@ static int status_changed_cbk(GtkComboBox *w, gpointer data) GtkWindow *create_window(GtkBuilder *builder, GSettings *settings) { - int x, y, w, h; + int x, y, w, h, pos; gsettings = settings; @@ -116,6 +124,14 @@ GtkWindow *create_window(GtkBuilder *builder, GSettings *settings) y = g_settings_get_int(settings, "window-y"); gtk_window_move(window, x, y); + vpaned = GTK_PANED(gtk_builder_get_object(builder, "vpaned")); + pos = g_settings_get_int(settings, "spliter-vertical-pos"); + gtk_paned_set_position(vpaned, pos); + + hpaned = GTK_PANED(gtk_builder_get_object(builder, "hpaned")); + pos = g_settings_get_int(settings, "spliter-horizontal-pos"); + gtk_paned_set_position(hpaned, pos); + g_signal_connect(window, "delete_event", G_CALLBACK(delete_event_cbk), settings);