fix(naughty: icon: new, fit): use icon_size from the notification object if defined (fixes #3752) (#3805)

* fix(naughty: icon: new, fit): use `icon_size` from the notification object if defined (fixes #3752)

* fixup! fix(naughty: icon: new, fit): use `icon_size` from the notification object if defined (fixes #3752)

* fixup! fixup! fix(naughty: icon: new, fit): use `icon_size` from the notification object if defined (fixes #3752)
This commit is contained in:
Actionless Loveless 2023-08-14 00:52:12 +02:00 committed by GitHub
parent ed71b17f1b
commit d36e1324d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,7 +35,12 @@ function icon:fit(_, width, height)
local maximum = math.min(width, height)
local strategy = self._private.resize_strategy or "resize"
local optimal = math.min(beautiful.notification_icon_size or dpi(48), maximum)
local optimal = math.min(
(
self._private.notification[1] and self._private.notification[1].icon_size
) or beautiful.notification_icon_size or dpi(48),
maximum
)
local w = self._private.image:get_width()
local h = self._private.image:get_height()