Skip to content

Conversation

@DovidP
Copy link
Contributor

@DovidP DovidP commented Nov 17, 2024

Removed the unnecessary white background. Added a method to fetch a smaller icon because there is no need to pull a large icon and downscaling it makes it look bad.

pub trait MessageAuthor: PartialEq + Eq {
fn get_display_name(&self) -> impl Element;
fn get_icon(&self) -> String;
fn get_small_icon(&self) -> String;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im just wondering if another routine is really the correct way to go about this? Main questions I would ask are:

  1. Do we ever need to get a large icon for a message author?
    If so,
  2. Do we ever need to get anything other than a "normal" and "small" icon?

if 1 is no, Then I wouldn't add a new method and would just have the normal get_icon method return a 32px image.

If 1 is yes, then I think the better route would be an argument to get_icon.

If 2 is no, then that argument could be as simple as an enum IconSize

if 2 is yes, then that argument maybe should be something like a IconFormat config

fn get_small_icon(&self) -> String {
self.icon.clone() + "?size=32"
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one of my plans is to have get_icon return an Element. This way, discord for example, can display user icon decorations without us having to make an entire Chat interface for "decoration"

@DovidP
Copy link
Contributor Author

DovidP commented Nov 18, 2024

A better implementation is in the works, but this is good as a temporary fix

@alii alii merged commit 10984f3 into scopeclient:main Nov 18, 2024
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.

4 participants