vcl/qt5/QtInstanceWidget.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
New commits: commit 2ed746a0c7249850ec11ee132de4b9090a419e08 Author: Michael Weghorn <[email protected]> AuthorDate: Wed Aug 13 15:19:55 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Wed Aug 13 21:48:55 2025 +0200 tdf#130857 qt weld: Implement QtInstanceWidget::set_stack_background The doc in include/vcl/weld.hxx says: //make this widget look like a page in a notebook virtual void set_stack_background() = 0; Use the background color of a QTabWidget for the color. This will be needed to declare support for the "File" -> "Properties" dialog in an upcoming commit. The "Custom Properties" tab (for which the color is explicitly set) looks OK to me with this change in place in a WIP branch to add support for that dialog. Change-Id: If1467f0b2989917f7e8b7eb58bea46b45ec961f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189520 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/vcl/qt5/QtInstanceWidget.cxx b/vcl/qt5/QtInstanceWidget.cxx index d2530a42b0c4..65d35fa8750d 100644 --- a/vcl/qt5/QtInstanceWidget.cxx +++ b/vcl/qt5/QtInstanceWidget.cxx @@ -17,6 +17,7 @@ #include <vcl/qt/QtUtils.hxx> #include <QtGui/QMouseEvent> +#include <QtWidgets/QTabWidget> /** Name of QObject property used for the help ID. */ const char* const PROPERTY_HELP_ID = "help-id"; @@ -755,7 +756,16 @@ void QtInstanceWidget::get_property_tree(tools::JsonWriter&) void QtInstanceWidget::call_attention_to() { assert(false && "Not implemented yet"); } -void QtInstanceWidget::set_stack_background() { assert(false && "Not implemented yet"); } +void QtInstanceWidget::set_stack_background() +{ + SolarMutexGuard g; + + GetQtInstance().RunInMainThread([&] { + QTabWidget aTabWidget; + const QColor aColor = aTabWidget.palette().color(aTabWidget.backgroundRole()); + set_background(toColor(aColor)); + }); +} void QtInstanceWidget::set_title_background() { assert(false && "Not implemented yet"); }
