[gnome-screenshot/wip/exalm/cleanup-cli: 2/2] Remove border effects
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-screenshot/wip/exalm/cleanup-cli: 2/2] Remove border effects
- Date: Thu, 2 Apr 2020 22:36:37 +0000 (UTC)
commit 90a9498786698692472d253b69414bfd9efbfd0a
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Fri Apr 3 03:32:15 2020 +0500
Remove border effects
The border effects aren't included in GUI anymore, and don't work well
since window shadows are now handled by gnome-shell.
To simplify the code, just remove them.
Deprecate --border-effect CLI option, print a warning when it's in use.
Update the manpage.
Remove the corresponding gsettings key.
data/gnome-screenshot.1 | 6 +-
data/org.gnome.gnome-screenshot.gschema.xml | 5 -
src/meson.build | 1 -
src/screenshot-application.c | 22 +--
src/screenshot-config.c | 21 +--
src/screenshot-config.h | 2 -
src/screenshot-shadow.c | 277 ----------------------------
src/screenshot-shadow.h | 26 ---
8 files changed, 7 insertions(+), 353 deletions(-)
---
diff --git a/data/gnome-screenshot.1 b/data/gnome-screenshot.1
index 4627b79..1f575f6 100644
--- a/data/gnome-screenshot.1
+++ b/data/gnome-screenshot.1
@@ -7,8 +7,7 @@ gnome-screenshot \- capture the screen, a window, or an user-defined area and sa
.SH "DESCRIPTION"
.PP
\fBgnome-screenshot\fR is a GNOME utility for taking
-screenshots of the entire screen, a window or a user-defined area of the screen, with optional beautifying
-border effects.
+screenshots of the entire screen, a window or a user-defined area of the screen.
.SH "OPTIONS"
.TP
\fB-c, --clipboard\fR
@@ -42,7 +41,8 @@ Add an effect to the outside of the screenshot border.
space around the screenshot), ``vintage'' (desaturating
the screenshot slightly, tinting it and adding
rectangular space around it) or ``none'' (no effect).
-Default is ``none''.
+Default is ``none''. Note: This option is deprecated
+and is assumed to be ``none''.
.TP
\fB-i, --interactive\fR
Interactively set options in a dialog.
diff --git a/data/org.gnome.gnome-screenshot.gschema.xml b/data/org.gnome.gnome-screenshot.gschema.xml
index ffb6075..63435cc 100644
--- a/data/org.gnome.gnome-screenshot.gschema.xml
+++ b/data/org.gnome.gnome-screenshot.gschema.xml
@@ -36,11 +36,6 @@
<summary>Include ICC Profile</summary>
<description>Include the ICC profile of the target in the screenshot file</description>
</key>
- <key name="border-effect" type="s">
- <default>'none'</default>
- <summary>Border Effect</summary>
- <description>Effect to add to the outside of a border. Possible values are “shadow”, “none”, and
“border”.</description>
- </key>
<key name="default-file-type" enum="org.gnome.gnome-screenshot.file-types">
<default>'png'</default>
<summary>Default file type extension</summary>
diff --git a/src/meson.build b/src/meson.build
index caca42f..85d68e7 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -9,7 +9,6 @@ sources = [
'screenshot-dialog.c',
'screenshot-filename-builder.c',
'screenshot-interactive-dialog.c',
- 'screenshot-shadow.c',
'screenshot-utils.c',
]
diff --git a/src/screenshot-application.c b/src/screenshot-application.c
index 11c367c..38d801d 100644
--- a/src/screenshot-application.c
+++ b/src/screenshot-application.c
@@ -36,7 +36,6 @@
#include "screenshot-config.h"
#include "screenshot-filename-builder.h"
#include "screenshot-interactive-dialog.h"
-#include "screenshot-shadow.h"
#include "screenshot-utils.h"
#include "screenshot-dialog.h"
@@ -481,25 +480,6 @@ finish_take_screenshot (ScreenshotApplication *self)
return;
}
- if (screenshot_config->take_window_shot)
- {
- switch (screenshot_config->border_effect[0])
- {
- case 's': /* shadow */
- screenshot_add_shadow (&screenshot);
- break;
- case 'b': /* border */
- screenshot_add_border (&screenshot);
- break;
- case 'v': /* vintage */
- screenshot_add_vintage (&screenshot);
- break;
- case 'n': /* none */
- default:
- break;
- }
- }
-
self->priv->screenshot = screenshot;
if (screenshot_config->copy_to_clipboard)
@@ -613,7 +593,7 @@ static const GOptionEntry entries[] = {
{ "remove-border", 'B', 0, G_OPTION_ARG_NONE, NULL, N_("Remove the window border from the screenshot. This
option is deprecated and window border is always included"), NULL },
{ "include-pointer", 'p', 0, G_OPTION_ARG_NONE, NULL, N_("Include the pointer with the screenshot"), NULL
},
{ "delay", 'd', 0, G_OPTION_ARG_INT, NULL, N_("Take screenshot after specified delay [in seconds]"),
N_("seconds") },
- { "border-effect", 'e', 0, G_OPTION_ARG_STRING, NULL, N_("Effect to add to the border (shadow, border,
vintage or none)"), N_("effect") },
+ { "border-effect", 'e', 0, G_OPTION_ARG_STRING, NULL, N_("Effect to add to the border (shadow, border,
vintage or none). Note: This option is deprecated and is assumed to be none"), N_("effect") },
{ "interactive", 'i', 0, G_OPTION_ARG_NONE, NULL, N_("Interactively set options"), NULL },
{ "file", 'f', 0, G_OPTION_ARG_FILENAME, NULL, N_("Save screenshot directly to this file"), N_("filename")
},
{ "version", 0, 0, G_OPTION_ARG_NONE, &version_arg, N_("Print version information and exit"), NULL },
diff --git a/src/screenshot-config.c b/src/screenshot-config.c
index 3852d0e..6abeaa5 100644
--- a/src/screenshot-config.c
+++ b/src/screenshot-config.c
@@ -26,7 +26,6 @@
#include "screenshot-config.h"
-#define BORDER_EFFECT_KEY "border-effect"
#define DELAY_KEY "delay"
#define INCLUDE_POINTER_KEY "include-pointer"
#define INCLUDE_ICC_PROFILE "include-icc-profile"
@@ -53,9 +52,6 @@ screenshot_load_config (void)
config->include_pointer =
g_settings_get_boolean (config->settings,
INCLUDE_POINTER_KEY);
- config->border_effect =
- g_settings_get_string (config->settings,
- BORDER_EFFECT_KEY);
config->file_type =
g_settings_get_string (config->settings,
DEFAULT_FILE_TYPE_KEY);
@@ -63,9 +59,6 @@ screenshot_load_config (void)
g_settings_get_boolean (config->settings,
INCLUDE_ICC_PROFILE);
- if (config->border_effect == NULL)
- config->border_effect = g_strdup ("none");
-
config->take_window_shot = FALSE;
config->take_area_shot = FALSE;
@@ -87,8 +80,6 @@ screenshot_save_config (void)
g_settings_set_boolean (c->settings,
INCLUDE_POINTER_KEY, c->include_pointer);
- g_settings_set_string (c->settings,
- BORDER_EFFECT_KEY, c->border_effect);
if (!c->take_area_shot)
g_settings_set_int (c->settings, DELAY_KEY, c->delay);
@@ -121,6 +112,9 @@ screenshot_config_parse_command_line (gboolean clipboard_arg,
if (disable_border_arg)
g_warning ("Option --remove-border is deprecated and will be removed in "
"gnome-screenshot 3.38.0. Window border is always included.");
+ if (border_effect_arg != NULL)
+ g_warning ("Option --border-effect is deprecated and will be removed in "
+ "gnome-screenshot 3.38.0. No effect will be used.");
if (screenshot_config->interactive)
{
@@ -133,9 +127,6 @@ screenshot_config_parse_command_line (gboolean clipboard_arg,
if (delay_arg > 0)
screenshot_config->delay = delay_arg;
-
- g_free (screenshot_config->border_effect);
- screenshot_config->border_effect = g_strdup ("none");
}
else
{
@@ -149,12 +140,6 @@ 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);
- }
}
screenshot_config->take_window_shot = window_arg;
diff --git a/src/screenshot-config.h b/src/screenshot-config.h
index d7175c3..fdf77a9 100644
--- a/src/screenshot-config.h
+++ b/src/screenshot-config.h
@@ -39,8 +39,6 @@ typedef struct {
gboolean include_pointer;
gboolean include_icc_profile;
- gchar *border_effect;
-
guint delay;
gboolean interactive;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]