https://bugs.documentfoundation.org/show_bug.cgi?id=172885

--- Comment #3 from Hossein <[email protected]> ---
(In reply to Heiko Tietze from comment #2)
> How to load a theme on runtime? Something like test.json containing
> "QPushButton { color: red }" with the idea to load per
> "SAL_USE_VCLPLUGIN=qt6 SAL_VCL_QT_USE_WELDED_WIDGETS=1
> QT_STYLE_OVERRIDE=./test.json instdir/program/swriter" is no cigar.
I remember Michael said that it should be doable per Qt widgets inside
LibreOffice.

For a normal Qt app that is based on QApplication, one may easily pass CSS file
as a parameter:

QApplication Class
https://doc.qt.io/qt-6/qapplication.html

It can be done like this:

./app -stylesheet=style.css

That does not work for LibreOffice, as it does not pass the command line
options through Qt. But, we may try to set the CSS in QApplication. This is
doable in vcl/qt5/QtInstance.cxx. Add this to line #823:

pQApp->setStyleSheet("* { background: red }")

And then, make sure to:

export SAL_VCL_QT_USE_WELDED_WIDGETS=1

Then, menus and native Qt widgets become red. That is also a good way to
distinguish what is welded, and what is not.

As both GTK and Qt support stylesheets, we may think of adding a command line
option, but we also need a configuration in the settings of the application, in
the UI.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to