Skip to content

Icons: Add Empty icon#9478

Merged
henon merged 4 commits intoMudBlazor:devfrom
skyslide22:add/transparent-icon
Aug 9, 2024
Merged

Icons: Add Empty icon#9478
henon merged 4 commits intoMudBlazor:devfrom
skyslide22:add/transparent-icon

Conversation

@skyslide22
Copy link
Contributor

@skyslide22 skyslide22 commented Jul 22, 2024

Description

Add void icon to act as empty space, see screenshot below.
Wondering if Void is the right name to use, maybe Transparent is better?
Also, this icon is only added in the Filled class, does it need to be in the other variants as well?

image
Use like this:

<MudButton Variant="Variant.Filled" StartIcon="@Icons.Material.Filled.CheckBox">Default</MudButton>
<MudButton Variant="Variant.Filled" StartIcon="@Icons.Custom.Uncategorized.Empty">Default</MudButton>
<MudButton Variant="Variant.Filled" StartIcon="@Icons.Material.Filled.Add">Default</MudButton>

Other example & usecase:
image

How Has This Been Tested?

Tested locally with the mudblazor repo

Type of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (fix or improvement to the website or code docs)

Checklist

  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests.

@github-actions github-actions bot added enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library PR: needs review labels Jul 22, 2024
@Welchen
Copy link
Contributor

Welchen commented Jul 22, 2024

  • Void
  • Transparent
  • Blank
  • None

Those are all of the names I can think of. All of them would work. Not sure what is consistent with anything similar.

@skyslide22
Copy link
Contributor Author

I have not found anything like this on fontawesome.com, but blender (3D OSS) has one called BLANK1
See:
image

@ScarletKuro
Copy link
Member

Hi.

This shouldn't be in Icons/Material/Filled.cs. In Material, we strictly have only official Google Material icons, and we generate it with a script. The next run the generator will just remove it. It definitely should be in Custom, most likely in the Uncategorized class.

@danielchalmers
Copy link
Member

Could literally call it Empty. A lot of options lol

@codecov
Copy link

codecov bot commented Jul 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.55%. Comparing base (28bc599) to head (04bf541).
Report is 416 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #9478      +/-   ##
==========================================
+ Coverage   89.82%   90.55%   +0.72%     
==========================================
  Files         412      406       -6     
  Lines       11878    12751     +873     
  Branches     2364     2472     +108     
==========================================
+ Hits        10670    11547     +877     
+ Misses        681      642      -39     
- Partials      527      562      +35     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ScarletKuro ScarletKuro requested a review from henon July 24, 2024 17:21
@henon
Copy link
Contributor

henon commented Jul 24, 2024

I would prefer Icon="@Icons.None" but Icon="@Icons.Empty" or Icon="@Icons.Blank" would also be ok.

@ScarletKuro
Copy link
Member

I would prefer Icon="@Icons.None" but Icon="@Icons.Empty" or Icon="@Icons.Blank" would also be ok.

Can this be merged? It's currently named as Empty or you actually would prefer other name?

@ScarletKuro ScarletKuro changed the title Add void icon Icons: Add Empty icon Aug 8, 2024
@henon
Copy link
Contributor

henon commented Aug 8, 2024

I didn't make myself totally clear it seams. Currently it would be StartIcon="@Icons.Material.Filled.Empty" but I would want this API:

StartIcon="@Icons.None"

@ScarletKuro
Copy link
Member

ScarletKuro commented Aug 8, 2024

Currently it would be StartIcon="@Icons.Material.Filled.Empty" but I would want this API

No it wouldn't. It would be Icons.Custom.Uncategorized.Empty, see my comment: #9478 (comment)

but I would want this API: StartIcon="@Icons.None"

Please, no. I want to get get away from partial classes in next major releases and use namespaces instead (I explained the reason why partial makes it hard to extend the icons via additional packages, there will be a conflict) and this will only interfere it. Well I want to remove svg in general, and I won't be able to support Icons.None, that's why I wouldn't want to give it in v7 either.

@henon henon merged commit 4c881b8 into MudBlazor:dev Aug 9, 2024
@henon
Copy link
Contributor

henon commented Aug 9, 2024

OK StartIcon="@Icons.Custom.Uncategorized.Empty" it is, I reverted the last commit that moved it into the Icon class. Thanks @skyslide22

@henon
Copy link
Contributor

henon commented Aug 9, 2024

Well I want to remove svg in general, and I won't be able to support Icons.None, that's why I wouldn't want to give it in v7 either.

@ScarletKuro I am sure we can keep empty as an svg icon. We'll have to keep the possibility to use svg icons anyway, so I don't see a problem with extending the font icons with a couple svg icons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants