X-Git-Url: https://git.wpitchoune.net/gitweb/?a=blobdiff_plain;f=src%2Fui.c;h=acfa2b6b62766bc9b420c96a3dd3ed6deeecb142;hb=0136d7d490c7766920f0b46dc3b2b15a0f988c5f;hp=f81ada3e0ea585113ca302f74743647925a05b94;hpb=257549fe9e924e00043e755ae766218e4946aa5b;p=ptask.git diff --git a/src/ui.c b/src/ui.c index f81ada3..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(); @@ -86,15 +94,18 @@ static gboolean delete_event_cbk(GtkWidget *w, GdkEvent *evt, gpointer data) static int status_changed_cbk(GtkComboBox *w, gpointer data) { - log_debug("status_changed_cbk"); + log_fct_enter(); + refresh(); + log_fct_exit(); + return FALSE; } GtkWindow *create_window(GtkBuilder *builder, GSettings *settings) { - int x, y, w, h; + int x, y, w, h, pos; gsettings = settings; @@ -113,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);