comparison src/bar_exif.c @ 2861:727f2f8edf74

Info sidebar: Preserve state of Show Hidden flags In the Info Sidebar, preserve the state of the Show Hidden flags for the Exif and File Info panes
author Colin Clark <colin.clark@cclark.uk>
date Thu, 08 Nov 2018 12:26:09 +0000
parents 5e4e640df4d8
children
comparison
equal deleted inserted replaced
2860:b20a96b979a3 2861:727f2f8edf74
707 707
708 WRITE_NL(); WRITE_STRING("<pane_exif "); 708 WRITE_NL(); WRITE_STRING("<pane_exif ");
709 write_char_option(outstr, indent, "id", ped->pane.id); 709 write_char_option(outstr, indent, "id", ped->pane.id);
710 write_char_option(outstr, indent, "title", gtk_label_get_text(GTK_LABEL(ped->pane.title))); 710 write_char_option(outstr, indent, "title", gtk_label_get_text(GTK_LABEL(ped->pane.title)));
711 WRITE_BOOL(ped->pane, expanded); 711 WRITE_BOOL(ped->pane, expanded);
712 WRITE_BOOL(*ped, show_all);
712 WRITE_STRING(">"); 713 WRITE_STRING(">");
713 indent++; 714 indent++;
714 715
715 list = gtk_container_get_children(GTK_CONTAINER(ped->vbox)); 716 list = gtk_container_get_children(GTK_CONTAINER(ped->vbox));
716 work = list; 717 work = list;
800 #if GTK_CHECK_VERSION(3,0,0) 801 #if GTK_CHECK_VERSION(3,0,0)
801 gtk_widget_set_size_request(ped->widget, -1, ped->min_height); 802 gtk_widget_set_size_request(ped->widget, -1, ped->min_height);
802 #endif 803 #endif
803 } 804 }
804 805
805 static GtkWidget *bar_pane_exif_new(const gchar *id, const gchar *title, gboolean expanded) 806 static GtkWidget *bar_pane_exif_new(const gchar *id, const gchar *title, gboolean expanded, gboolean show_all)
806 { 807 {
807 PaneExifData *ped; 808 PaneExifData *ped;
808 809
809 ped = g_new0(PaneExifData, 1); 810 ped = g_new0(PaneExifData, 1);
810 811
813 ped->pane.pane_event = bar_pane_exif_event; 814 ped->pane.pane_event = bar_pane_exif_event;
814 ped->pane.title = bar_pane_expander_title(title); 815 ped->pane.title = bar_pane_expander_title(title);
815 ped->pane.id = g_strdup(id); 816 ped->pane.id = g_strdup(id);
816 ped->pane.expanded = expanded; 817 ped->pane.expanded = expanded;
817 ped->pane.type = PANE_EXIF; 818 ped->pane.type = PANE_EXIF;
819 ped->show_all = show_all;
818 820
819 ped->size_group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); 821 ped->size_group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
820 ped->widget = gtk_event_box_new(); 822 ped->widget = gtk_event_box_new();
821 ped->vbox = gtk_vbox_new(FALSE, PREF_PAD_GAP); 823 ped->vbox = gtk_vbox_new(FALSE, PREF_PAD_GAP);
822 gtk_container_add(GTK_CONTAINER(ped->widget), ped->vbox); 824 gtk_container_add(GTK_CONTAINER(ped->widget), ped->vbox);
848 GtkWidget *bar_pane_exif_new_from_config(const gchar **attribute_names, const gchar **attribute_values) 850 GtkWidget *bar_pane_exif_new_from_config(const gchar **attribute_names, const gchar **attribute_values)
849 { 851 {
850 gchar *title = NULL; 852 gchar *title = NULL;
851 gchar *id = g_strdup("exif"); 853 gchar *id = g_strdup("exif");
852 gboolean expanded = TRUE; 854 gboolean expanded = TRUE;
855 gboolean show_all = FALSE;
853 GtkWidget *ret; 856 GtkWidget *ret;
854 857
855 while (*attribute_names) 858 while (*attribute_names)
856 { 859 {
857 const gchar *option = *attribute_names++; 860 const gchar *option = *attribute_names++;
858 const gchar *value = *attribute_values++; 861 const gchar *value = *attribute_values++;
859 862
860 if (READ_CHAR_FULL("id", id)) continue; 863 if (READ_CHAR_FULL("id", id)) continue;
861 if (READ_CHAR_FULL("title", title)) continue; 864 if (READ_CHAR_FULL("title", title)) continue;
862 if (READ_BOOL_FULL("expanded", expanded)) continue; 865 if (READ_BOOL_FULL("expanded", expanded)) continue;
866 if (READ_BOOL_FULL("show_all", show_all)) continue;
863 867
864 log_printf("unknown attribute %s = %s\n", option, value); 868 log_printf("unknown attribute %s = %s\n", option, value);
865 } 869 }
866 870
867 bar_pane_translate_title(PANE_EXIF, id, &title); 871 bar_pane_translate_title(PANE_EXIF, id, &title);
868 ret = bar_pane_exif_new(id, title, expanded); 872 ret = bar_pane_exif_new(id, title, expanded, show_all);
869 g_free(title); 873 g_free(title);
870 g_free(id); 874 g_free(id);
871 return ret; 875 return ret;
872 } 876 }
873 877
884 const gchar *option = *attribute_names++; 888 const gchar *option = *attribute_names++;
885 const gchar *value = *attribute_values++; 889 const gchar *value = *attribute_values++;
886 890
887 if (READ_CHAR_FULL("title", title)) continue; 891 if (READ_CHAR_FULL("title", title)) continue;
888 if (READ_BOOL_FULL("expanded", ped->pane.expanded)) continue; 892 if (READ_BOOL_FULL("expanded", ped->pane.expanded)) continue;
893 if (READ_BOOL_FULL("show_all", ped->show_all)) continue;
889 if (READ_CHAR_FULL("id", ped->pane.id)) continue; 894 if (READ_CHAR_FULL("id", ped->pane.id)) continue;
890 895
891 896
892 log_printf("unknown attribute %s = %s\n", option, value); 897 log_printf("unknown attribute %s = %s\n", option, value);
893 } 898 }