irihitech / Ursa.Avalonia

Ursa is a UI library for building cross-platform UIs with Avalonia UI.
https://irihitech.github.io/Ursa.Avalonia/
MIT License
515 stars 49 forks source link

Enable UrsaWindow and Dialog border customization. #399

Closed rabbitism closed 6 days ago

rabbitism commented 1 week ago

in some environment (well ubuntu), borderless window is not possible. So it is necessary to expose border customization for user. User can now globally add border brush and border thickness to UrsaWindow, DialogWindow, DefaultDialogWindow and MesageBox.

rabbitism commented 1 week ago

User can globally define UrsaWindow/Dialog/MessageBox border as following:

        <Style Selector="u|DefaultDialogWindow"> <!-- same for u|UrsaWindow, u|DialogWindow, u|MessageBoxWindow -->
            <Setter Property="BorderThickness">
                <OnPlatform>
                    <OnPlatform.Linux>
                        <Thickness>0</Thickness>
                    </OnPlatform.Linux>
                    <OnPlatform.Default>
                        <Thickness>10</Thickness>
                    </OnPlatform.Default>
                </OnPlatform>
            </Setter>
            <Setter Property="BorderBrush">
                <OnPlatform>
                    <OnPlatform.Linux>
                        <SolidColorBrush Color="Green"></SolidColorBrush>
                    </OnPlatform.Linux>
                    <OnPlatform.Default>
                        <SolidColorBrush Color="Red"></SolidColorBrush>
                    </OnPlatform.Default>
                </OnPlatform>
            </Setter>
        </Style>