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

Background color of StatusBar #2173

Closed
thoemmi opened this issue Oct 22, 2015 · 4 comments
Closed

Background color of StatusBar #2173

thoemmi opened this issue Oct 22, 2015 · 4 comments

Comments

@thoemmi
Copy link
Collaborator

thoemmi commented Oct 22, 2015

Currently the background color of StatusBar is fixed (except when it's disabled). However; i prefer it to match the title bar, i.e. when the window is not active, not only the title's background should change, but the status bar's too.

To achieve that, I added an additional trigger in my app, which looks like this:

<StatusBar Grid.Row="1">
  <!-- -->
  <StatusBar.Style>
    <Style TargetType="{x:Type StatusBar}" BasedOn="{StaticResource MetroStatusBar}">
      <Setter Property="Background" Value="{DynamicResource WindowTitleColorBrush}" />
      <Style.Triggers>
        <DataTrigger Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=IsActive}" Value="False">
          <Setter Property="Background" Value="{Binding Path=NonActiveWindowTitleBrush, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type controls:MetroWindow}}}" />
        </DataTrigger>
      </Style.Triggers>
    </Style>
  </StatusBar.Style>
</StatusBar>

How about adding this to the MahApps style by default?

@punker76
Copy link
Member

@thoemmi +1 from me

@thoemmi
Copy link
Collaborator Author

thoemmi commented Oct 22, 2015

Ok, I'll prepare a PR. Currently StatusBar's background is set to AccentColorBrush. I would change that to WindowTitleColorBrush too, ok?

@thoemmi
Copy link
Collaborator Author

thoemmi commented Oct 22, 2015

May it would even be better to use {Binding Path=WindowTitleBrush, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type controls:MetroWindow}}}

@thoemmi
Copy link
Collaborator Author

thoemmi commented Oct 23, 2015

Since #2174 was merged, I close this issue.

@thoemmi thoemmi closed this as completed Oct 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants