[network-manager-applet: 1/2] set correct icon size




commit a955af3ef1376a1908b97a9b189b717cca6e669d
Author: Konstantin Unruh <freaxmate protonmail com>
Date:   Sat May 29 14:28:23 2021 +0200

    set correct icon size

 src/applet.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/applet.c b/src/applet.c
index 8cf6dc43..1b309aa8 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -3173,8 +3173,18 @@ status_icon_size_changed_cb (GtkStatusIcon *icon,
        /* icon_size may be 0 if for example the panel hasn't given us any space
         * yet.  We'll get resized later, but for now just load the 16x16 icons.
         */
-       if (size > 0)
-               applet->icon_size = size;
+       if (size > 0) {
+               if (size < 22)
+                       applet->icon_size = 16;
+               else if (size < 24)
+                       applet->icon_size = 22;
+               else if (size < 32)
+                       applet->icon_size = 24;
+               else if (size < 48)
+                       applet->icon_size = 32;
+               else
+                       applet->icon_size = size;
+       }
        else {
                applet->icon_size = 16;
                g_warn_if_fail (size == 0);


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