benruehl / adonis-ui

Lightweight UI toolkit for WPF applications offering classic but enhanced windows visuals
https://benruehl.github.io/adonis-ui/
MIT License
1.71k stars 143 forks source link

AdonisWindows Titlebar too narrow #81

Closed rasyidf closed 4 years ago

rasyidf commented 4 years ago

Describe the bug when windows is maximized the title bar height shrink into 21pixels, even if it's normal behavior. consider adding option to keep the height. i. e. when merging menu with the titlebar

To Reproduce Easiest step is opening adonisUI demo:

  1. Open adonisUI.Demo
  2. Maximize the window

Expected behavior this is the visual studio code behavior image

Screenshots This is the adonisUI.demo behavior image

Additional context none

rasyidf commented 4 years ago

It seems it can be referred as suggestion rather than bug,

benruehl commented 4 years ago

As you already mentioned, I wouldn't call it a bug because it behaves just like expected. AdonisWindow tries to mimic the default native window of Windows. Its title bar shrinks a little because so it does for native applications like the Windows Explorer or Power Shell or even any WPF app without styling.

VS Code behaves differently because it ueses its own implementation. But in my opinion this should not be the default for a UI library because VS Code is just a single app like any other and not some kind of standard.

Adding an option to keep the height might be a good idea though.

In the meantime, you can achive this by performing the following steps:

  1. Copy the WindowButton.xaml file to your application
  2. Remove the following DataTrigger from your copy
    <DataTrigger Binding="{Binding WindowState, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}" Value="Maximized">
       <Setter Property="Height" Value="22"/>
    </DataTrigger>
  3. Include the file below the resources of Adonis UI, e.g.:
    <Application.Resources>
       <ResourceDictionary>
           <ResourceDictionary.MergedDictionaries>
               <ResourceDictionary Source="pack://application:,,,/AdonisUI;component/ColorSchemes/Light.xaml"/>
               <ResourceDictionary Source="pack://application:,,,/AdonisUI.ClassicTheme;component/Resources.xaml"/>
               <ResourceDictionary Source="../WindowButton.xaml"/>
           </ResourceDictionary.MergedDictionaries>
       </ResourceDictionary>
    </Application.Resources>

Hope this helps :)

rasyidf commented 4 years ago

Thanks for the response, it helps a lot.

rabbit59 commented 4 years ago

I thought I would add my voice to the titlebar size. If you are going to add a menu and/or buttons to the titlebar you actually need the height to remain the same when maxmized so you get a nice aesthetic look, otherwise it looks cramped. A property to control this would be great.

(BTW great product and is there an online community?).

benruehl commented 4 years ago

@rabbit59 Thanks for sharing your opinion. Seems like this would be beneficial for multiple people now, so I will prioritize this when working on the next update.