diff options
author | Konstantin Unruh <freaxmate@protonmail.com> | 2021-05-29 14:28:23 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2021-06-29 10:13:43 +0200 |
commit | a955af3ef1376a1908b97a9b189b717cca6e669d (patch) | |
tree | b1071d5e23acb52fee122512eb5df24a72432c98 | |
parent | 8b23c3156800255b6c0468b4d5a8e6b53a11c837 (diff) | |
download | network-manager-applet-a955af3ef1376a1908b97a9b189b717cca6e669d.tar.gz |
set correct icon size
-rw-r--r-- | src/applet.c | 14 |
1 files 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); |