+ /* This extra margin is necessary so we have room to the sides
+ * to place the popups as desired
+ */
+ gtk_widget_set_margin_left (grid, 30);
+ gtk_widget_set_margin_right (grid, 30);
+
+ editor->priv->overlay = gtk_overlay_new ();
+ gtk_widget_override_background_color (editor->priv->overlay, 0, &transparent);
+ gtk_container_add (GTK_CONTAINER (editor->priv->overlay), grid);
+
+ /* Construct the sv popup */
+ editor->priv->s_entry = entry = gtk_spin_button_new (scaled_adjustment (s_adj, 100), 1, 0);
+ atk_obj = gtk_widget_get_accessible (entry);
+ atk_object_set_name (atk_obj, C_("Color channel", "Saturation"));
+ atk_object_set_role (atk_obj, ATK_ROLE_ENTRY);
+ g_signal_connect (entry, "key-press-event", G_CALLBACK (popup_key_press), editor);
+
+ editor->priv->v_entry = entry = gtk_spin_button_new (scaled_adjustment (v_adj, 100), 1, 0);
+ atk_obj = gtk_widget_get_accessible (entry);
+ atk_object_set_name (atk_obj, C_("Color channel", "Value"));
+ atk_object_set_role (atk_obj, ATK_ROLE_ENTRY);
+ g_signal_connect (entry, "key-press-event", G_CALLBACK (popup_key_press), editor);
+
+ grid = gtk_grid_new ();
+ gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
+ gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
+
+ gtk_grid_attach (GTK_GRID (grid), gtk_label_new (C_("Color channel", "S")), 0, 0, 1, 1);
+ gtk_grid_attach (GTK_GRID (grid), editor->priv->s_entry, 1, 0, 1, 1);
+ gtk_grid_attach (GTK_GRID (grid), gtk_label_new (C_("Color channel", "V")), 0, 1, 1, 1);
+ gtk_grid_attach (GTK_GRID (grid), editor->priv->v_entry, 1, 1, 1, 1);
+
+ editor->priv->sv_popup = create_popup (editor, editor->priv->sv_plane, grid);
+
+ /* Construct the h popup */
+ editor->priv->h_entry = entry = gtk_spin_button_new (scaled_adjustment (h_adj, 100), 1, 0);
+ atk_obj = gtk_widget_get_accessible (entry);
+ atk_object_set_name (atk_obj, C_("Color channel", "Hue"));
+ atk_object_set_role (atk_obj, ATK_ROLE_ENTRY);
+ g_signal_connect (entry, "key-press-event", G_CALLBACK (popup_key_press), editor);
+
+ grid = gtk_grid_new ();
+ gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
+
+ gtk_grid_attach (GTK_GRID (grid), gtk_label_new (C_("Color channel", "H")), 0, 0, 1, 1);
+ gtk_grid_attach (GTK_GRID (grid), editor->priv->h_entry, 1, 0, 1, 1);
+
+ editor->priv->h_popup = create_popup (editor, editor->priv->h_slider, grid);
+
+ /* Construct the a popup */
+ editor->priv->a_entry = entry = gtk_spin_button_new (scaled_adjustment (a_adj, 100), 1, 0);
+ atk_obj = gtk_widget_get_accessible (entry);
+ atk_object_set_name (atk_obj, C_("Color channel", "Alpha"));
+ atk_object_set_role (atk_obj, ATK_ROLE_ENTRY);
+ g_signal_connect (entry, "key-press-event", G_CALLBACK (popup_key_press), editor);
+
+ grid = gtk_grid_new ();
+ gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
+
+ gtk_grid_attach (GTK_GRID (grid), gtk_label_new (C_("Color channel", "A")), 0, 0, 1, 1);
+ gtk_grid_attach (GTK_GRID (grid), editor->priv->a_entry, 1, 0, 1, 1);
+
+ editor->priv->a_popup = create_popup (editor, editor->priv->a_slider, grid);
+
+ /* Hook up popup positioning */
+ g_signal_connect (editor->priv->overlay, "get-child-position", G_CALLBACK (get_child_position), editor);
+ g_signal_connect (editor, "notify::visible", G_CALLBACK (dismiss_current_popup), NULL);
+
+ gtk_widget_show_all (editor->priv->overlay);
+ gtk_container_add (GTK_CONTAINER (editor), editor->priv->overlay);
+