Commit c43be61c authored by Michael Natterer's avatar Michael Natterer 😴

Bug 788423 - Fade left-right opacity slider doesn't work: value changes to 1.0

Use a GimpSpinScale widget instead of scale entry cruft, it handles
the model vs. view factor of 100.0 correctly. Also modernize the GUI
without using a table.
parent 764056e1
......@@ -33,6 +33,7 @@
#include "core/gimpdrawableundo.h"
#include "core/gimpundostack.h"
#include "widgets/gimplayermodebox.h"
#include "widgets/gimppropwidgets.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpviewabledialog.h"
......@@ -76,10 +77,9 @@ fade_dialog_new (GimpImage *image,
GtkWidget *dialog;
GtkWidget *main_vbox;
GtkWidget *table;
GtkWidget *menu;
GtkWidget *scale;
gchar *title;
gint table_row = 0;
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
g_return_val_if_fail (GTK_IS_WIDGET (parent), NULL);
......@@ -138,30 +138,28 @@ fade_dialog_new (GimpImage *image,
G_CALLBACK (fade_dialog_response),
private);
main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 4);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
main_vbox, TRUE, TRUE, 0);
gtk_widget_show (main_vbox);
table = gtk_table_new (3, 3, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
gtk_box_pack_start (GTK_BOX (main_vbox), table, FALSE, FALSE, 0);
gtk_widget_show (table);
/* the paint mode menu */
menu = gimp_prop_layer_mode_box_new (G_OBJECT (private->context),
"paint-mode",
GIMP_LAYER_MODE_CONTEXT_FADE);
gimp_table_attach_aligned (GTK_TABLE (table), 0, table_row++,
_("_Mode:"), 0.0, 0.5,
menu, 2, FALSE);
gimp_layer_mode_box_set_label (GIMP_LAYER_MODE_BOX (menu), _("Mode"));
gtk_box_pack_start (GTK_BOX (main_vbox), menu, FALSE, FALSE, 0);
gtk_widget_show (menu);
/* the opacity scale */
gimp_prop_opacity_entry_new (G_OBJECT (private->context), "opacity",
GTK_TABLE (table), 0, table_row++,
_("_Opacity:"));
scale = gimp_prop_spin_scale_new (G_OBJECT (private->context),
"opacity",
_("Opacity"),
0.01, 0.1, 2);
gimp_prop_widget_set_factor (scale, 100, 1.0, 10.0, 1);
gtk_box_pack_start (GTK_BOX (main_vbox), scale, FALSE, FALSE, 0);
gtk_widget_show (scale);
g_signal_connect_swapped (private->context, "paint-mode-changed",
G_CALLBACK (fade_dialog_context_changed),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment