TheCherno / Hazel

Hazel Engine
Apache License 2.0
11.68k stars 1.5k forks source link

Title bar in dark color #420

Open ANF-Studios opened 3 years ago

ANF-Studios commented 3 years ago

Is your feature request related to a problem? Please describe

The title bar of the engine UI is in light mode

Describe the solution you'd like

I don't know if this is possible, but it would be nice if the title bar would also be in dark mode since the in-engine UI is in dark mode.

Describe alternatives you've considered

I recall that it's possible to make the window's title bar frameless and make a custom one but I'm not sure if that'll be a great idea.

Additional context

A screenshot of the editor from this video: image

LovelySanta commented 3 years ago

In the past we tried implementing borderless mode, which hides the title bar outside the rendered area of the screen. This is more a setting controlled by windows itself, for me, windows is set in dark mode, resulting in a black bar on top as well.

Basic applications such as Word and Excell have their own custom title bar, so I we could try and implement our own variant, by hiding the default one, or altering it as we see fit (if possible).

YusufSuleman commented 3 years ago

I remember hearing about a fix for this. You need to tell Windows this is in Dark Mode and it will do it. Linux GNOME has Dark Mode Globally. I don't know anything about Mac.

LovelySanta commented 3 years ago

https://github.com/glfw/glfw/issues/1516 is the closest i've found while researching this issue...

AnantTiwari-Naman commented 3 years ago

I am pretty sure this is a windows specific thing rather than a Hazel / GLFW thing. I remember changing some setting in windows, which made the title bar of all windows follow my main accent color, I don't get the white title bar on Hazel.

ANF-Studios commented 3 years ago

I am pretty sure this is a windows specific thing rather than a Hazel / GLFW thing. I remember changing some setting in windows, which made the title bar of all windows follow my main accent color, I don't get the white title bar on Hazel.

Well yes, that is absolutely true, but I am pretty sure there is some way to do it with code. Like UWP does it.

Oh and, you can do that (on Windows) by applying the accent color of your pc to title bars as well: Some colors are not supported The only downside is that, for that to happen, it won't be very convenient, and secondly; not everyone prefers to change their color to dark on other applications, globally. Some colors are not supported too!

TL;DR: There are downsides to that, as a developer, products should more be focused on handling for the user rather than by the user even if it's a game engine.

Oh and, I think maybe we can use DwmSetWindowAttribute on Windows to do that. I guess it might be possible. Not sure though.

AnantTiwari-Naman commented 3 years ago

Sure, we can make the window borderless, and manually add the window controls and stuff by our own.

LovelySanta commented 3 years ago

Sure, we can make the window borderless, and manually add the window controls and stuff by our own.

isn't borderless always fullscreen?

AnantTiwari-Naman commented 3 years ago

There's a borderless-windowed mode, which (from what I understand) is the "normal" borderless mode, many games make their windows borderless and resize them so it takes the whole screen, but just refer to it as borderless mode

ANF-Studios commented 3 years ago

Sure, we can make the window borderless, and manually add the window controls and stuff by our own.

isn't borderless always fullscreen?

Yea, it's possible. I did find some repositories with examples of borderless windows, not sure if they're full screen though, probably not. But yes, it is possible, now.. I don't write a lot of C++ code, I've been writing a JavaScript desktop application which uses a borderless window and a "virtual" title bar, the way it handles it is that it takes away the frame, and handles the UI and all the details itself. This is how it looks: image This window is very different from a normal one and I am sure you can tell the difference.

However, again; I do think dark mode can also be enabled by using Dwm (on Windows).

AnantTiwari-Naman commented 3 years ago

Yep, that's what I was thinking about