Skip to content
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

Merged
merged 4 commits into from
Mar 9, 2024

Conversation

abmantis
Copy link
Contributor

@abmantis abmantis commented Jan 6, 2024

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.

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.
Copy link
Owner

@ErikReider ErikReider left a 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);
Copy link
Owner

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

@ErikReider
Copy link
Owner

Could you also update the branch off of main?

Copy link
Owner

@ErikReider ErikReider left a 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);
Copy link
Owner

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?

Copy link
Contributor Author

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.

@abmantis abmantis requested a review from ErikReider March 9, 2024 01:33
@ErikReider ErikReider merged commit ed1b721 into ErikReider:main Mar 9, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants