From f51e05e400097b60fc360a4b46518944d0943e8e Mon Sep 17 00:00:00 2001 From: "Chris.Elston" Date: Thu, 14 Jan 2021 12:25:56 +0000 Subject: [PATCH] improve styling of module section expander button --- data/themes/darktable.css | 19 +++++++++++++++++++ src/iop/temperature.c | 2 ++ src/libs/import.c | 2 ++ 3 files changed, 23 insertions(+) diff --git a/data/themes/darktable.css b/data/themes/darktable.css index 785d8f0234ea..d1f924b7ee7b 100644 --- a/data/themes/darktable.css +++ b/data/themes/darktable.css @@ -695,6 +695,25 @@ overshoot.right margin: 2px 0 6px 0; } +/* Control sections that can be expanded/collapsed need to be handled differently */ + +#iop-plugin-ui .section-expander #section_label, +#lib-plugin-ui .section-expander #section_label +{ + margin: 0; +} + +#lib-plugin-ui .section-expander, +#iop-plugin-ui .section-expander { + padding: 12px 0 6px 0; +} + +#lib-plugin-ui .section-expander #control-button, +#iop-plugin-ui .section-expander #control-button { + padding: 0; + margin: 0; +} + /* Special modules: image infos, navigation and search ones */ #image-info { diff --git a/src/iop/temperature.c b/src/iop/temperature.c index d6a8c1cefbab..862bef8f2901 100644 --- a/src/iop/temperature.c +++ b/src/iop/temperature.c @@ -2005,6 +2005,8 @@ void gui_init(struct dt_iop_module_t *self) GtkWidget *destdisp_head = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, DT_BAUHAUS_SPACE); GtkWidget *header_evb = gtk_event_box_new(); GtkWidget *destdisp = dt_ui_section_label_new(_("channel coefficients")); + context = gtk_widget_get_style_context(destdisp_head); + gtk_style_context_add_class(context, "section-expander"); gtk_container_add(GTK_CONTAINER(header_evb), destdisp); g->coeffs_toggle = dtgtk_togglebutton_new(dtgtk_cairo_paint_solid_arrow, CPF_STYLE_BOX | CPF_DIRECTION_LEFT, NULL); diff --git a/src/libs/import.c b/src/libs/import.c index a37b10f198c7..0b8bb546063b 100644 --- a/src/libs/import.c +++ b/src/libs/import.c @@ -748,6 +748,8 @@ void gui_init(dt_lib_module_t *self) // collapsible section GtkWidget *destdisp_head = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); GtkWidget *header_evb = gtk_event_box_new(); + GtkStyleContext *context = gtk_widget_get_style_context(destdisp_head); + gtk_style_context_add_class(context, "section-expander"); GtkWidget *destdisp = dt_ui_section_label_new(_("parameters")); gtk_container_add(GTK_CONTAINER(header_evb), destdisp);