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

Add GenericIcon #936

Merged
merged 6 commits into from
Feb 13, 2024
Merged

Conversation

erri120
Copy link
Member

@erri120 erri120 commented Feb 13, 2024

Resolves #934.

@erri120 erri120 requested a review from Al12rs February 13, 2024 09:55
@erri120 erri120 self-assigned this Feb 13, 2024
@codecov-commenter
Copy link

Codecov Report

Attention: 59 lines in your changes are missing coverage. Please review.

Comparison is base (113c9c7) 55.81% compared to head (4050c61) 55.58%.
Report is 9 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #936      +/-   ##
==========================================
- Coverage   55.81%   55.58%   -0.23%     
==========================================
  Files         616      618       +2     
  Lines       19724    19844     +120     
  Branches     1518     1529      +11     
==========================================
+ Hits        11008    11031      +23     
- Misses       8374     8464      +90     
- Partials      342      349       +7     
Flag Coverage Δ
Linux 55.01% <0.00%> (-0.24%) ⬇️
Windows 54.87% <0.00%> (-0.20%) ⬇️
clean_environment_tests 55.57% <0.00%> (-0.23%) ⬇️
network_tests ?
networking_tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...NexusMods.App.UI/Controls/GenericIcon/IconValue.cs 0.00% <0.00%> (ø)
...xusMods.App.UI/Controls/GenericIcon/GenericIcon.cs 0.00% <0.00%> (ø)

... and 12 files with indirect coverage changes

Copy link
Contributor

@Al12rs Al12rs left a comment

Choose a reason for hiding this comment

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

As discussed in call:

  • Add Size attribute to manage both Height/Width and FontSize in a unified way.
  • Make sure Size works for all of them, add Stretch if necessary etc.
  • Add GenericIconStyles and add the examples there, use Classes in GenericIcon.axaml
@erri120
Copy link
Member Author

erri120 commented Feb 13, 2024

Fixed the sizing issue.

2024-02-13_14-07-08

@Al12rs
Copy link
Contributor

Al12rs commented Feb 13, 2024

For the record:
I would have liked to have convenience property setters in GenericIcon to allow

<local:GenericIcon SvgPath="avares://NexusMods.App.UI/Assets/Icons/add_circle_24px.svg"/>

as opposed to how you currently have to do it in the PR:

            <local:GenericIcon>
                <local:GenericIcon.Value>
                    <local:IconValue>
                        <local:IconValue.AvaloniaSvgSetter>
                            <local:AvaloniaSvg Path="avares://NexusMods.App.UI/Assets/Icons/add_circle_24px.svg"/>
                        </local:IconValue.AvaloniaSvgSetter>
                    </local:IconValue>
                </local:GenericIcon.Value>
            </local:GenericIcon>

, which would be hidden inside a Style Class.

The argument against from @erri120 was that this would defeat the purpose of having a unified Api, as it would be possible to OneWayBind to the other setter properties as well, ending up with different ways the control can be interacted with.

I still would have liked the convenience, regardless. We agreed to disagree.

@erri120 erri120 merged commit 9de1bdd into Nexus-Mods:main Feb 13, 2024
4 checks passed
@erri120 erri120 deleted the feat/934-generic-icon-control branch February 13, 2024 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants