[gimp/tito] app: remove the opacity feature from the action search dialog.



commit 7a28e27c27e6f237ce04871c137c0dfc33638ffb
Author: Jehan <jehan girinstud io>
Date:   Mon Jan 20 21:11:03 2014 +1300

    app: remove the opacity feature from the action search dialog.
    
    This is unnecessary feature for a first version and probably confusing.

 app/config/gimpguiconfig.c         |   14 -----
 app/config/gimpguiconfig.h         |    1 -
 app/dialogs/action-search-dialog.c |   97 ------------------------------------
 app/gui/session.c                  |   21 --------
 4 files changed, 0 insertions(+), 133 deletions(-)
---
diff --git a/app/config/gimpguiconfig.c b/app/config/gimpguiconfig.c
index 676b624..c1f9622 100644
--- a/app/config/gimpguiconfig.c
+++ b/app/config/gimpguiconfig.c
@@ -71,7 +71,6 @@ enum
   PROP_SEARCH_DIALOG_Y,
   PROP_SEARCH_DIALOG_WIDTH,
   PROP_SEARCH_DIALOG_HEIGHT,
-  PROP_SEARCH_DIALOG_OPACITY,
   PROP_SEARCH_SHOW_UNAVAILABLE_ACTIONS,
   PROP_ACTION_HISTORY_SIZE,
   PROP_USER_MANUAL_ONLINE,
@@ -263,13 +262,6 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass)
                                                      G_PARAM_READWRITE |
                                                      G_PARAM_CONSTRUCT |
                                                      GIMP_PARAM_STATIC_STRINGS));
-  g_object_class_install_property (object_class, PROP_SEARCH_DIALOG_OPACITY,
-                                   g_param_spec_int ("search-dialog-opacity",
-                                                     NULL, NULL,
-                                                     10, 100, 100,
-                                                     G_PARAM_READWRITE |
-                                                     G_PARAM_CONSTRUCT |
-                                                     GIMP_PARAM_STATIC_STRINGS));
   /* As a default, we hide unavailable actions. */
   GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SEARCH_SHOW_UNAVAILABLE_ACTIONS,
                                     "search-show-unavailable-actions", SEARCH_SHOW_UNAVAILABLE_BLURB,
