Bug 474301 - Plasma 6 Feature Request/Proposal: Adaptive titlebar color
Summary: Plasma 6 Feature Request/Proposal: Adaptive titlebar color
Status: RESOLVED INTENTIONAL
Alias: None
Product: Breeze
Classification: Plasma
Component: window decoration (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-08 14:26 UTC by Naxdy
Modified: 2023-09-21 13:07 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Naxdy 2023-09-08 14:26:01 UTC
REQUEST
With the design teams' ongoing effort to push the "CSD but not CSD" look in native Breeze apps (which I personally am a huge fan of), it makes sense to try to apply this to as many other applications as possible. Nowadays, many applications use flat single colors near the header bar, which makes them ideal candidates for a single-color title bar / window frame like we already have.

The request therefore is to make the window title bar dynamically set its color based on the window's contents near the top edge, to create as seamless a transition from window contents to SSD's as possible.

PROPOSAL
To determine the color for the title bar, I suggest the following approach:

1. Scan the topmost row of pixels of a window's contents
2a. If > 50% of those pixels are of the same color, set the title bar to that color.
2b. If <= 50% of those pixels are of the same color, leave the title bar alone, it will be the color specified in the color scheme.

Clearly, this would require the window manager somehow talk to the window decoration, either to submit the topmost row of pixels (so that the window decoration can perform the check), or to submit the color that it should set itself to (here, the window manager would perform the check).

Like any other titlebar customizations, this feature should be toggleable in system settings.
Comment 1 Nate Graham 2023-09-08 17:25:57 UTC
It's an interesting idea.

Putting aside the challenge of coming up with a heuristic that would work reliably (e.g. what happens if the window content's top area color composition changes frequently rapidly?), the result would be app titlebars that sometimes reflected the color scheme and sometimes reflected the content of the window. But window content can have any arbitrary coloration, and the heuristic to determine titlebar color would be inscrutable for the user. As a result the window titlebar color would frequently look random. And in the process, we would lose the ability to offer a relatively cohesive UX based on consistent titlebar coloration.

So for those reasons, I don't think we can do this, sorry.
Comment 2 Naxdy 2023-09-08 19:13:49 UTC
I think that heuristically deriving the window title bar color from the window's contents is not much different than heuristically deriving the accent color from the current wallpaper (which can also be animated, or set to change over time via slideshow).

But fair enough, then at the very least I know I won't have to bother upstreaming it if I ever do manage to find the time to work on this (which would've been a bit of a headache seeing as it involves at least 3 repos from what I can glean thus far). Thanks anyway for taking the time.
Comment 3 Nate Graham 2023-09-08 19:29:07 UTC
If you do manage to get something working, I'd be curious to see it anyway. It's possible it would work better than I'm fearing, and the effect of every window potentially having a subtly or hugely different titlebar color wouldn't be so bad.
Comment 4 Naxdy 2023-09-21 08:26:26 UTC
So, I managed to hack something together that sorta works, but to be honest... I don't like it lol

I thought it would make apps look a bit more integrated if the title bar was made to look flush with the app, but it just ends up looking more out of place imo, especially when using a lot of electron apps. Honestly I prefer the default color on every title bar.

This plus the fact that it requires work on 3 repos (kwin + kdecoration + breeze) makes it kinda not worth for me to continue work on this. Oh well, it was a learning experience! :p
Comment 5 Nate Graham 2023-09-21 13:07:02 UTC
Hah! Well hopefully it was a positive learning experience. And I'm happy to see that my expectation wasn't totally off the mark, either. THanks for checking back in with your conclusions!