Review Request 128880: [OS X] use a different tab bar widget for tabbed documents

René J.V. Bertin rjvbertin at gmail.com
Tue Sep 13 07:24:26 UTC 2016



> On Sept. 12, 2016, 1:23 a.m., Aleix Pol Gonzalez wrote:
> > sublime/container.cpp, line 65
> > <https://git.reviewboard.kde.org/r/128880/diff/2/?file=476709#file476709line65>
> >
> >     I'm not super fond of using fusion randomly here. Why does it work for Kate and not for us?
> 
> René J.V. Bertin wrote:
>     I asked Christoph: from what I understand they don't use QTabBar at all, but an implementation of their own. You must have noticed that it has a different way of handling lots of open documents (which I'm not sure I prefer). I also got the impression they don't plan to move the class to a framework.
>     
>     What do you mean with random use? It's quite specific, on the contrary. To be honest I hardly notice the Fusion style, esp. in Breeze but also on OS X. There it looks very much like Kate's tabs. I've always thought Qt did quite the job with Fusion, making it look acceptably at home on all major platforms.
> 
> Aleix Pol Gonzalez wrote:
>     Doesn't Qt offer any native OS X component that works as tabs? Switching style should be a last resource.
> 
> René J.V. Bertin wrote:
>     No, nothing other than the QTabBar widget, the look of which I've documented here and in the linked bug report. I'm not even aware if OS X itself has another tab widget; tab style isn't exactly identical in applications that provide a tabbed document interface (i.e. they all seem to roll their own to some extent).
>     
>     That said, whether Cocoa has a native tabbed document thingy is a moot point: Qt uses native drawing routines but not the native widgets (bar a few select exceptions). They achieve the native look by using standard Qt drawing primitives that map to native drawing calls but that could just as well map to X11 drawing commands (and they do if you use the xcb QPA).
>     
>     They only thing that we can do with the native QTabBar, apparently, is to configure it to behave as much as possible like QTabBar does with basically all other widget styles. The 3 lines after the style switch take care of that. I'll presume you agree that looks awful. I certainly doesn't look like anything I've ever seen on OS X before.
>     
>     I'll see if I have other truly native apps (other than Safari) that put up a tabbed document interface on my Mac, and post screenshot(s).
>     
>     What I think we should asks ourselves here is if using the Fusion style jumps out as something odd or anomalous when we try to look at it without remembering that we're seeing a different style rather than a bottom-up implementation of the interface? Would you have noticed if you hadn't known beforehand that this was a cheap alternative to implementing a new tabbar widget from scratch?
> 
> Aleix Pol Gonzalez wrote:
>     Maybe it would make sense to open a bug report on Qt requesting this display accessible? https://git.reviewboard.kde.org/r/128880/file/3353/
>     
>     Then mention the bug report and implement the setStyle workaround for the moment.
> 
> René J.V. Bertin wrote:
>     https://bugreports.qt.io/browse/QTBUG-44473
> 
> Aleix Pol Gonzalez wrote:
>     How is that bug report related at all?

Oops. That's their weird interface not helping; I must have "gotten in" through that bug report, then created a new on, and simply didn't notice that the URL hadn't changed after I validated the report and it was being shown in my browser.

This is the one I filed yesterday:

https://bugreports.qt.io/browse/QTBUG-55949


- René J.V.


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/128880/#review99117
-----------------------------------------------------------


On Sept. 12, 2016, 10:47 p.m., René J.V. Bertin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/128880/
> -----------------------------------------------------------
> 
> (Updated Sept. 12, 2016, 10:47 p.m.)
> 
> 
> Review request for KDE Software on Mac OS X and KDevelop.
> 
> 
> Bugs: 363473
>     http://bugs.kde.org/show_bug.cgi?id=363473
> 
> 
> Repository: kdevplatform
> 
> 
> Description
> -------
> 
> This is a potential fix for an issue raised on BKO: https://bugs.kde.org/show_bug.cgi?id=363473
> 
> It's also the most complete/implementation:
> - applies only when the Macintosh widget style is being used
> - if so, creates a QStyle object for the Fusion widget style
> - when successful, sets the `Sublime::ContainerTabBar` to use that style
> 
> This solves all issues stemming from Qt's use of a "native" widget that is intended only for use in dialogs and not in tabbed document interfaces.
> 
> In my testing, the `ContainerTabBar` ctor is called only rarely, apparently only when changing views (e.g. code -> patch review and back again, or code -> debug). If that observation is correct, use of a global `qTabBarStyle` variable is justified (but more elegant solutions might exist). This observation also justifies (IMHO) the check for the active application style rather than using an `#ifdef Q_OS_OSX` or even applying the fix across all platforms and application styles. That is certainly a possibility that doesn't lead to any shocking style mismatches in my eyes. It does cause some loss of compactness when using my QtCurve settings, which is why I added the style check; a small cost as a gesture to users of a highly configurable style.
> 
> There is still some weirdness behind the tabs which looks like a misaligned well or frame. I'd love to get that right too.
> 
> 
> Diffs
> -----
> 
>   sublime/container.cpp b04f6c3 
> 
> Diff: https://git.reviewboard.kde.org/r/128880/diff/
> 
> 
> Testing
> -------
> 
> See https://bugsfiles.kde.org/attachment.cgi?id=99160 (unpatched) and the last series of screenshots attached to the ticket on BKO. They show the fix applied to various styles on OS X.
> 
> 
> File Attachments
> ----------------
> 
> background: pure Breeze theme. Foreground: Breeze with the QTabBar set to Fusion
>   https://git.reviewboard.kde.org/media/uploaded/files/2016/09/12/3fbb5571-8fb7-4af7-b6d5-eb1d9b32cea1__tabbar-breeze-with-fusion.png
> Background: pure QtCurve<OS X Graphite>. Foreground: QtCurve<OS X Graphite> with QTabBar set to Fusion
>   https://git.reviewboard.kde.org/media/uploaded/files/2016/09/12/b1bc9406-4f98-4920-832b-2728aa9d2ee2__tabbar-breeze-with-qtcurve.png
> Tabbed document interface in native OS X applications
>   https://git.reviewboard.kde.org/media/uploaded/files/2016/09/12/5790c412-566c-42bc-83b5-efbec458d711__MacNativeTabs.png
> pure native Macintosh style with Fusion QTabBar
>   https://git.reviewboard.kde.org/media/uploaded/files/2016/09/12/0a98cc35-dad4-439c-af91-51ffc14e21b0__MacNative-QTabBarFusion.png
> pure native Macintosh style, Fusion QTabBar, no misaligned underlining
>   https://git.reviewboard.kde.org/media/uploaded/files/2016/09/12/56f92d7e-8f71-401d-b874-55165d0f701a__MacNative-QTabBarFusion.png
> 
> 
> Thanks,
> 
> René J.V. Bertin
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20160913/5a7d5896/attachment-0001.html>


More information about the KDevelop-devel mailing list