[gnome-screenshot/wip/exalm/shadow: 4/4] interactive-dialog: Drop window shadow option



commit 618422620f7517b40e6a8c270d38eb7c519fb51a
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Tue Mar 10 20:53:37 2020 +0500

    interactive-dialog: Drop window shadow option
    
    The window shadow looks very dated, and doesn't match CSD window shadows.
    Moreover, screenshots of CSD windows now include their actual shadow, so
    this shadow stacks with it. While legacy windows still don't have shadow
    on screenshots, it should be fixed in mutter rather than here, so just
    drop the option and assume it's off.
    
    Fixes https://gitlab.gnome.org/GNOME/gnome-screenshot/issues/79

 data/ui/screenshot-interactive-dialog.ui | 28 -------------------------
 src/screenshot-config.c                  | 13 +++++++-----
 src/screenshot-interactive-dialog.c      | 36 --------------------------------
 3 files changed, 8 insertions(+), 69 deletions(-)
---
diff --git a/data/ui/screenshot-interactive-dialog.ui b/data/ui/screenshot-interactive-dialog.ui
index b8841b8..c19dd2a 100644
--- a/data/ui/screenshot-interactive-dialog.ui
+++ b/data/ui/screenshot-interactive-dialog.ui
@@ -170,34 +170,6 @@
                 </child>
               </object>
             </child>
-            <child>
-              <object class="GtkListBoxRow" id="shadowrow">
-                <property name="visible">True</property>
-                <child>
-                  <object class="GtkBox">
-                    <property name="visible">True</property>
-                    <property name="margin">12</property>
-                    <property name="spacing">10</property>
-                    <child>
-                      <object class="GtkLabel">
-                        <property name="visible">True</property>
-                        <property name="halign">start</property>
-                        <property name="hexpand">True</property>
-                        <property name="label" translatable="yes">Window S_hadow</property>
-                        <property name="use_underline">True</property>
-                        <property name="mnemonic_widget">shadow</property>
-                      </object>
-                    </child>
-                    <child>
-                      <object class="GtkSwitch" id="shadow">
-                        <property name="visible">True</property>
-                        <property name="active">True</property>
-                      </object>
-                    </child>
-                  </object>
-                </child>
-              </object>
-            </child>
             <child>
               <object class="GtkListBoxRow" id="delayrow">
                 <property name="visible">True</property>
diff --git a/src/screenshot-config.c b/src/screenshot-config.c
index c095f24..53c7ffb 100644
--- a/src/screenshot-config.c
+++ b/src/screenshot-config.c
@@ -143,6 +143,9 @@ screenshot_config_parse_command_line (gboolean clipboard_arg,
         screenshot_config->include_border = TRUE;
       if (disable_border_arg)
         screenshot_config->include_border = FALSE;
+
+      g_free (screenshot_config->border_effect);
+      screenshot_config->border_effect = g_strdup ("none");
     }
   else
     {
@@ -158,12 +161,12 @@ screenshot_config_parse_command_line (gboolean clipboard_arg,
       screenshot_config->copy_to_clipboard = clipboard_arg;
       if (file_arg != NULL)
         screenshot_config->file = g_file_new_for_commandline_arg (file_arg);
-    }
 
-  if (border_effect_arg != NULL)
-    {
-      g_free (screenshot_config->border_effect);
-      screenshot_config->border_effect = g_strdup (border_effect_arg);
+      if (border_effect_arg != NULL)
+        {
+          g_free (screenshot_config->border_effect);
+          screenshot_config->border_effect = g_strdup (border_effect_arg);
+        }
     }
 
   screenshot_config->take_window_shot = window_arg;
diff --git a/src/screenshot-interactive-dialog.c b/src/screenshot-interactive-dialog.c
index 2798c84..e75954f 100644
--- a/src/screenshot-interactive-dialog.c
+++ b/src/screenshot-interactive-dialog.c
@@ -31,18 +31,8 @@
 #include "screenshot-utils.h"
 
 static GtkWidget *pointer_row = NULL;
-static GtkWidget *shadow_row = NULL;
 static GtkWidget *delay_row = NULL;
 
-enum
-{
-  COLUMN_NICK,
-  COLUMN_LABEL,
-  COLUMN_ID,
-
-  N_COLUMNS
-};
-
 #define TARGET_TOGGLE_DESKTOP 0
 #define TARGET_TOGGLE_WINDOW  1
 #define TARGET_TOGGLE_AREA    2
@@ -59,8 +49,6 @@ target_toggled_cb (GtkToggleButton *button,
       take_window_shot = (target_toggle == TARGET_TOGGLE_WINDOW);
       take_area_shot = (target_toggle == TARGET_TOGGLE_AREA);
 
-      gtk_widget_set_sensitive (shadow_row, take_window_shot);
-
       gtk_widget_set_sensitive (pointer_row, !take_area_shot);
       gtk_widget_set_sensitive (delay_row, !take_area_shot);
 
@@ -83,23 +71,10 @@ include_pointer_toggled_cb (GtkSwitch *toggle,
   gtk_switch_set_state (toggle, gtk_switch_get_active (toggle));
 }
 
-static void
-use_shadow_toggled_cb (GtkSwitch *toggle,
-                         gpointer     user_data)
-{
-  if (gtk_switch_get_active (toggle))
-    screenshot_config->border_effect = "shadow";
-  else
-    screenshot_config->border_effect = "none";
-  gtk_switch_set_state (toggle, gtk_switch_get_active (toggle));
-}
-
 static void
 connect_effects_frame (GtkBuilder *ui)
 {
   GtkWidget *pointer;
-  GtkWidget *shadow;
-  gboolean use_shadow;
 
   /** Include pointer **/
   pointer = GTK_WIDGET (gtk_builder_get_object (ui, "pointer"));
@@ -107,14 +82,6 @@ connect_effects_frame (GtkBuilder *ui)
   g_signal_connect (pointer, "state-set",
                     G_CALLBACK (include_pointer_toggled_cb),
                     NULL);
-
-  /** Use shadow **/
-  use_shadow = !g_strcmp0 (screenshot_config->border_effect, "shadow");
-  shadow = GTK_WIDGET (gtk_builder_get_object (ui, "shadow"));
-  gtk_switch_set_active (GTK_SWITCH (shadow), use_shadow);
-  g_signal_connect (shadow, "state-set",
-                    G_CALLBACK (use_shadow_toggled_cb),
-                    NULL);
 }
 
 static void
@@ -151,9 +118,6 @@ connect_screenshot_frame (GtkBuilder *ui)
                     GINT_TO_POINTER (TARGET_TOGGLE_WINDOW));
   group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (window));
 
-  shadow_row = GTK_WIDGET (gtk_builder_get_object (ui, "shadowrow"));
-  gtk_widget_set_sensitive (shadow_row, screenshot_config->take_window_shot);
-
   /** Grab area of the desktop **/
   selection = GTK_WIDGET (gtk_builder_get_object (ui, "selection"));
 


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