aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2022-11-24 16:19:42 +0100
committerThomas White <taw@physics.org>2022-11-24 17:48:13 +0100
commit62533462347d0379d1a4d9935d29fe58aa3b4804 (patch)
treeeac2f685ae9a3c57c45f70a4dfe34ab594dea1bb
parent2754cd0ecdd199f46edf656100a4a9cd0440b7a1 (diff)
GUI: Colour scale, part 4: Add manual "reset scale" option
-rw-r--r--src/crystfel_gui.c10
-rw-r--r--src/crystfelcolourscale.c1
2 files changed, 11 insertions, 0 deletions
diff --git a/src/crystfel_gui.c b/src/crystfel_gui.c
index 25b7e1d8..885b3541 100644
--- a/src/crystfel_gui.c
+++ b/src/crystfel_gui.c
@@ -530,6 +530,13 @@ static gint reset_zoom_sig(GtkWidget *widget, struct crystfelproject *proj)
}
+static gint reset_range_sig(GtkWidget *widget, struct crystfelproject *proj)
+{
+ crystfel_colour_scale_auto_range(CRYSTFEL_COLOUR_SCALE(proj->colscale));
+ return FALSE;
+}
+
+
static gint first_frame_sig(GtkWidget *widget,
struct crystfelproject *proj)
{
@@ -811,6 +818,7 @@ static void add_menu_bar(struct crystfelproject *proj, GtkWidget *vbox)
" <menuitem name=\"resrings\" action=\"ResolutionRingsAction\" />"
" <separator />"
" <menuitem name=\"resetzoom\" action=\"ResetZoomAction\" />"
+ " <menuitem name=\"resetrange\" action=\"ResetRangeAction\" />"
"</menu>"
"<menu name=\"tools\" action=\"ToolsAction\" >"
" <menuitem name=\"rescanonchange\" action=\"RescanOnChangeAction\" />"
@@ -836,6 +844,8 @@ static void add_menu_bar(struct crystfelproject *proj, GtkWidget *vbox)
{ "ViewAction", NULL, "_View", NULL, NULL, NULL },
{ "ResetZoomAction", NULL, "Reset zoom", NULL, NULL,
G_CALLBACK(reset_zoom_sig) },
+ { "ResetRangeAction", NULL, "Reset colour scale", NULL, NULL,
+ G_CALLBACK(reset_range_sig) },
{ "ToolsAction", NULL, "_Tools", NULL, NULL, NULL },
{ "RescanAction", NULL, "Rescan streams", NULL, NULL,
diff --git a/src/crystfelcolourscale.c b/src/crystfelcolourscale.c
index 85a1fce9..d9189d46 100644
--- a/src/crystfelcolourscale.c
+++ b/src/crystfelcolourscale.c
@@ -304,6 +304,7 @@ void crystfel_colour_scale_auto_range(CrystFELColourScale *cs)
make_histogram(cs);
g_signal_emit_by_name(cs, "range-changed");
+ gtk_widget_queue_draw(GTK_WIDGET(cs));
}