[TabBar] Remove frame
ClosedPublic

Authored by filipf on Nov 28 2019, 12:16 AM.

Details

Summary

In the Window Decorations and Audio KCMs we use QQC2 TabBars with a frame.

The frame already draws a top border but then the tabbar draws another border, resulting in an ugly, dark, out of place line.

This patch removes the frame from the QQC2 TabBar style to fix the issue.

Test Plan

Before:

After:

Diff Detail

Repository
R858 Qt Quick Controls 2: Desktop Style
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
filipf created this revision.Nov 28 2019, 12:16 AM
Restricted Application added a project: Plasma. · View Herald TranscriptNov 28 2019, 12:16 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
filipf requested review of this revision.Nov 28 2019, 12:16 AM
filipf edited the test plan for this revision. (Show Details)Nov 28 2019, 12:17 AM
filipf added reviewers: Plasma, VDG.
ngraham accepted this revision.Nov 28 2019, 12:29 AM
ngraham added a subscriber: ngraham.

Feels like at this point we should just break down and create an actual TabView control all at once. :p

This revision is now accepted and ready to land.Nov 28 2019, 12:29 AM

Feels like at this point we should just break down and create an actual TabView control all at once. :p

Yep. Unfortunately it seems we'd still need this hacky property because we'd be including TabBar.

... and the other hack lol, but it would be nice to not have to do all this all the time:

broulik requested changes to this revision.Nov 28 2019, 7:49 AM
broulik added a subscriber: broulik.

I don't think the style is the right approach. What happens if you run the KCM with a different style, will it refuse to load?
And border is quite a non-descript property, how about frameVisible

This revision now requires changes to proceed.Nov 28 2019, 7:49 AM

With this patch:

Fusion:

Windows 98:

Oxygen:

QtCurve:

Kvantum:

When the frame is enabled it just adds a double border with all widget styles so looks like an improvement to me. The screenshots do show we'll need to theme frame's border the same way we did for the tab bar's though.

Kai means a different QQC2 style. Which is indeed a problem with this approach, if you switch to say Material style with QT_QUICK_CONTROLS_STYLE=material the KCM will not load.

I think the better question is: Does the line serve any purpose? Or can we simply drop it completely?

filipf added a subscriber: mart.Nov 28 2019, 11:03 AM

Ah right, it will complain about a non-existing property.

Yeah it would be good if we could just drop it. Maybe @mart knows why we have it.

Ping, anyone know if we can just delete this Rectangle I called "frame"?

Well, there's a use case for a tab bar with a line below the tabs, but not a full frame. See for example tabs in Dolphin, Konsole, and Okular. I guess the question is whether it makes sense to have the tab bar draw the line itself.

filipf updated this revision to Diff 72050.Dec 23 2019, 9:42 AM

remove tabbar frame

filipf updated this revision to Diff 72051.Dec 23 2019, 9:42 AM

clean up

filipf retitled this revision from [TabBar] Add a border property to [TabBar] Remove frame.Dec 23 2019, 9:44 AM
filipf edited the summary of this revision. (Show Details)
filipf edited the test plan for this revision. (Show Details)
mart accepted this revision.Jan 22 2020, 4:52 PM
This revision was not accepted when it landed; it landed in state Needs Review.Jan 24 2020, 11:02 PM
This revision was automatically updated to reflect the committed changes.