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

Are the Layer4BackgroundBrush and Layer4BorderColor attributes correct linked to the layers? #117

Closed
McTopaz opened this issue Sep 9, 2020 · 3 comments · Fixed by #118
Closed
Labels
bug Something isn't working
Milestone

Comments

@McTopaz
Copy link

McTopaz commented Sep 9, 2020

Describe the bug
I'm trying to learn how to create my own themes for Adonis. I'm evaluating Adonis for my company if we can use it two switch between dark and light themes with custom colors. I have played around with the colors and see what result I got.
When I change the colors of the Layer4BackgroundColor and Layer4BorderColor parameters and tries this on nested GroupBoxes I don't get the result I think is correct.
Note: It possible that the result is correct and I have no clue what I'm doing >_< :P ;)

To Reproduce

  1. Create a WPF application.
  2. Install the Adonis NuGet.
  3. My App.xaml and MainWindow.xaml and MainWindows.xaml.cs looks like the XAML-code bellow.
  4. My Light.xaml is attached at the bottom. Please change the file extension from .txt to .xaml.
  5. Add the Light.xaml file to the WPF-project and set the Build Action to Page.
  6. Alter the MainWindow's constructor with the correct path to the Light.xaml.
  7. Build and run the application. It should work directly.
  8. Please look at the attached screenshot.

Expected behavior
I have changed these parameters.

  • Layer0BorderColor = 777777 // Gray.
  • Layer1BackgroundColor = 00ff00 // Green
  • Layer1BorderColor = 007700 // Dark green
  • Layer2BackgroundColor = 0000ff // Blue
  • Layer2BorderColor = 000077 // Dark blue
  • Layer3BackgroundColor = ffff00 // Yellow
  • Layer3BorderColor = ff00ff // Purple
  • Layer4BackgroundColor = 00ffff // Turquoise
  • Layer4BorderColor = ff0000 // Red

(I have added a five level deep nested Groupboxes. As Adonis don't support more than four layers, I'm OK that the fifth layer "inherits" the layer 4 colors.)

  • Why is the level 4 groupbox background colored green when it should be turquoise? Layer4BackgroundColor = #00ffff. The GB3 button does have the turquoise color.
  • Why is the level 4 groupbox header bar colored green when it should be red? Layer4Bordercolor = #ff0000.

Please look at the screenshot.

Screenshots
image

App.xaml
<Application x:Class="Main.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:Main" xmlns:adonisUi="clr-namespace:AdonisUI;assembly=AdonisUI" StartupUri="MainWindow.xaml"> <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="pack://application:,,,/AdonisUI;component/ColorSchemes/Light.xaml" /> <ResourceDictionary Source="pack://application:,,,/AdonisUI.ClassicTheme;component/Resources.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources> </Application>

MainWindow.xaml

<Window.Style>
    <Style TargetType="Window" BasedOn="{StaticResource {x:Type Window}}" />
</Window.Style>

<StackPanel Orientation="Vertical">
    <GroupBox Margin="20" Header="Layer1">
        <StackPanel>
            <Button Width="100" Height="40" Content="GB1" />
            <GroupBox Header="Layer2">
                <StackPanel>
                    <Button Width="100" Height="40" Content="GB2" />
                    <GroupBox Header="Layer3">
                        <StackPanel>
                            <Button Width="100" Height="40" Content="GB3" />
                            <GroupBox Header="Layer4">
                                <StackPanel>
                                    <Button Width="100" Height="40" Content="GB4" />
                                    <GroupBox Header="Layer5">
                                        <StackPanel>
                                            <Button Width="100" Height="40" Content="GB5" />
                                        </StackPanel>
                                    </GroupBox>
                                </StackPanel>
                            </GroupBox>
                        </StackPanel>
                    </GroupBox>
                </StackPanel>
            </GroupBox>
        </StackPanel>
    </GroupBox>
</StackPanel>

MainWindow.xaml.cs

public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
        var uri = new Uri("pack://application:,,,/Light.xaml", UriKind.Absolute);
        ResourceLocator.SetColorScheme(Application.Current.Resources, uri);
    }
}

Light.txt

@McTopaz McTopaz added the bug Something isn't working label Sep 9, 2020
@benruehl
Copy link
Owner

Good spot.
I checked your setup and can confirm that group boxes on layer 4 do not use the layer 4 colors correctly.
A fix is on the way.

Besides that, I would be interested in your reasons for and against using the library. Getting feedback is important to improve but sometimes hard to get on this platform.

Thank you for reporting the issue.

@benruehl benruehl added this to the Release 1.16.1 milestone Sep 13, 2020
@McTopaz
Copy link
Author

McTopaz commented Sep 13, 2020

Thanks @benruehl!

I would be pleased to give you feedback regarding my company using your library.
But I'm not sure if this issue/thread is the correct forum for it.
How would you like to receive the feedback?

@benruehl
Copy link
Owner

Awesome, thanks a lot!
You could send me an email. My email address should be visible on my profile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants