aboutsummaryrefslogtreecommitdiff
path: root/src/crystfel_gui.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-01-07 12:16:34 +0100
committerThomas White <taw@physics.org>2021-01-07 12:27:06 +0100
commit97eb1a231a07777a961efe6a389597989d1b7dc4 (patch)
tree303e93bd9bad6e13cf71fb705b5a7a096f160b4b /src/crystfel_gui.c
parent801aca3557fed6883ccc7a84b5ca38005cb6244c (diff)
GUI: Basic labelling of reflections
Lots of improvements still to be made here, such as using the "real" Cairo text API as well as using proper overlines for negative indices.
Diffstat (limited to 'src/crystfel_gui.c')
-rw-r--r--src/crystfel_gui.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/crystfel_gui.c b/src/crystfel_gui.c
index cf727018..09011830 100644
--- a/src/crystfel_gui.c
+++ b/src/crystfel_gui.c
@@ -204,6 +204,8 @@ void update_imageview(struct crystfelproject *proj)
crystfel_image_view_set_show_reflections(CRYSTFEL_IMAGE_VIEW(proj->imageview),
proj->show_refls);
+ crystfel_image_view_set_label_reflections(CRYSTFEL_IMAGE_VIEW(proj->imageview),
+ proj->label_refls);
crystfel_image_view_set_refl_box_size(CRYSTFEL_IMAGE_VIEW(proj->imageview),
proj->indexing_params.ir_inn);
crystfel_image_view_set_show_peaks(CRYSTFEL_IMAGE_VIEW(proj->imageview),
@@ -740,6 +742,15 @@ static gint show_refls_sig(GtkWidget *w, struct crystfelproject *proj)
}
+static gint label_refls_sig(GtkWidget *w, struct crystfelproject *proj)
+{
+ proj->label_refls = gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(w));
+ crystfel_image_view_set_label_reflections(CRYSTFEL_IMAGE_VIEW(proj->imageview),
+ proj->label_refls);
+ return FALSE;
+}
+
+
static void add_menu_bar(struct crystfelproject *proj, GtkWidget *vbox)
{
GError *error = NULL;
@@ -752,6 +763,7 @@ static void add_menu_bar(struct crystfelproject *proj, GtkWidget *vbox)
"<menu name=\"view\" action=\"ViewAction\" >"
" <menuitem name=\"peaks\" action=\"PeaksAction\" />"
" <menuitem name=\"refls\" action=\"ReflsAction\" />"
+ " <menuitem name=\"labelrefls\" action=\"LabelReflsAction\" />"
"</menu>"
"<menu name=\"tools\" action=\"ToolsAction\" >"
"</menu>"
@@ -783,6 +795,8 @@ static void add_menu_bar(struct crystfelproject *proj, GtkWidget *vbox)
G_CALLBACK(show_peaks_sig), FALSE },
{ "ReflsAction", NULL, "Calculated reflection positions", NULL, NULL,
G_CALLBACK(show_refls_sig), FALSE },
+ { "LabelReflsAction", NULL, "Show reflection indices", NULL, NULL,
+ G_CALLBACK(label_refls_sig), FALSE },
};
proj->action_group = gtk_action_group_new("cellwindow");
@@ -1093,6 +1107,10 @@ int main(int argc, char *argv[])
gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(w),
proj.show_refls);
+ w = gtk_ui_manager_get_action(proj.ui, "/mainwindow/view/labelrefls");
+ gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(w),
+ proj.label_refls);
+
update_imageview(&proj);
}