# HG changeset patch # User Olaf Wintermann # Date 1718135139 -7200 # Node ID acd8c4a9d3fe7471dce0bcd44a5c765bb471b9a9 # Parent 9b754f1b7e1630fdb03b1668844a268e9d9a221d fix path textfield diff -r 9b754f1b7e16 -r acd8c4a9d3fe application/window.c --- a/application/window.c Tue Jun 11 21:31:21 2024 +0200 +++ b/application/window.c Tue Jun 11 21:45:39 2024 +0200 @@ -82,24 +82,19 @@ void* window_resource_table_getvalue(DavResource *res, int col) { switch (col) { - case 0: - { // icon + case 0: { // icon return res->iscollection ? folder_icon : file_icon; } - case 1: - { // resource name + case 1: { // resource name return res->name; } - case 2: - { // type + case 2: { // type return res->iscollection ? "Collection" : (res->contenttype ? res->contenttype : "Resource"); } - case 3: - { // last modified + case 3: { // last modified return util_date_str(res->lastmodified); } - case 4: - { // size + case 4: { // size return util_size_str(res->iscollection, res->contentlength); } } diff -r 9b754f1b7e16 -r acd8c4a9d3fe ui/gtk/text.c --- a/ui/gtk/text.c Tue Jun 11 21:31:21 2024 +0200 +++ b/ui/gtk/text.c Tue Jun 11 21:45:39 2024 +0200 @@ -691,6 +691,7 @@ static gboolean path_textfield_btn_pressed(GtkWidget *widget, GdkEventButton *event, UiPathTextField *pathtf) { gtk_box_pack_start(GTK_BOX(pathtf->hbox), pathtf->entry, TRUE, TRUE, 0); gtk_container_remove(GTK_CONTAINER(pathtf->hbox), pathtf->buttonbox); + pathtf->buttonbox = NULL; gtk_widget_show(pathtf->entry); gtk_widget_grab_focus(pathtf->entry); @@ -865,12 +866,16 @@ pathtf->current_nelm = nelm; GtkWidget *buttonbox = create_path_button_box(); + + // switch from entry to buttonbox or remove current buttonbox + if(pathtf->buttonbox) { + gtk_container_remove(GTK_CONTAINER(pathtf->hbox), pathtf->buttonbox); + } else { + gtk_container_remove(GTK_CONTAINER(pathtf->hbox), pathtf->entry); + } + gtk_box_pack_start(GTK_BOX(pathtf->hbox), buttonbox, FALSE, FALSE, 0); pathtf->buttonbox = buttonbox; - // switch from entry to buttonbox - gtk_container_remove(GTK_CONTAINER(pathtf->hbox), pathtf->entry); - gtk_box_pack_start(GTK_BOX(pathtf->hbox), buttonbox, FALSE, FALSE, 0); - for (int i=0;i