@@ -495,9 +487,6 @@ gimp_gui_config_set_property (GObject      *object,
     case PROP_SEARCH_DIALOG_HEIGHT:
       gui_config->search_dialog_height = g_value_get_int (value);
       break;
-    case PROP_SEARCH_DIALOG_OPACITY:
-      gui_config->search_dialog_opacity = g_value_get_int (value);
-      break;
     case PROP_SEARCH_SHOW_UNAVAILABLE_ACTIONS:
       gui_config->search_show_unavailable = g_value_get_boolean (value);
       break;
@@ -642,9 +631,6 @@ gimp_gui_config_get_property (GObject    *object,
     case PROP_SEARCH_DIALOG_HEIGHT:
       g_value_set_int (value, gui_config->search_dialog_height);
       break;
-    case PROP_SEARCH_DIALOG_OPACITY:
-      g_value_set_int (value, gui_config->search_dialog_opacity);
-      break;
     case PROP_SEARCH_SHOW_UNAVAILABLE_ACTIONS:
       g_value_set_boolean (value, gui_config->search_show_unavailable);
       break;
diff --git a/app/config/gimpguiconfig.h b/app/config/gimpguiconfig.h
index c015524..404ceec 100644
--- a/app/config/gimpguiconfig.h
+++ b/app/config/gimpguiconfig.h
@@ -67,7 +67,6 @@ struct _GimpGuiConfig
   gint                 search_dialog_y;
   gint                 search_dialog_width;
   gint                 search_dialog_height;
-  gint                 search_dialog_opacity;
   gboolean             search_show_unavailable;
   gint                 action_history_size;
 
diff --git a/app/dialogs/action-search-dialog.c b/app/dialogs/action-search-dialog.c
index d6c654c..7e5a44b 100644
--- a/app/dialogs/action-search-dialog.c
+++ b/app/dialogs/action-search-dialog.c
@@ -50,9 +50,6 @@ typedef struct
   GtkWidget     *keyword_entry;
   GtkWidget     *results_list;
   GtkWidget     *list_view;
-
-  GtkWidget     *opacity_scale;
-  GtkAdjustment *opacity_adjustment;
 } SearchDialog;
 
 static void         key_released                           (GtkWidget         *widget,
@@ -89,14 +86,6 @@ static void         action_search_finalizer                (SearchDialog      *p
 static gboolean     window_configured                      (GtkWindow         *window,
                                                             GdkEvent          *event,
                                                             SearchDialog      *private);
-static gboolean     opacity_button_scrolled                (GtkWidget         *widget,
-                                                            GdkEvent          *event,
-                                                            SearchDialog      *private);
-static gboolean     opacity_button_clicked                 (GtkWidget         *widget,
-                                                            GdkEvent          *event,
-                                                            SearchDialog      *private);
-static void         opacity_scale_changed                  (GtkAdjustment     *adjustment,
-                                                            SearchDialog      *private);
 static void         action_search_setup_results_list       (GtkWidget        **results_list,
                                                             GtkWidget        **list_view);
 static void         search_dialog_free                     (SearchDialog      *private);
@@ -119,7 +108,6 @@ action_search_dialog_create (Gimp *gimp)
   SearchDialog  *private;
   GimpGuiConfig *config;
   GtkWidget     *main_vbox, *main_hbox;
-  GtkWidget     *opacity_button;
 
   gtk_accel_map_change_entry ("<Actions>/dialogs/dialogs-action-search", 'd', 0, FALSE);
 
@@ -137,7 +125,6 @@ action_search_dialog_create (Gimp *gimp)
 
   gtk_window_set_title (GTK_WINDOW (action_search_dialog), _("Search Actions"));
   action_search_update_position (private);
-  gtk_window_set_opacity (GTK_WINDOW (action_search_dialog), (gdouble) config->search_dialog_opacity / 
100.0);
 
   main_vbox = gtk_vbox_new (FALSE, 2);
   gtk_container_add (GTK_CONTAINER (action_search_dialog), main_vbox);
@@ -152,22 +139,6 @@ action_search_dialog_create (Gimp *gimp)
   gtk_widget_show (private->keyword_entry);
   gtk_box_pack_start (GTK_BOX (main_hbox), private->keyword_entry, TRUE, TRUE, 0);
 
-  opacity_button = gtk_button_new ();
-  gtk_button_set_image (GTK_BUTTON (opacity_button),
-                        gtk_image_new_from_stock (GIMP_STOCK_TRANSPARENCY,
-                                                  GTK_ICON_SIZE_MENU));
-  gtk_widget_set_can_focus (opacity_button, FALSE);
-  gtk_widget_set_events (opacity_button, GDK_BUTTON_PRESS_MASK);
-  gtk_widget_set_tooltip_text (opacity_button, _("Set this dialog opacity."));
-  gtk_box_pack_end (GTK_BOX (main_hbox), opacity_button, FALSE, TRUE, 0);
-  gtk_widget_show (opacity_button);
-
-  private->opacity_adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (100.0, 40.0, 100.0,
-                                                                    1.0, 10.0, 0.0));
-  private->opacity_scale = gimp_spin_scale_new (private->opacity_adjustment, _("Dialog Opacity"), 1);
-  gtk_box_pack_end (GTK_BOX (main_hbox), private->opacity_scale, TRUE, TRUE, 0);
-  gtk_widget_set_can_focus (private->opacity_scale, FALSE);
-
   action_search_setup_results_list (&private->results_list, &private->list_view);
   gtk_box_pack_start (GTK_BOX (main_vbox), private->list_view, TRUE, TRUE, 0);
 
@@ -179,9 +150,6 @@ action_search_dialog_create (Gimp *gimp)
   g_signal_connect (private->keyword_entry, "key-release-event", G_CALLBACK (key_released), private);
   g_signal_connect (private->results_list, "key_press_event", G_CALLBACK (result_selected), private);
   g_signal_connect (action_search_dialog, "event", G_CALLBACK (window_configured), private);
-  g_signal_connect (opacity_button, "scroll-event", G_CALLBACK (opacity_button_scrolled), private);
-  g_signal_connect (opacity_button, "clicked", G_CALLBACK (opacity_button_clicked), private);
-  g_signal_connect (private->opacity_adjustment, "value-changed", G_CALLBACK (opacity_scale_changed), 
private);
 
   gtk_widget_show (action_search_dialog);
 
@@ -868,71 +836,6 @@ window_configured (GtkWindow    *window,
   return FALSE;
 }
 
-static gboolean
-opacity_button_scrolled (GtkWidget    *widget,
-                         GdkEvent     *event,
-                         SearchDialog *private)
-{
-  GdkEventScroll *scroll      = (GdkEventScroll*) event;
-  GimpGuiConfig  *config      = private->config;
-  gint            new_opacity = config->search_dialog_opacity;
-
-  switch (scroll->direction)
-    {
-    case GDK_SCROLL_UP:
-      new_opacity = MIN (config->search_dialog_opacity + 2, 100);
-      break;
-
-    case GDK_SCROLL_DOWN:
-      new_opacity = MAX (config->search_dialog_opacity - 2, 40);
-      break;
-
-    default:
-      break;
-    }
-
-  if (new_opacity != config->search_dialog_opacity)
-    {
-      gtk_adjustment_set_value (private->opacity_adjustment,
-                                (gdouble) new_opacity);
-      return TRUE;
-    }
-
-  return FALSE;
-}
-
-static gboolean
-opacity_button_clicked (GtkWidget    *widget,
-                        GdkEvent     *event,
-                        SearchDialog *private)
-{
-  if (gtk_widget_get_visible (private->opacity_scale))
-    {
-      gtk_widget_hide (private->opacity_scale);
-    }
-  else
-    {
-      gtk_widget_show (private->opacity_scale);
-    }
-
-  return TRUE;
-}
-
-static void
-opacity_scale_changed (GtkAdjustment *adjustment,
-                       SearchDialog  *private)
-{
-  GimpGuiConfig *config  = private->config;
-  gdouble        opacity = gtk_adjustment_get_value (adjustment);
-
-  if (opacity != config->search_dialog_opacity)
-    {
-      config->search_dialog_opacity = opacity;
-      gtk_window_set_opacity (GTK_WINDOW (private->dialog),
-                              (gdouble) opacity / 100.0);
-    }
-}
-
 static void
 action_search_setup_results_list (GtkWidget **results_list,
                                   GtkWidget **list_view)
diff --git a/app/gui/session.c b/app/gui/session.c
index 954e47c..cef676a 100644
--- a/app/gui/session.c
+++ b/app/gui/session.c
@@ -65,7 +65,6 @@ enum
   SEARCH_DIALOG_POS_Y,
   SEARCH_DIALOG_WIDTH,
   SEARCH_DIALOG_HEIGHT,
-  SEARCH_DIALOG_OPACITY,
   LAST_TIP_SHOWN
 };
 
@@ -130,8 +129,6 @@ session_init (Gimp *gimp)
                               GINT_TO_POINTER (SEARCH_DIALOG_WIDTH));
   g_scanner_scope_add_symbol (scanner, 0,  "search-dialog-height",
                               GINT_TO_POINTER (SEARCH_DIALOG_HEIGHT));
