[gnome-panel] libgnome-panel: add gp_applet_set_prefer_symbolic_icons
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel] libgnome-panel: add gp_applet_set_prefer_symbolic_icons
- Date: Fri, 30 Apr 2021 22:54:19 +0000 (UTC)
commit 4e1bfbe1e1084c4215824b75bf8188978955082b
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Wed Apr 28 23:10:29 2021 +0300
libgnome-panel: add gp_applet_set_prefer_symbolic_icons
libgnome-panel/gp-applet-private.h | 31 +++++++++++++++++--------------
libgnome-panel/gp-applet.c | 27 +++++++++++++++++++--------
2 files changed, 36 insertions(+), 22 deletions(-)
---
diff --git a/libgnome-panel/gp-applet-private.h b/libgnome-panel/gp-applet-private.h
index 26f6b845f..77023f25c 100644
--- a/libgnome-panel/gp-applet-private.h
+++ b/libgnome-panel/gp-applet-private.h
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2001 Sun Microsystems, Inc.
- * Copyright (C) 2016-2020 Alberts Muktupāvels
+ * Copyright (C) 2016-2021 Alberts Muktupāvels
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
@@ -27,26 +27,29 @@
G_BEGIN_DECLS
-void gp_applet_set_locked_down (GpApplet *applet,
- gboolean locked_down);
+void gp_applet_set_locked_down (GpApplet *applet,
+ gboolean locked_down);
-void gp_applet_set_lockdowns (GpApplet *applet,
- GpLockdownFlags lockdowns);
+void gp_applet_set_lockdowns (GpApplet *applet,
+ GpLockdownFlags lockdowns);
-void gp_applet_set_orientation (GpApplet *applet,
- GtkOrientation orientation);
+void gp_applet_set_orientation (GpApplet *applet,
+ GtkOrientation orientation);
-void gp_applet_set_position (GpApplet *applet,
- GtkPositionType position);
+void gp_applet_set_position (GpApplet *applet,
+ GtkPositionType position);
-GpAppletFlags gp_applet_get_flags (GpApplet *applet);
+GpAppletFlags gp_applet_get_flags (GpApplet *applet);
-gint *gp_applet_get_size_hints (GpApplet *applet,
- guint *n_elements);
+gint *gp_applet_get_size_hints (GpApplet *applet,
+ guint *n_elements);
-GtkWidget *gp_applet_get_menu (GpApplet *applet);
+GtkWidget *gp_applet_get_menu (GpApplet *applet);
-void gp_applet_remove_from_panel (GpApplet *self);
+void gp_applet_remove_from_panel (GpApplet *self);
+
+void gp_applet_set_prefer_symbolic_icons (GpApplet *self,
+ gboolean prefer_symbolic_icons);
G_END_DECLS
diff --git a/libgnome-panel/gp-applet.c b/libgnome-panel/gp-applet.c
index d307e52c2..3873974d3 100644
--- a/libgnome-panel/gp-applet.c
+++ b/libgnome-panel/gp-applet.c
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2001 Sun Microsystems, Inc.
* Copyright (c) 2010 Carlos Garcia Campos
- * Copyright (C) 2016-2020 Alberts Muktupāvels
+ * Copyright (C) 2016-2021 Alberts Muktupāvels
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
@@ -159,13 +159,7 @@ update_prefer_symbolic_icons (GpApplet *applet)
prefer_symbolic_icons = g_settings_get_boolean (priv->general_settings,
"prefer-symbolic-icons");
- if (priv->prefer_symbolic_icons == prefer_symbolic_icons)
- return;
-
- priv->prefer_symbolic_icons = prefer_symbolic_icons;
-
- g_object_notify_by_pspec (G_OBJECT (applet),
- properties[PROP_PREFER_SYMBOLIC_ICONS]);
+ gp_applet_set_prefer_symbolic_icons (applet, prefer_symbolic_icons);
}
static void
@@ -1417,6 +1411,23 @@ gp_applet_get_prefer_symbolic_icons (GpApplet *applet)
return priv->prefer_symbolic_icons;
}
+void
+gp_applet_set_prefer_symbolic_icons (GpApplet *self,
+ gboolean prefer_symbolic_icons)
+{
+ GpAppletPrivate *priv;
+
+ priv = gp_applet_get_instance_private (self);
+
+ if (priv->prefer_symbolic_icons == prefer_symbolic_icons)
+ return;
+
+ priv->prefer_symbolic_icons = prefer_symbolic_icons;
+
+ g_object_notify_by_pspec (G_OBJECT (self),
+ properties[PROP_PREFER_SYMBOLIC_ICONS]);
+}
+
/**
* gp_applet_get_panel_icon_size:
* @applet: a #GpApplet
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]