summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-10-04 12:42:33 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-10-04 21:17:46 +0200
commitea36e0502c0bc381577cfa1b1a7fedf0f05d1d72 (patch)
treed8eeb2ab7cee6f0a4ee40a846697216ce0bd5fd8 /toolkit
parent437abb3abbc506c1e20c6fec8e574abfe3487842 (diff)
tdf#150786 use a 'standard' theme for form controls
i.e. ignore system theme so we get the same results on export to pdf regardless of the theme (esp dark) and don't follow the system theme when hosted with a writer/calc/impress document (do continue to use system theme for StarBasic dialogs as seen in BasicIDE) Didn't reuse 'NativeWidgetLook' for this because is currently defaults off, while we currently do use the colors derived from the system theme even when this is off, its really the NWF flag to render using the platform theming engine Change-Id: I816d7ebaf793e5eac7bd937d44c1db0371145199 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140942 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/source/controls/unocontrol.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx
index c9a757d7dbf2..a3d0a251c382 100644
--- a/toolkit/source/controls/unocontrol.cxx
+++ b/toolkit/source/controls/unocontrol.cxx
@@ -1317,6 +1317,24 @@ void UnoControl::createPeer( const Reference< XToolkit >& rxToolkit, const Refer
xView->setGraphics( xGraphics );
+ // tdf#150886 if false use the same settings for widgets regardless of theme
+ // for consistency of document across platforms and in pdf/print output
+ if (xInfo->hasPropertyByName("StandardTheme"))
+ {
+ aVal = xPSet->getPropertyValue("StandardTheme");
+ bool bUseStandardTheme = false;
+ aVal >>= bUseStandardTheme;
+ if (bUseStandardTheme)
+ {
+ VclPtr<vcl::Window> pVclPeer = VCLUnoHelper::GetWindow(getPeer());
+ AllSettings aAllSettings = pVclPeer->GetSettings();
+ StyleSettings aStyleSettings = aAllSettings.GetStyleSettings();
+ aStyleSettings.SetStandardStyles();
+ aAllSettings.SetStyleSettings(aStyleSettings);
+ pVclPeer->SetSettings(aAllSettings);
+ }
+ }
+
peerCreated();
mbCreatingPeer = false;