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



commit e5f4289ec7c006239553d7ae06113b7a242e8f6b
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      | 35 --------------------------------
 3 files changed, 8 insertions(+), 68 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 993c656..62fd2cc 100644
--- a/src/screenshot-config.c
+++ b/src/screenshot-config.c
@@ -136,6 +136,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
     {
@@ -151,12 +154,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 5c674b1..6e5f5ac 100644
--- a/src/screenshot-interactive-dialog.c
+++ b/src/screenshot-interactive-dialog.c
@@ -31,16 +31,6 @@
 #include "screenshot-utils.h"
 
 static GtkWidget *pointer_row = NULL;
-static GtkWidget *shadow_row = NULL;
-
-enum
-{
-  COLUMN_NICK,
-  COLUMN_LABEL,
-  COLUMN_ID,
-
-  N_COLUMNS
-};
 
 #define TARGET_TOGGLE_DESKTOP 0
 #define TARGET_TOGGLE_WINDOW  1
@@ -58,7 +48,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);
 
       screenshot_config->take_window_shot = take_window_shot;
@@ -80,23 +69,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"));
@@ -104,14 +80,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
@@ -148,9 +116,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]