app: use gimp_prop_boolean_icon_box_new() instead of the "Linear" toggle

in the curves and levels tools and in the histogram dockable.
This commit is contained in:
Michael Natterer 2018-01-06 03:12:23 +01:00
parent 6374218408
commit 28bb108e1b
3 changed files with 30 additions and 21 deletions

View File

@ -43,8 +43,9 @@
#include "core/gimpimage.h" #include "core/gimpimage.h"
#include "widgets/gimpcolorbar.h" #include "widgets/gimpcolorbar.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpcurveview.h" #include "widgets/gimpcurveview.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimppropwidgets.h"
#include "widgets/gimpwidgets-utils.h" #include "widgets/gimpwidgets-utils.h"
#include "display/gimpdisplay.h" #include "display/gimpdisplay.h"
@ -443,10 +444,15 @@ gimp_curves_tool_dialog (GimpFilterTool *filter_tool)
gtk_box_pack_end (GTK_BOX (hbox), hbox2, FALSE, FALSE, 0); gtk_box_pack_end (GTK_BOX (hbox), hbox2, FALSE, FALSE, 0);
gtk_widget_show (hbox2); gtk_widget_show (hbox2);
button = gimp_prop_check_button_new (G_OBJECT (config), "linear", NULL); /* The linear/perceptual radio buttons */
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (button), FALSE); hbox2 = gimp_prop_boolean_icon_box_new (G_OBJECT (config),
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); "linear",
gtk_widget_show (button); GIMP_ICON_COLOR_SPACE_LINEAR,
GIMP_ICON_COLOR_SPACE_PERCEPTUAL,
_("Adjust curves in linear light"),
_("Adjust curves perceptually"));
gtk_box_pack_end (GTK_BOX (hbox), hbox2, FALSE, FALSE, 0);
gtk_widget_show (hbox2);
frame_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 4); frame_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 4);
gtk_container_add (GTK_CONTAINER (main_frame), frame_vbox); gtk_container_add (GTK_CONTAINER (main_frame), frame_vbox);

View File

@ -380,16 +380,22 @@ gimp_levels_tool_dialog (GimpFilterTool *filter_tool)
G_CALLBACK (levels_channel_reset_callback), G_CALLBACK (levels_channel_reset_callback),
tool); tool);
/* The histogram scale radio buttons */
hbox2 = gimp_prop_enum_icon_box_new (G_OBJECT (tool_options), hbox2 = gimp_prop_enum_icon_box_new (G_OBJECT (tool_options),
"histogram-scale", "gimp-histogram", "histogram-scale", "gimp-histogram",
0, 0); 0, 0);
gtk_box_pack_end (GTK_BOX (hbox), hbox2, FALSE, FALSE, 0); gtk_box_pack_end (GTK_BOX (hbox), hbox2, FALSE, FALSE, 0);
gtk_widget_show (hbox2); gtk_widget_show (hbox2);
button = gimp_prop_check_button_new (G_OBJECT (config), "linear", NULL); /* The linear/perceptual radio buttons */
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (button), FALSE); hbox2 = gimp_prop_boolean_icon_box_new (G_OBJECT (config),
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); "linear",
gtk_widget_show (button); GIMP_ICON_COLOR_SPACE_LINEAR,
GIMP_ICON_COLOR_SPACE_PERCEPTUAL,
_("Adjust levels in linear light"),
_("Adjust levels perceptually"));
gtk_box_pack_end (GTK_BOX (hbox), hbox2, FALSE, FALSE, 0);
gtk_widget_show (hbox2);
frame_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 4); frame_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 4);
gtk_container_add (GTK_CONTAINER (main_frame), frame_vbox); gtk_container_add (GTK_CONTAINER (main_frame), frame_vbox);

View File

@ -35,6 +35,7 @@
#include "gimphistogrambox.h" #include "gimphistogrambox.h"
#include "gimphistogrameditor.h" #include "gimphistogrameditor.h"
#include "gimphistogramview.h" #include "gimphistogramview.h"
#include "gimppropwidgets.h"
#include "gimpsessioninfo-aux.h" #include "gimpsessioninfo-aux.h"
#include "gimpwidgets-utils.h" #include "gimpwidgets-utils.h"
@ -119,7 +120,6 @@ gimp_histogram_editor_init (GimpHistogramEditor *editor)
GtkWidget *hbox; GtkWidget *hbox;
GtkWidget *label; GtkWidget *label;
GtkWidget *menu; GtkWidget *menu;
GtkWidget *button;
GtkWidget *table; GtkWidget *table;
gint i; gint i;
@ -139,7 +139,7 @@ gimp_histogram_editor_init (GimpHistogramEditor *editor)
view = GIMP_HISTOGRAM_BOX (editor->box)->view; view = GIMP_HISTOGRAM_BOX (editor->box)->view;
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
gtk_box_pack_start (GTK_BOX (editor), hbox, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (editor), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox); gtk_widget_show (hbox);
@ -165,16 +165,13 @@ gimp_histogram_editor_init (GimpHistogramEditor *editor)
gtk_box_pack_end (GTK_BOX (hbox), menu, FALSE, FALSE, 0); gtk_box_pack_end (GTK_BOX (hbox), menu, FALSE, FALSE, 0);
gtk_widget_show (menu); gtk_widget_show (menu);
button = gimp_prop_check_button_new (G_OBJECT (editor), "linear", NULL); menu = gimp_prop_boolean_icon_box_new (G_OBJECT (editor), "linear",
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (button), FALSE); GIMP_ICON_COLOR_SPACE_LINEAR,
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0); GIMP_ICON_COLOR_SPACE_PERCEPTUAL,
gtk_widget_show (button); _("Show values in linear space"),
_("Show values in perceptual space"));
gimp_help_set_help_data (button, gtk_box_pack_end (GTK_BOX (hbox), menu, FALSE, FALSE, 0);
"This button switches between a histogram in " gtk_widget_show (menu);
"sRGB (gamma corrected) space and a histogram "
"in linear space. Also, it's horrible UI and "
"needs to be changed.", NULL);
gtk_box_pack_start (GTK_BOX (editor), editor->box, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (editor), editor->box, TRUE, TRUE, 0);
gtk_widget_show (GTK_WIDGET (editor->box)); gtk_widget_show (GTK_WIDGET (editor->box));