这是indexloc提供的服务,不要输入任何密码
Skip to content

UI Feature: Custom Titlebar #1913

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

Merged
merged 7 commits into from
Jun 5, 2025
Merged

Conversation

MrStevns
Copy link
Member

@MrStevns MrStevns commented Apr 25, 2025

What started out as an experiment, has now become a full blown feature. I present to you, our own custom title bar.

A custom title bar gives us more control of the sizing of our widgets, especially in floating mode, as Qt will otherwise favor the OS min dimensions. Normally I wouldn't see this as a problem but the resizing system is Qt is so quirky sometimes that I experience that there are not enough handles to take control of the sizing properly.

With our new custom title bar, this is no longer the case. We are in full control of what we want to show, how it should be sized and what it should look like.

What our current one looks like on each respective platform:

macOS Windows Linux
image image image image

The new one:

macOS Windows Linux
image image image

The title bar has been built using the standard palette which should make sure that it looks correct on all platforms. I've designed some new icons as well, a normal one, an active one and the same in dark variations.

The most prominent changes can be seen on macOS, especially the dark mode titlebar which was previously shown in a terrible gradient... the icons were not high DPI either.

For the other platforms, the change should be minor. On windows the title bar looks nearly identical except for the icons of course. When I tested the build on Peppermint OS, previously the title bar was more embedded into the widget, where as with the new one the title bar background is as prominent as the other platforms. Personally I think it looks fine that way but I am also not daily driving a Linux distribution. What do you think?

When the title bar becomes too narrow to show both the title and the buttons, it will favor the title and hide the buttons. The buttons can however still be accessed by right-clicking. Although in the right-click menu, there's no animation currently when hovering the items, so it uses the active representation instead.

image

Visual highlights:
image

Light Dark
hover-effect hover-effect2

Builds to try:
Windows
macOS
Linux

@MrStevns MrStevns added the UI Related to the visual appearance of the program label Apr 25, 2025
@chchwy chchwy added this to the 0.8.0 milestone Jun 3, 2025
MrStevns added 6 commits June 4, 2025 22:13
As the menu items are not able to switch between normal/active state currently
The example here is that if we use it's min layout size, then it will override the min size of for example
the toolbox.
@chchwy chchwy force-pushed the feat/custom-titlebar branch from 9b0951f to 053a5ee Compare June 4, 2025 14:13
@chchwy
Copy link
Member

chchwy commented Jun 5, 2025

Apart from the context menu, I don't have further questions. This PR looks good to me.

@chchwy chchwy self-assigned this Jun 5, 2025
Because it might be overkill to have.
@chchwy chchwy merged commit 4c63407 into pencil2d:master Jun 5, 2025
8 checks passed
@github-project-automation github-project-automation bot moved this from Needs Review to Merged in Pull Request Priority Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UI Related to the visual appearance of the program
Projects
Development

Successfully merging this pull request may close these issues.

2 participants