-
-
Notifications
You must be signed in to change notification settings - Fork 782
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
Added the HorizontalIconAlignment property to the button. #1117
Conversation
…u want to show the icon left or right to the content.
src/Wpf.Ui/Controls/Button/Button.cs
Outdated
@@ -13,16 +13,16 @@ namespace Wpf.Ui.Controls; | |||
/// </summary> | |||
/// <example> | |||
/// <code lang="xml"> | |||
/// <ui:Button |
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.
Examples should not use special characters
https://wpfui.lepo.co/api/Wpf.Ui.Controls.Button.html
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.
Because? I mean even vs is using it totally fine.
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 and btw & is a special character :)
src/Wpf.Ui/Controls/Button/Button.cs
Outdated
set => SetValue(HorizontalIconAlignmentProperty, value); | ||
} | ||
|
||
public enum HorizontalIconAlignments |
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.
Missing docs for public API.
src/Wpf.Ui/Controls/Button/Button.cs
Outdated
set => SetValue(HorizontalIconAlignmentProperty, value); | ||
} | ||
|
||
public enum HorizontalIconAlignments |
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.
I would extract it to a separate file
Hm, the word "alignment" usually sounds like it is placed inside of a space. Like: text on a page is aligned inside/between the borders of the page. Not next to the page. |
But it isn't relative, that's the difference. |
What I mean is, the icon is placed to the left/right of the content/text. Therefore I think "HorizontalIconPlacement" would be a good (or even more accurate) wording. By the way, I assume this works well in RTL language? |
In this case I followed the standard alignment that MS uses. |
1. FonIcon/SymbolIcon markup now fully supports fontsize. Setting the fontsize in the markup will be prioritized over inheriance. 2. Using Content="Text" in the UiButton class can now format the string from inheritance. Right now it is not possible to do this for the Button class as it breaks the direct string rendering. Formating text in seperate child elements such as TextBlock does not inheritance as it is not possible to get both working right now. So better we use this method to format strings because we can alwasys format any TextBlock on it's own inside the UiButton. 3. Moved IconAlignment into IconElement folder and added VerticalIconAlignment as possibility. Docs added (check them, maybe you don't like them) 4. Added a border to the Slider style for visual value feedback. 5. Refactored the SystemThemeManager class. Using SystemUsesLightTheme is unnecessary since the app theme is the only one necessary variable we need. If the system uses light theme withouth seperating the app theme, SystemUsesLightTheme will always return 1 and vice versa. We should also take into account if people change their app theme separately and base it on that one.
1. Added AdditionalControls property: You can now add additional buttons with the same default size or add customizied controls. Button default style example: ```csharp <ui:Button Width="44" Height="30" BorderThickness="0" Background="Transparent" Icon="{ui:SymbolIcon DarkTheme24, False, 15}" />``` 2. Header remains the same. 3. Window is now resizable if you use a TitleBar: You can now (finally!) resize the window if you use the TitleBar! This was the most reason why i switched here from messages to events. Messages are basically not necsassary for the titlebar. 4. ActionsOverride: You can now override every default button (Help, Minimize, Maximize and Close) contained in the TitleBar. Before you could create a RoutedEvent for the close event and performe actions in there but you could never cancel the close method as it was a seperated event inside the TitleBar called after the override action. Now you can! 4. Added boolean UseTrayMenu: If UseTrayMenu on close click the application now hides instead the window of closing it. Add your tray menu and your boolean and you are good to go. 5. DragMove from maximized window is now smoother.
I don't know why, but my vs is bugged rn. I cannot create visible styles and my formatter does instead of formatting only opened files all .xaml files. |
…itionConverter is now in the right place.
Added the HorizontalIconAlignment property to the button.
You can now choose, if you want to show the icon left or right to the content.
Pull request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Other information