summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorosch <oliver at luced de>2019-04-12 21:22:59 +0200
committerlukefromdc <[email protected]>2019-04-23 18:35:39 +0000
commit5e2f54dbf2417c3b5f8b1614010565a0a500382a (patch)
tree691d98cc1bfcb0e0bf4d24ee4713d53eb53eca9c
parentae98b909e347ae7dadb0a57a22dbca3cf2231f33 (diff)
downloadmarco-5e2f54dbf2417c3b5f8b1614010565a0a500382a.tar.bz2
marco-5e2f54dbf2417c3b5f8b1614010565a0a500382a.tar.xz
make icon size configurable
-rw-r--r--src/core/prefs.c17
-rw-r--r--src/core/screen.c10
-rw-r--r--src/core/window.c5
-rw-r--r--src/include/common.h3
-rw-r--r--src/include/prefs.h2
-rw-r--r--src/org.mate.marco.gschema.xml6
-rw-r--r--src/ui/preview-widget.c4
-rw-r--r--src/ui/ui.c2
8 files changed, 39 insertions, 10 deletions
diff --git a/src/core/prefs.c b/src/core/prefs.c
index 81ce07b9..7e4db4e9 100644
--- a/src/core/prefs.c
+++ b/src/core/prefs.c
@@ -52,6 +52,7 @@
#define KEY_GENERAL_COMPOSITOR "compositing-manager"
#define KEY_GENERAL_COMPOSITOR_FAST_ALT_TAB "compositing-fast-alt-tab"
#define KEY_GENERAL_CENTER_NEW_WINDOWS "center-new-windows"
+#define KEY_GENERAL_ICON_SIZE "icon-size"
#define KEY_COMMAND_SCHEMA "org.mate.Marco.keybinding-commands"
#define KEY_COMMAND_PREFIX "command-"
@@ -114,6 +115,7 @@ static gboolean mate_accessibility = FALSE;
static gboolean mate_animations = TRUE;
static char *cursor_theme = NULL;
static int cursor_size = 24;
+static int icon_size = META_DEFAULT_ICON_SIZE;
static gboolean use_force_compositor_manager = FALSE;
static gboolean force_compositor_manager = FALSE;
static gboolean compositing_manager = FALSE;
@@ -512,6 +514,12 @@ static MetaIntPreference preferences_int[] =
&cursor_size,
1, 128, 24,
},
+ { "icon-size",
+ KEY_GENERAL_SCHEMA,
+ META_PREF_ICON_SIZE,
+ &icon_size,
+ 6, G_MAXINT, META_DEFAULT_ICON_SIZE,
+ },
{ NULL, NULL, 0, NULL, 0, 0, 0, },
};
@@ -1111,6 +1119,12 @@ meta_prefs_get_cursor_size (void)
return cursor_size * scale;
}
+int
+meta_prefs_get_icon_size (void)
+{
+ return icon_size;
+}
+
gboolean
meta_prefs_is_in_skip_list (char *class)
{
@@ -1623,6 +1637,9 @@ meta_preference_to_string (MetaPreference pref)
case META_PREF_CURSOR_SIZE:
return "CURSOR_SIZE";
+ case META_PREF_ICON_SIZE:
+ return "ICON_SIZE";
+
case META_PREF_COMPOSITING_MANAGER:
return "COMPOSITING_MANAGER";
diff --git a/src/core/screen.c b/src/core/screen.c
index e14f8d52..9b084bcf 100644
--- a/src/core/screen.c
+++ b/src/core/screen.c
@@ -35,6 +35,7 @@
#include "prefs.h"
#include "workspace.h"
#include "keybindings.h"
+#include "prefs.h"
#include "stack.h"
#include "xprops.h"
#include "compositor.h"
@@ -118,14 +119,15 @@ set_supported_hint (MetaScreen *screen)
static int
set_wm_icon_size_hint (MetaScreen *screen)
{
+ int icon_size = meta_prefs_get_icon_size();
#define N_VALS 6
gulong vals[N_VALS];
/* min width, min height, max w, max h, width inc, height inc */
- vals[0] = META_ICON_WIDTH;
- vals[1] = META_ICON_HEIGHT;
- vals[2] = META_ICON_WIDTH;
- vals[3] = META_ICON_HEIGHT;
+ vals[0] = icon_size; /* width */
+ vals[1] = icon_size; /* height */
+ vals[2] = icon_size; /* width */
+ vals[3] = icon_size; /* height */
vals[4] = 0;
vals[5] = 0;
diff --git a/src/core/window.c b/src/core/window.c
index fce395b9..0a2582e9 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -6042,6 +6042,8 @@ meta_window_update_icon_now (MetaWindow *window)
icon = NULL;
mini_icon = NULL;
+
+ int icon_size = meta_prefs_get_icon_size();
if (meta_read_icons (window->screen,
window->xwindow,
@@ -6049,7 +6051,8 @@ meta_window_update_icon_now (MetaWindow *window)
window->wm_hints_pixmap,
window->wm_hints_mask,
&icon,
- META_ICON_WIDTH, META_ICON_HEIGHT,
+ icon_size, /* width */
+ icon_size, /* height */
&mini_icon,
META_MINI_ICON_WIDTH,
META_MINI_ICON_HEIGHT))
diff --git a/src/include/common.h b/src/include/common.h
index 81937307..1fe3aae1 100644
--- a/src/include/common.h
+++ b/src/include/common.h
@@ -301,8 +301,7 @@ struct _MetaButtonLayout
};
/* should investigate changing these to whatever most apps use */
-#define META_ICON_WIDTH 48
-#define META_ICON_HEIGHT 48
+#define META_DEFAULT_ICON_SIZE 48
#define META_MINI_ICON_WIDTH 16
#define META_MINI_ICON_HEIGHT 16
diff --git a/src/include/prefs.h b/src/include/prefs.h
index 34ab802e..7623dd19 100644
--- a/src/include/prefs.h
+++ b/src/include/prefs.h
@@ -60,6 +60,7 @@ typedef enum
META_PREF_MATE_ANIMATIONS,
META_PREF_CURSOR_THEME,
META_PREF_CURSOR_SIZE,
+ META_PREF_ICON_SIZE,
META_PREF_COMPOSITING_MANAGER,
META_PREF_COMPOSITING_FAST_ALT_TAB,
META_PREF_RESIZE_WITH_RIGHT_BUTTON,
@@ -129,6 +130,7 @@ void meta_prefs_change_workspace_name (int i,
const char* meta_prefs_get_cursor_theme (void);
int meta_prefs_get_cursor_size (void);
+int meta_prefs_get_icon_size (void);
gboolean meta_prefs_get_compositing_manager (void);
gboolean meta_prefs_get_compositing_fast_alt_tab (void);
gboolean meta_prefs_get_center_new_windows (void);
diff --git a/src/org.mate.marco.gschema.xml b/src/org.mate.marco.gschema.xml
index 6632e6b1..8bc0a321 100644
--- a/src/org.mate.marco.gschema.xml
+++ b/src/org.mate.marco.gschema.xml
@@ -196,6 +196,12 @@
<summary>List of applications ignored by show-desktop</summary>
<description>Comma separated class list. Each running GUI application referenced to given windows manager class will be ignored by 'Show Desktop' functionality.</description>
</key>
+ <key name="icon-size" type="i">
+ <range min="6" />
+ <default>48</default>
+ <summary>Icon size</summary>
+ <description>Size of the application icons displayed in alt-tab popup window if compositing-fast-alt-tab is enabled. The screen's scale factor is applied to this value.</description>
+ </key>
</schema>
<schema id="org.mate.Marco.workspace-names" path="/org/mate/marco/workspace-names/">
diff --git a/src/ui/preview-widget.c b/src/ui/preview-widget.c
index c1c3ad0b..50f42b61 100644
--- a/src/ui/preview-widget.c
+++ b/src/ui/preview-widget.c
@@ -452,13 +452,13 @@ meta_preview_get_icon (void)
if (icon_exists)
default_icon = gtk_icon_theme_load_icon (theme,
META_DEFAULT_ICON_NAME,
- META_ICON_WIDTH,
+ META_DEFAULT_ICON_SIZE,
0,
NULL);
else
default_icon = gtk_icon_theme_load_icon (theme,
"image-missing",
- META_ICON_WIDTH,
+ META_DEFAULT_ICON_SIZE,
0,
NULL);
diff --git a/src/ui/ui.c b/src/ui/ui.c
index b3f40062..7b5bcdfc 100644
--- a/src/ui/ui.c
+++ b/src/ui/ui.c
@@ -591,7 +591,7 @@ meta_ui_get_default_window_icon (MetaUI *ui)
if (default_icon == NULL)
{
scale = gtk_widget_get_scale_factor (GTK_WIDGET (ui->frames));
- default_icon = load_default_window_icon (META_ICON_WIDTH, scale);
+ default_icon = load_default_window_icon (meta_prefs_get_icon_size(), scale);
g_assert (default_icon);
}