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



commit c43be61c088f19c10ddf369aa66b8e868f664ca3
Author: Michael Natterer <mitch gimp org>
Date:   Mon Jan 1 17:57:46 2018 +0100

    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.

 app/dialogs/fade-dialog.c |   28 +++++++++++++---------------
 1 files changed, 13 insertions(+), 15 deletions(-)
---
diff --git a/app/dialogs/fade-dialog.c b/app/dialogs/fade-dialog.c
index 30bfaf4..f603a86 100644
--- a/app/dialogs/fade-dialog.c
+++ b/app/dialogs/fade-dialog.c
@@ -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),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]