-  g_scanner_scope_add_symbol (scanner, 0,  "search-dialog-opacity",
-                              GINT_TO_POINTER (SEARCH_DIALOG_OPACITY));
   g_scanner_scope_add_symbol (scanner, 0,  "last-tip-shown",
                               GINT_TO_POINTER (LAST_TIP_SHOWN));
 
@@ -335,19 +332,6 @@ session_init (Gimp *gimp)
                             "search-dialog-height", pos,
                             NULL);
             }
-          else if (scanner->value.v_symbol == GINT_TO_POINTER (SEARCH_DIALOG_OPACITY))
-            {
-              gint pos;
-
-              token = G_TOKEN_INT;
-
-              if (! gimp_scanner_parse_int (scanner, &pos))
-                break;
-
-              g_object_set (gimp->config,
-                            "search-dialog-opacity", pos,
-                            NULL);
-            }
           else if (scanner->value.v_symbol == GINT_TO_POINTER (LAST_TIP_SHOWN))
             {
               gint last_tip_shown;
@@ -495,11 +479,6 @@ session_save (Gimp     *gimp,
                              GIMP_GUI_CONFIG (gimp->config)->search_dialog_height);
   gimp_config_writer_close (writer);
 
-  gimp_config_writer_open (writer, "search-dialog-opacity");
-  gimp_config_writer_printf (writer, "%d",
-                             GIMP_GUI_CONFIG (gimp->config)->search_dialog_opacity);
-  gimp_config_writer_close (writer);
-
   gimp_config_writer_open (writer, "last-tip-shown");
   gimp_config_writer_printf (writer, "%d",
                              GIMP_GUI_CONFIG (gimp->config)->last_tip_shown);


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