Bug 165466 - qt6: Scrollbars too thin
Summary: qt6: Scrollbars too thin
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
25.2.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Scrollbars Qt6
  Show dependency treegraph
 
Reported: 2025-02-26 15:49 UTC by Klaus Kusche
Modified: 2025-03-10 20:37 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of native gtk3 scrollbar (1.13 KB, image/png)
2025-03-02 10:01 UTC, Klaus Kusche
Details
Screenshot of native qt6 scrollbar (16.90 KB, image/png)
2025-03-02 10:04 UTC, Klaus Kusche
Details
Screenshot of LO main document scrollbar (6.90 KB, image/png)
2025-03-02 10:07 UTC, Klaus Kusche
Details
Screenshot of scrollbar in LO dialog (3.36 KB, image/png)
2025-03-02 10:09 UTC, Klaus Kusche
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Klaus Kusche 2025-02-26 15:49:08 UTC
Description:
I'm using libreoffice with the qt6 display backend.
My qt6 theme (automatically derived from a gtk3 theme) has quite wide scrollbars, 
I think they are 16 px wide. 
This works as expected in all other qt6 applications like wireshark,
but in libreoffice, the scrollbar width of vertical scrollbars 
(and the height of horizontal scrollbars) is truncated to less than half of that (something like 6 px?), both in dialog windows and in the main document window.

As I have a very high-res screen, this makes the scrollbar slider very hard to see and even more hard to grab with the mouse.

Version is 25.2.1.1, but that's not in the version list?

Steps to Reproduce:
Open libreoffice, look at the scrollbar to the right of the document.

Actual Results:
The scrollbar's width is much smaller than in other qt apps.

