Code Monkey home page Code Monkey logo

Comments (5)

amwx avatar amwx commented on July 17, 2024

The first thing is when the label is displayed to the right, the text is off-centered of the icon, as you can see below:

Sometimes sizes/margins/paddings don't port very nicely. I had to make the Viewbox holding the icon in the template bigger so it better matches WinUI (it's 16px in WinUI, I bumped to 20px, as it was too small, but I don't know why) adjusting that makes the margins wrong and pushes the icon too far down. This is a simple fix. The other thing, which I don't think is the primary issue here, and is where taking WinUI cross platform has issues, is the margins applied to TextBlocks in many WinUI templates are based on the Segoe UI font, which doesn't necessarily exist outside of Windows, and other fonts don't always align the same. So it may not be 100% possible to perfectly align

Regarding this, ^, is there a DynamicResource brush or something I can set for the background that would match the same brush used as the background of the NavigationView and MenuBar?

The NavigationView pane and MenuBar are transparent by default (that's just what MS decided) so the darker color is the default Window/page color, which I believe is SolidBackgroundFillColorBaseBrush

All colors & brushes are here for v2 styles (the resource keys are the same for dark theme):
https://github.com/amwx/FluentAvalonia/blob/master/FluentAvalonia/Styling/StylesV2/LightResources.axaml

from fluentavalonia.

nlogozzo avatar nlogozzo commented on July 17, 2024

The other thing, which I don't think is the primary issue here, and is where taking WinUI cross platform has issues, is the margins applied to TextBlocks in many WinUI templates are based on the Segoe UI font, which doesn't necessarily exist outside of Windows, and other fonts don't always align the same. So it may not be 100% possible to perfectly align.

Would we be able to add SegoeUI Font file to the framework or something and use it in the styles?

The NavigationView pane and MenuBar are transparent by default (that's just what MS decided) so the darker color is the default Window/page color, which I believe is SolidBackgroundFillColorBaseBrush

That was it! Thanks :)

from fluentavalonia.

nlogozzo avatar nlogozzo commented on July 17, 2024

@amwx I changed the background to match however I'm experiencing another issue:
image
image
Notice how when I click ... to display the secondary commands, the background becomes transparent on the command bar. When I close the secondary commands, it goes back to what i set it to.

from fluentavalonia.

amwx avatar amwx commented on July 17, 2024

When the CommandBar IsOpen=true, the background is changed (it also adds a border), which was added as part of the v2 Fluent styles, e.g., in WinUI XamlControlsGallery:
image

To not do this, you'll have to override this Style Selector to set the background to whatever (replace CommandBarBackgroundOpen with the resource you want.

<!-- Compact (closed is default state) -->
<Style Selector="ui|CommandBar:compact:open /template/ Border#ContentRootBorder">
<Setter Property="Background" Value="{DynamicResource CommandBarBackgroundOpen}" />
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
</Style>

from fluentavalonia.

nlogozzo avatar nlogozzo commented on July 17, 2024

That worked! Thanks for all the help again :)

from fluentavalonia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.