-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix default mpris icon size #370
Conversation
The widget was was using the .ui size instead of the user config size in the following situations: - there was no media player app - the media player app icon was used - the audio-x-generic-symbolic icon was used This fix sets the default size for the album art icon according to the user's config. set_from_gicon and set_from_icon_name receive a Gtk.IconSize enum value, not an int, so we need to call set_pixel_size to set the proper size.
146acec
to
a21d46f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than that, LGTM :)
@@ -380,11 +381,11 @@ namespace SwayNotificationCenter.Widgets.Mpris { | |||
icon = desktop_entry.get_icon (); | |||
} | |||
if (icon != null) { | |||
album_art.set_from_gicon (icon, mpris_config.image_size); | |||
album_art.set_from_gicon (icon, Gtk.IconSize.DIALOG); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be Gtk.IconSize.INVALID
Could you also update the branch off of main? |
…nto fix_mpris_icon_size_all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks and sorry for the delay :)
@@ -96,6 +96,7 @@ namespace SwayNotificationCenter.Widgets.Mpris { | |||
update_buttons (source.media_player.metadata); | |||
}); | |||
}); | |||
album_art.set_pixel_size(mpris_config.image_size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wait, seems like the linter isn't happy about this line. Could you fix that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. There are a lot of linter changes showing up, so I missed this one (I did not want to add unrelated line changes n this PR).
Maybe it would be nice to lint the whole project and do a single commit with that.
The widget was was using the .ui size instead of the user config
size in the following situations:
This fix sets the default size for the album art icon according to the
user's config.
set_from_gicon and set_from_icon_name receive a Gtk.IconSize enum value,
not an int, so we need to call set_pixel_size to set the proper size.