Expected Results:
It should be as wide as in e.g. wireshark.


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 25.2.1.1 (X86_64) / LibreOffice Community
Build ID: 520(Build:1)
CPU threads: 16; OS: Linux 6.13; UI render: default; VCL: qt6 (cairo+xcb)
Locale: de-DE (en_DE.iso885915); UI: en-US
Gentoo official package
Calc: threaded
Comment 1 Michael Weghorn 2025-02-28 07:24:14 UTC
Can you please attach a screenshot and give more details on the particular setup you have in which this happens? (What is the exact theme/style you're using? What is your screen resolution? What is your distro and Qt version?)

This sounds like an issue that should not occur once native Qt widgets are used (tdf#130857).
Comment 2 Klaus Kusche 2025-03-02 10:01:52 UTC
Created attachment 199558 [details]
Screenshot of native gtk3 scrollbar

That's a scrollbar in a native gtk3 app with the theme I've configured.
Comment 3 Klaus Kusche 2025-03-02 10:04:38 UTC
Created attachment 199559 [details]
Screenshot of native qt6 scrollbar

Screenshot of a scrollbar in a native qt6 app (theme seems to be auto-generated from my gtk3 theme?).
Comment 4 Klaus Kusche 2025-03-02 10:07:22 UTC
Created attachment 199560 [details]
Screenshot of LO main document scrollbar

Screenshot of the scrollbar of the main document in LO.
Comment 5 Klaus Kusche 2025-03-02 10:09:04 UTC
Created attachment 199561 [details]
Screenshot of scrollbar in LO dialog

Screenshot of a scrollbar in a LO dialog.
Comment 6 Klaus Kusche 2025-03-02 10:25:51 UTC
Latest Gentoo linux.

Latest Xfce desktop environment.

Qt 6.8.2, gtk 3.24.48, no gtk4.

Screen res 4K 3840x2160, screenshots are all native size.

I've configured a very old and locally modified variant of the Zen theme:
https://github.com/takinoy/zen-gtk-themes

This theme only contains gtk3 theme definitions, nothing for gtk4,
and nothing for qt.

I never configured any qt theme (at least I don't remember), 
and I've installed no qt additional themes.
Qt6 seems to have auto-configured its theme from my gtk3 settings???

About the screenshots: Notice that in LO, 
the arrow in the "up" button of the scrollbar is cut in half.
So it seems that the button originally had the correct witdh (twice as wide),
but the right half has been cut off.
Comment 7 Michael Weghorn 2025-03-10 04:53:10 UTC
Thanks for all the additional information.

(In reply to Klaus Kusche from comment #6)
> I never configured any qt theme (at least I don't remember), 
> and I've installed no qt additional themes.
> Qt6 seems to have auto-configured its theme from my gtk3 settings???

Thanks also for mentioning QT_QPA_PLATFORMTHEME=gtk3 in tdf#165534 comment 15.

I've set up the Zen themes by extracting them into ~/.themes . I now indeed see other theming being used when I start LibreOffice using

    GTK_THEME=Zen QT_QPA_PLATFORMTHEME=gtk3 SAL_USE_VCLPLUGIN=qt6 ./instdir/program/soffice --writer

(It somehow looks quite broken in my setup, using grey font on black background for menus for example, but let's ignore that as it seems unrelated to the issue reported here.)

And I can confirm that the scrollbar is unexpectedly thin when I set display zoom to 200% and restart LibreOffice as described above afterwards, while the scrollbar is wider for example for Qt Creator:

    GTK_THEME=Zen QT_QPA_PLATFORMTHEME=gtk3 qtcreator

For LibreOffice, it's also thin without setting GTK_THEME=Zen:

    QT_QPA_PLATFORMTHEME=gtk3 SAL_USE_VCLPLUGIN=qt6 ./instdir/program/soffice --writer

So the issue seems independent of the specific GTK theme you're using.

The same is even the case when not using QT_QPA_PLATFORMTHEME=gtk3, i.e. with the (in my setup on KDE Plasma) default Breeze Qt style, indicating that scaling isn't applied for scrollbars, as seen e.g. for the scrollbars in Writer or in the "Insert" -> "OLE Object" -> "QR and Barcode" dialog (after typing multiple lines in the "URL/Text" field). 

For the latter dialog, the scrollbar is fine however when started with SAL_VCL_QT_USE_WELDED_WIDGETS=1, i.e. when using native Qt widgets - as that dialog already supports that when explicitly enabled, see 

    commit 09e76631dd60f1e6ffab3faa17889fe7327b8a3c
    Author: Michael Weghorn
    Date:   Sat Dec 14 20:46:48 2024 +0100

        tdf#130857 tdf#162704 qt weld: Support QR/bar code dialog
        
        Declare support for the "QR and Barcode" dialog
        that can be triggered in Writer using "Insert" -> "OLE Object"
        -> "QR/Barcode".
        
        This means that native Qt widgets are used for that dialog
        now when using the qt5 or qt6 VCL plugin and starting LO with
        environment variable SAL_VCL_QT_USE_WELDED_WIDGETS=1 set.
        
        The native QPlainTextEdit also doesn't have the
        problem of rendering artifacts as described in tdf#162704
        for the vcl widget when used with qt6/kf6 and the Breeze
        style.
        
        Change-Id: I6263b8961d97141719e2b23dcc4467cda960d3e3
        Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178485
        Tested-by: Jenkins
        Reviewed-by: Michael Weghorn

This seems to proof my expectation mentioned earlier:

(In reply to Michael Weghorn from comment #1)
> This sounds like an issue that should not occur once native Qt widgets are
> used (tdf#130857).
Comment 8 Klaus Kusche 2025-03-10 09:15:16 UTC
Thanks for the detailled analysis and explanation.

So the "solution" is just to wait until all of LO has been converted
to native Qt widgets?
Comment 9 Michael Weghorn 2025-03-10 20:37:21 UTC
(In reply to Klaus Kusche from comment #8)
> So the "solution" is just to wait until all of LO has been converted
> to native Qt widgets?

I'd say yes, with "all of LO has been converted to native Qt widgets" just referring to the qt6/kf6 VCL plugins (other VCL plugins on Linux, as well as Windows/macOS are independent of that Qt welding effort).

There might be an alternative solution to make the scrollbars properly take into account scaling, but I think using native Qt widgets is the best way forward for this issue (and others).