/src/libreoffice/vcl/source/app/settings.cxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
5 | | * This Source Code Form is subject to the terms of the Mozilla Public |
6 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
7 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
8 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
11 | | * Licensed to the Apache Software Foundation (ASF) under one or more |
12 | | * contributor license agreements. See the NOTICE file distributed |
13 | | * with this work for additional information regarding copyright |
14 | | * ownership. The ASF licenses this file to you under the Apache |
15 | | * License, Version 2.0 (the "License"); you may not use this file |
16 | | * except in compliance with the License. You may obtain a copy of |
17 | | * the License at http://www.apache.org/licenses/LICENSE-2.0 . |
18 | | */ |
19 | | |
20 | | #include <config_folders.h> |
21 | | |
22 | | #include <officecfg/Office/Common.hxx> |
23 | | #include <officecfg/VCL.hxx> |
24 | | |
25 | | #ifdef _WIN32 |
26 | | #include <win/svsys.h> |
27 | | #endif |
28 | | |
29 | | #include <comphelper/processfactory.hxx> |
30 | | #include <o3tl/test_info.hxx> |
31 | | #include <rtl/bootstrap.hxx> |
32 | | #include <tools/mapunit.hxx> |
33 | | |
34 | | #include <i18nlangtag/mslangid.hxx> |
35 | | #include <i18nlangtag/languagetag.hxx> |
36 | | |
37 | | #include <comphelper/lok.hxx> |
38 | | |
39 | | #include <vcl/graphicfilter.hxx> |
40 | | #include <IconThemeScanner.hxx> |
41 | | #include <IconThemeSelector.hxx> |
42 | | #include <vcl/IconThemeInfo.hxx> |
43 | | #include <vcl/svapp.hxx> |
44 | | #include <vcl/themecolors.hxx> |
45 | | #include <vcl/event.hxx> |
46 | | #include <vcl/settings.hxx> |
47 | | #include <vcl/i18nhelp.hxx> |
48 | | #include <vcl/outdev.hxx> |
49 | | |
50 | | #include <unotools/fontcfg.hxx> |
51 | | #include <unotools/localedatawrapper.hxx> |
52 | | #include <unotools/confignode.hxx> |
53 | | #include <unotools/configmgr.hxx> |
54 | | #include <unotools/syslocale.hxx> |
55 | | #include <unotools/syslocaleoptions.hxx> |
56 | | |
57 | | #include <salframe.hxx> |
58 | | #include <svdata.hxx> |
59 | | |
60 | | using namespace ::com::sun::star; |
61 | | |
62 | | struct ImplMouseData |
63 | | { |
64 | | MouseSettingsOptions mnOptions = MouseSettingsOptions::NONE; |
65 | | sal_uInt64 mnDoubleClkTime = 500; |
66 | | sal_Int32 mnDoubleClkWidth = 2; |
67 | | sal_Int32 mnDoubleClkHeight = 2; |
68 | | sal_Int32 mnStartDragWidth = 2 ; |
69 | | sal_Int32 mnStartDragHeight = 2; |
70 | | sal_Int32 mnButtonRepeat = 90; |
71 | | sal_Int32 mnMenuDelay = 150; |
72 | | MouseFollowFlags mnFollow = MouseFollowFlags::Menu; |
73 | | MouseMiddleButtonAction mnMiddleButtonAction= MouseMiddleButtonAction::AutoScroll; |
74 | | MouseWheelBehaviour mnWheelBehavior = MouseWheelBehaviour::FocusOnly; |
75 | | |
76 | 0 | bool operator==(const ImplMouseData& rSet) const = default; |
77 | | }; |
78 | | |
79 | | namespace |
80 | | { |
81 | | constexpr Size getInitListBoxPreviewDefaultLogicSize() |
82 | 82 | { |
83 | | #ifdef IOS |
84 | | return Size(30, 30); |
85 | | #else |
86 | 82 | return Size(15, 7); |
87 | 82 | #endif |
88 | 82 | } |
89 | | |
90 | | // Structures simplifying comparison in StyleSettings::operator ==, where for some reason |
91 | | // not all members of ImplStyleData are compared. Adding elements here would automatically |
92 | | // participate in the default comparison methods. |
93 | | |
94 | | struct ColorSet |
95 | | { |
96 | | Color maActiveBorderColor; |
97 | | Color maActiveColor; |
98 | | Color maActiveTextColor; |
99 | | Color maAlternatingRowColor; |
100 | | Color maDefaultButtonTextColor; |
101 | | Color maButtonTextColor; |
102 | | Color maDefaultActionButtonTextColor; |
103 | | Color maActionButtonTextColor; |
104 | | Color maFlatButtonTextColor; |
105 | | Color maDefaultButtonRolloverTextColor; |
106 | | Color maButtonRolloverTextColor; |
107 | | Color maDefaultActionButtonRolloverTextColor; |
108 | | Color maActionButtonRolloverTextColor; |
109 | | Color maFlatButtonRolloverTextColor; |
110 | | Color maDefaultButtonPressedRolloverTextColor; |
111 | | Color maButtonPressedRolloverTextColor; |
112 | | Color maDefaultActionButtonPressedRolloverTextColor; |
113 | | Color maActionButtonPressedRolloverTextColor; |
114 | | Color maFlatButtonPressedRolloverTextColor; |
115 | | Color maCheckedColor; |
116 | | Color maDarkShadowColor; |
117 | | Color maDeactiveBorderColor; |
118 | | Color maDeactiveColor; |
119 | | Color maDeactiveTextColor; |
120 | | Color maDialogColor; |
121 | | Color maDialogTextColor; |
122 | | Color maDisableColor; |
123 | | Color maFaceColor; |
124 | | Color maFieldColor; |
125 | | Color maFieldTextColor; |
126 | | Color maFieldRolloverTextColor; |
127 | | Color maGroupTextColor; |
128 | | Color maHelpColor; |
129 | | Color maHelpTextColor; |
130 | | Color maAccentColor; |
131 | | Color maHighlightColor; |
132 | | Color maHighlightTextColor; |
133 | | Color maLabelTextColor; |
134 | | Color maLightBorderColor; |
135 | | Color maLightColor; |
136 | | Color maLinkColor; |
137 | | Color maMenuBarColor; |
138 | | Color maMenuBarRolloverColor; |
139 | | Color maMenuBorderColor; |
140 | | Color maMenuColor; |
141 | | Color maMenuHighlightColor; |
142 | | Color maMenuHighlightTextColor; |
143 | | Color maMenuTextColor; |
144 | | Color maListBoxWindowBackgroundColor; |
145 | | Color maListBoxWindowTextColor; |
146 | | Color maListBoxWindowHighlightColor; |
147 | | Color maListBoxWindowHighlightTextColor; |
148 | | Color maMenuBarTextColor; |
149 | | Color maMenuBarRolloverTextColor; |
150 | | Color maMenuBarHighlightTextColor; |
151 | | Color maMonoColor; |
152 | | Color maRadioCheckTextColor; |
153 | | Color maShadowColor; |
154 | | Color maWarningColor; |
155 | | Color maWarningTextColor; |
156 | | Color maErrorColor; |
157 | | Color maErrorTextColor; |
158 | | Color maVisitedLinkColor; |
159 | | Color maToolTextColor; |
160 | | Color maWindowColor; |
161 | | Color maWindowTextColor; |
162 | | Color maWorkspaceColor; |
163 | | Color maActiveTabColor; |
164 | | Color maInactiveTabColor; |
165 | | Color maTabTextColor; |
166 | | Color maTabRolloverTextColor; |
167 | | Color maTabHighlightTextColor; |
168 | | |
169 | 3.00M | bool operator==(const ColorSet&) const = default; |
170 | | }; |
171 | | |
172 | | struct FontSet |
173 | | { |
174 | | vcl::Font maAppFont; |
175 | | vcl::Font maHelpFont; |
176 | | vcl::Font maTitleFont; |
177 | | vcl::Font maFloatTitleFont; |
178 | | vcl::Font maMenuFont; |
179 | | vcl::Font maToolFont; |
180 | | vcl::Font maLabelFont; |
181 | | vcl::Font maRadioCheckFont; |
182 | | vcl::Font maPushButtonFont; |
183 | | vcl::Font maFieldFont; |
184 | | vcl::Font maIconFont; |
185 | | vcl::Font maTabFont; |
186 | | vcl::Font maGroupFont; |
187 | | |
188 | 576k | bool operator==(const FontSet&) const = default; |
189 | | }; |
190 | | } |
191 | | |
192 | | struct ImplStyleData |
193 | | { |
194 | | ImplStyleData(); |
195 | | |
196 | | void SetStandardStyles(); |
197 | | |
198 | | ColorSet maColors; |
199 | | FontSet maFonts; |
200 | | sal_Int32 mnTitleHeight; |
201 | | sal_Int32 mnFloatTitleHeight; |
202 | | sal_Int32 mnScrollBarSize = 16; |
203 | | sal_Int32 mnSpinSize = 16; |
204 | | sal_Int32 mnCursorSize = 2; |
205 | | sal_Int32 mnAntialiasedMin = 0; |
206 | | sal_uInt64 mnCursorBlinkTime = STYLE_CURSOR_NOBLINKTIME; |
207 | | DragFullOptions mnDragFullOptions = DragFullOptions::All; |
208 | | SelectionOptions mnSelectionOptions = SelectionOptions::NONE; |
209 | | DisplayOptions mnDisplayOptions = DisplayOptions::NONE; |
210 | | ToolbarIconSize mnToolbarIconSize = ToolbarIconSize::Unknown; |
211 | | StyleSettingsOptions mnOptions = StyleSettingsOptions::NONE; |
212 | | TriState meUseImagesInMenus = TRISTATE_INDET; |
213 | | std::shared_ptr<vcl::IconThemeScanner> mutable mpIconThemeScanner; |
214 | | vcl::IconThemeSelector mIconThemeSelector; |
215 | | |
216 | | OUString mIconTheme; |
217 | | sal_Int32 mnMinThumbSize = 16; |
218 | | TriState meContextMenuShortcuts = TRISTATE_INDET; |
219 | | DialogStyle maDialogStyle; |
220 | | |
221 | | bool mnUseFlatMenus : 1; |
222 | | bool mbHighContrast : 1; |
223 | | bool mbUseSystemUIFonts : 1; |
224 | | /** |
225 | | * Disabling AA doesn't actually disable AA of fonts, instead it is taken |
226 | | * from system settings. |
227 | | */ |
228 | | bool mbUseFontAAFromSystem : 1; |
229 | | bool mbUseSubpixelAA : 1; |
230 | | bool mbAutoMnemonic : 1 = true; |
231 | | bool mnUseFlatBorders : 1; |
232 | | bool mbPreferredUseImagesInMenus : 1; |
233 | | bool mbSkipDisabledInMenus : 1; |
234 | | bool mbHideDisabledMenuItems : 1; |
235 | | bool mbPreferredContextMenuShortcuts : 1; |
236 | | bool mbSystemColorsLoaded : 1; |
237 | | //mbPrimaryButtonWarpsSlider == true for "jump to here" behavior for primary button, otherwise |
238 | | //primary means scroll by single page. Secondary button takes the alternative behaviour |
239 | | bool mbPrimaryButtonWarpsSlider : 1; |
240 | | bool mbPreviewUsesCheckeredBackground : 1 = true; |
241 | | |
242 | | sal_uInt16 mnEdgeBlending = 35; |
243 | | Color maEdgeBlendingTopLeftColor = Color(0xC0, 0xC0, 0xC0); |
244 | | Color maEdgeBlendingBottomRightColor = Color(0x40, 0x40, 0x40); |
245 | | sal_uInt16 mnListBoxMaximumLineCount = 25; |
246 | | |
247 | | // For some reason this isn't actually the column count that gets used, at least on iOS, but |
248 | | // instead what SvtAccessibilityOptions_Impl::GetColorValueSetColumnCount() in |
249 | | // svtools/source/config/accessibilityoptions.cxx returns. |
250 | | sal_uInt16 mnColorValueSetColumnCount = 12; |
251 | | ComboBoxTextSelectionMode meComboBoxTextSelectionMode = ComboBoxTextSelectionMode::SelectText; |
252 | | Size maListBoxPreviewDefaultLogicSize = getInitListBoxPreviewDefaultLogicSize(); |
253 | | // on-demand calculated in GetListBoxPreviewDefaultPixelSize() |
254 | | Size mutable maListBoxPreviewDefaultPixelSize; |
255 | | Bitmap mutable maAppBackgroundBitmap; // cache AppBackground bitmap |
256 | | OUString mutable maAppBackgroundBitmapFileName; // cache AppBackground bitmap file name |
257 | | |
258 | | bool operator==(const ImplStyleData& rSet) const; |
259 | | }; |
260 | | |
261 | | struct ImplMiscData |
262 | | { |
263 | | ImplMiscData(); |
264 | | bool mbEnableLocalizedDecimalSep; |
265 | | TriState mnDisablePrinting; |
266 | | }; |
267 | | |
268 | | struct ImplHelpData |
269 | | { |
270 | | sal_Int32 mnTipTimeout = 3000; |
271 | | }; |
272 | | |
273 | | struct ImplAllSettingsData |
274 | | { |
275 | | ImplAllSettingsData(); |
276 | | ImplAllSettingsData( const ImplAllSettingsData& rData ); |
277 | | ~ImplAllSettingsData(); |
278 | | |
279 | | MouseSettings maMouseSettings; |
280 | | StyleSettings maStyleSettings; |
281 | | MiscSettings maMiscSettings; |
282 | | HelpSettings maHelpSettings; |
283 | | SvtSysLocale maSysLocale; |
284 | | LanguageTag maLocale; |
285 | | LanguageTag maUILocale; |
286 | | mutable const LocaleDataWrapper* mpLocaleDataWrapper { nullptr }; |
287 | | mutable const LocaleDataWrapper* mpUILocaleDataWrapper { nullptr }; |
288 | | mutable const LocaleDataWrapper* mpNeutralLocaleDataWrapper { nullptr }; |
289 | | mutable std::unique_ptr<vcl::I18nHelper> mpI18nHelper; |
290 | | mutable std::unique_ptr<vcl::I18nHelper> mpUII18nHelper; |
291 | | |
292 | | bool operator==(const ImplAllSettingsData& rSet) const; |
293 | | }; |
294 | | |
295 | | void |
296 | | MouseSettings::SetOptions(MouseSettingsOptions nOptions) |
297 | 0 | { |
298 | 0 | mxData->mnOptions = nOptions; |
299 | 0 | } |
300 | | |
301 | | MouseSettingsOptions |
302 | | MouseSettings::GetOptions() const |
303 | 0 | { |
304 | 0 | return mxData->mnOptions; |
305 | 0 | } |
306 | | |
307 | | void |
308 | | MouseSettings::SetDoubleClickTime( sal_uInt64 nDoubleClkTime ) |
309 | 0 | { |
310 | 0 | mxData->mnDoubleClkTime = nDoubleClkTime; |
311 | 0 | } |
312 | | |
313 | | sal_uInt64 |
314 | | MouseSettings::GetDoubleClickTime() const |
315 | 4.14k | { |
316 | 4.14k | return mxData->mnDoubleClkTime; |
317 | 4.14k | } |
318 | | |
319 | | void |
320 | | MouseSettings::SetDoubleClickWidth( sal_Int32 nDoubleClkWidth ) |
321 | 0 | { |
322 | 0 | mxData->mnDoubleClkWidth = nDoubleClkWidth; |
323 | 0 | } |
324 | | |
325 | | sal_Int32 |
326 | | MouseSettings::GetDoubleClickWidth() const |
327 | 0 | { |
328 | 0 | return mxData->mnDoubleClkWidth; |
329 | 0 | } |
330 | | |
331 | | void |
332 | | MouseSettings::SetDoubleClickHeight( sal_Int32 nDoubleClkHeight ) |
333 | 0 | { |
334 | 0 | mxData->mnDoubleClkHeight = nDoubleClkHeight; |
335 | 0 | } |
336 | | |
337 | | sal_Int32 |
338 | | MouseSettings::GetDoubleClickHeight() const |
339 | 0 | { |
340 | 0 | return mxData->mnDoubleClkHeight; |
341 | 0 | } |
342 | | |
343 | | void |
344 | | MouseSettings::SetStartDragWidth( sal_Int32 nDragWidth ) |
345 | 0 | { |
346 | 0 | mxData->mnStartDragWidth = nDragWidth; |
347 | 0 | } |
348 | | |
349 | | sal_Int32 |
350 | | MouseSettings::GetStartDragWidth() const |
351 | 0 | { |
352 | 0 | return mxData->mnStartDragWidth; |
353 | 0 | } |
354 | | |
355 | | void |
356 | | MouseSettings::SetStartDragHeight( sal_Int32 nDragHeight ) |
357 | 0 | { |
358 | 0 | mxData->mnStartDragHeight = nDragHeight; |
359 | 0 | } |
360 | | |
361 | | sal_Int32 |
362 | | MouseSettings::GetStartDragHeight() const |
363 | 0 | { |
364 | 0 | return mxData->mnStartDragHeight; |
365 | 0 | } |
366 | | |
367 | | sal_uInt16 |
368 | | MouseSettings::GetStartDragCode() |
369 | 0 | { |
370 | 0 | return MOUSE_LEFT; |
371 | 0 | } |
372 | | |
373 | | sal_uInt16 |
374 | | MouseSettings::GetContextMenuCode() |
375 | 0 | { |
376 | 0 | return MOUSE_RIGHT; |
377 | 0 | } |
378 | | |
379 | | sal_uInt16 |
380 | | MouseSettings::GetContextMenuClicks() |
381 | 0 | { |
382 | 0 | return 1; |
383 | 0 | } |
384 | | |
385 | | sal_Int32 |
386 | | MouseSettings::GetScrollRepeat() |
387 | 0 | { |
388 | 0 | return 100; |
389 | 0 | } |
390 | | |
391 | | sal_Int32 |
392 | | MouseSettings::GetButtonStartRepeat() |
393 | 0 | { |
394 | 0 | return 370; |
395 | 0 | } |
396 | | |
397 | | void |
398 | | MouseSettings::SetButtonRepeat( sal_Int32 nRepeat ) |
399 | 0 | { |
400 | 0 | mxData->mnButtonRepeat = nRepeat; |
401 | 0 | } |
402 | | |
403 | | sal_Int32 |
404 | | MouseSettings::GetButtonRepeat() const |
405 | 0 | { |
406 | 0 | return mxData->mnButtonRepeat; |
407 | 0 | } |
408 | | |
409 | | void |
410 | | MouseSettings::SetMenuDelay( sal_Int32 nDelay ) |
411 | 0 | { |
412 | 0 | mxData->mnMenuDelay = nDelay; |
413 | 0 | } |
414 | | |
415 | | sal_Int32 |
416 | | MouseSettings::GetMenuDelay() const |
417 | 0 | { |
418 | 0 | return mxData->mnMenuDelay; |
419 | 0 | } |
420 | | |
421 | | void |
422 | | MouseSettings::SetFollow( MouseFollowFlags nFollow ) |
423 | 0 | { |
424 | 0 | mxData->mnFollow = nFollow; |
425 | 0 | } |
426 | | |
427 | | MouseFollowFlags |
428 | | MouseSettings::GetFollow() const |
429 | 0 | { |
430 | 0 | return mxData->mnFollow; |
431 | 0 | } |
432 | | |
433 | | void |
434 | | MouseSettings::SetMiddleButtonAction( MouseMiddleButtonAction nAction ) |
435 | 0 | { |
436 | 0 | mxData->mnMiddleButtonAction = nAction; |
437 | 0 | } |
438 | | |
439 | | MouseMiddleButtonAction |
440 | | MouseSettings::GetMiddleButtonAction() const |
441 | 0 | { |
442 | 0 | return mxData->mnMiddleButtonAction; |
443 | 0 | } |
444 | | |
445 | | void |
446 | | MouseSettings::SetWheelBehavior( MouseWheelBehaviour nBehavior ) |
447 | 0 | { |
448 | 0 | mxData->mnWheelBehavior = nBehavior; |
449 | 0 | } |
450 | | |
451 | | MouseWheelBehaviour |
452 | | MouseSettings::GetWheelBehavior() const |
453 | 0 | { |
454 | 0 | return mxData->mnWheelBehavior; |
455 | 0 | } |
456 | | |
457 | 82 | MouseSettings::MouseSettings() = default; |
458 | 41.7k | MouseSettings::MouseSettings(const MouseSettings&) = default; |
459 | 41.7k | MouseSettings::~MouseSettings() = default; |
460 | 0 | MouseSettings& MouseSettings::operator=(const MouseSettings&) = default; |
461 | | |
462 | | // Until Clang 14, P2085R0 is unsupported, and the operator can't be default outside of declaration |
463 | | bool MouseSettings::operator ==( const MouseSettings& rSet ) const |
464 | 0 | { |
465 | 0 | return mxData == rSet.mxData; |
466 | 0 | } |
467 | | |
468 | | ImplStyleData::ImplStyleData() |
469 | 82 | { |
470 | 82 | SetStandardStyles(); |
471 | 82 | } |
472 | | |
473 | | void ImplStyleData::SetStandardStyles() |
474 | 4.22k | { |
475 | 4.22k | vcl::Font aStdFont( FAMILY_SWISS, Size( 0, 8 ) ); |
476 | 4.22k | aStdFont.SetCharSet( osl_getThreadTextEncoding() ); |
477 | 4.22k | aStdFont.SetWeight( WEIGHT_NORMAL ); |
478 | 4.22k | if (!comphelper::IsFuzzing()) |
479 | 0 | aStdFont.SetFamilyName(utl::DefaultFontConfiguration::get().getUserInterfaceFont(LanguageTag(u"en"_ustr))); |
480 | 4.22k | else |
481 | 4.22k | aStdFont.SetFamilyName(u"Liberation Sans"_ustr); |
482 | 4.22k | maFonts.maAppFont = aStdFont; |
483 | 4.22k | maFonts.maHelpFont = aStdFont; |
484 | 4.22k | maFonts.maMenuFont = aStdFont; |
485 | 4.22k | maFonts.maToolFont = aStdFont; |
486 | 4.22k | maFonts.maGroupFont = aStdFont; |
487 | 4.22k | maFonts.maLabelFont = aStdFont; |
488 | 4.22k | maFonts.maRadioCheckFont = aStdFont; |
489 | 4.22k | maFonts.maPushButtonFont = aStdFont; |
490 | 4.22k | maFonts.maFieldFont = aStdFont; |
491 | 4.22k | maFonts.maIconFont = aStdFont; |
492 | 4.22k | maFonts.maTabFont = aStdFont; |
493 | | |
494 | 4.22k | aStdFont.SetWeight( WEIGHT_BOLD ); |
495 | 4.22k | maFonts.maFloatTitleFont = maFonts.maTitleFont = std::move(aStdFont); |
496 | | |
497 | 4.22k | maColors.maFaceColor = COL_LIGHTGRAY; |
498 | 4.22k | maColors.maCheckedColor = Color( 0xCC, 0xCC, 0xCC ); |
499 | 4.22k | maColors.maLightColor = COL_WHITE; |
500 | 4.22k | maColors.maLightBorderColor = COL_LIGHTGRAY; |
501 | 4.22k | maColors.maShadowColor = COL_GRAY; |
502 | 4.22k | maColors.maDarkShadowColor = COL_BLACK; |
503 | | |
504 | 4.22k | maColors.maWarningColor = Color(0xFE, 0xEF, 0xB3); // tdf#105829; see also WinSalFrame::UpdateSettings() if (bUseDarkMode) |
505 | 4.22k | maColors.maWarningTextColor = Color(0x70, 0x43, 0x00); |
506 | 4.22k | maColors.maErrorColor = Color(0xFF, 0xBA, 0xBA); |
507 | 4.22k | maColors.maErrorTextColor = Color(0x7A, 0x00, 0x06); |
508 | | |
509 | 4.22k | maColors.maDefaultButtonTextColor = COL_BLACK; |
510 | 4.22k | maColors.maButtonTextColor = COL_BLACK; |
511 | 4.22k | maColors.maDefaultActionButtonTextColor = COL_BLACK; |
512 | 4.22k | maColors.maActionButtonTextColor = COL_BLACK; |
513 | 4.22k | maColors.maFlatButtonTextColor = COL_BLACK; |
514 | 4.22k | maColors.maDefaultButtonRolloverTextColor = COL_BLACK; |
515 | 4.22k | maColors.maButtonRolloverTextColor = COL_BLACK; |
516 | 4.22k | maColors.maDefaultActionButtonRolloverTextColor = COL_BLACK; |
517 | 4.22k | maColors.maActionButtonRolloverTextColor = COL_BLACK; |
518 | 4.22k | maColors.maFlatButtonRolloverTextColor = COL_BLACK; |
519 | 4.22k | maColors.maDefaultButtonPressedRolloverTextColor = COL_BLACK; |
520 | 4.22k | maColors.maButtonPressedRolloverTextColor = COL_BLACK; |
521 | 4.22k | maColors.maDefaultActionButtonPressedRolloverTextColor = COL_BLACK; |
522 | 4.22k | maColors.maActionButtonPressedRolloverTextColor = COL_BLACK; |
523 | 4.22k | maColors.maFlatButtonPressedRolloverTextColor = COL_BLACK; |
524 | | |
525 | 4.22k | maColors.maRadioCheckTextColor = COL_BLACK; |
526 | 4.22k | maColors.maGroupTextColor = COL_BLACK; |
527 | 4.22k | maColors.maLabelTextColor = COL_BLACK; |
528 | 4.22k | maColors.maWindowColor = COL_WHITE; |
529 | 4.22k | maColors.maWindowTextColor = COL_BLACK; |
530 | 4.22k | maColors.maDialogColor = COL_LIGHTGRAY; |
531 | 4.22k | maColors.maDialogTextColor = COL_BLACK; |
532 | 4.22k | maColors.maWorkspaceColor = Color( 0xDF, 0xDF, 0xDE ); |
533 | 4.22k | maColors.maMonoColor = COL_BLACK; |
534 | 4.22k | maColors.maFieldColor = COL_WHITE; |
535 | 4.22k | maColors.maFieldTextColor = COL_BLACK; |
536 | 4.22k | maColors.maFieldRolloverTextColor = COL_BLACK; |
537 | 4.22k | maColors.maActiveBorderColor = COL_LIGHTGRAY; |
538 | 4.22k | maColors.maDeactiveColor = COL_GRAY; |
539 | 4.22k | maColors.maDeactiveTextColor = COL_LIGHTGRAY; |
540 | 4.22k | maColors.maDeactiveBorderColor = COL_LIGHTGRAY; |
541 | 4.22k | maColors.maMenuColor = COL_LIGHTGRAY; |
542 | 4.22k | maColors.maMenuBarColor = COL_LIGHTGRAY; |
543 | 4.22k | maColors.maMenuBarRolloverColor = COL_BLUE; |
544 | 4.22k | maColors.maMenuBorderColor = COL_LIGHTGRAY; |
545 | 4.22k | maColors.maMenuTextColor = COL_BLACK; |
546 | 4.22k | maColors.maListBoxWindowBackgroundColor = COL_WHITE; |
547 | 4.22k | maColors.maListBoxWindowTextColor = COL_BLACK; |
548 | 4.22k | maColors.maListBoxWindowHighlightColor = COL_BLUE; |
549 | 4.22k | maColors.maListBoxWindowHighlightTextColor = COL_WHITE; |
550 | 4.22k | maColors.maMenuBarTextColor = COL_BLACK; |
551 | 4.22k | maColors.maMenuBarRolloverTextColor = COL_WHITE; |
552 | 4.22k | maColors.maMenuBarHighlightTextColor = COL_WHITE; |
553 | 4.22k | maColors.maMenuHighlightColor = COL_BLUE; |
554 | 4.22k | maColors.maMenuHighlightTextColor = COL_WHITE; |
555 | 4.22k | maColors.maAccentColor = COL_RED; |
556 | 4.22k | maColors.maHighlightColor = COL_BLUE; |
557 | 4.22k | maColors.maHighlightTextColor = COL_WHITE; |
558 | | // make active like highlight, except with a small contrast |
559 | 4.22k | maColors.maActiveColor = maColors.maHighlightColor; |
560 | 4.22k | maColors.maActiveColor.IncreaseLuminance(32); |
561 | 4.22k | maColors.maActiveTextColor = maColors.maHighlightTextColor; |
562 | 4.22k | maColors.maActiveTabColor = COL_WHITE; |
563 | 4.22k | maColors.maInactiveTabColor = COL_LIGHTGRAY; |
564 | 4.22k | maColors.maTabTextColor = COL_BLACK; |
565 | 4.22k | maColors.maTabRolloverTextColor = COL_BLACK; |
566 | 4.22k | maColors.maTabHighlightTextColor = COL_BLACK; |
567 | 4.22k | maColors.maDisableColor = COL_GRAY; |
568 | 4.22k | maColors.maHelpColor = Color( 0xFF, 0xFF, 0xE0 ); |
569 | 4.22k | maColors.maHelpTextColor = COL_BLACK; |
570 | 4.22k | maColors.maLinkColor = COL_BLUE; |
571 | 4.22k | maColors.maVisitedLinkColor = Color( 0x00, 0x00, 0xCC ); |
572 | 4.22k | maColors.maToolTextColor = COL_BLACK; |
573 | 4.22k | maColors.maAlternatingRowColor = Color( 0xEE, 0xEE, 0xEE ); |
574 | | |
575 | 4.22k | mnTitleHeight = 18; |
576 | 4.22k | mnFloatTitleHeight = 13; |
577 | 4.22k | mbHighContrast = false; |
578 | 4.22k | mbUseSystemUIFonts = true; |
579 | 4.22k | mbUseFontAAFromSystem = true; |
580 | 4.22k | mbUseSubpixelAA = true; |
581 | 4.22k | mnUseFlatBorders = false; |
582 | 4.22k | mnUseFlatMenus = false; |
583 | 4.22k | mbPreferredUseImagesInMenus = true; |
584 | 4.22k | mbSkipDisabledInMenus = false; |
585 | 4.22k | mbHideDisabledMenuItems = false; |
586 | 4.22k | mbPreferredContextMenuShortcuts = true; |
587 | 4.22k | mbSystemColorsLoaded = false; |
588 | 4.22k | mbPrimaryButtonWarpsSlider = false; |
589 | 4.22k | } |
590 | | |
591 | 82 | StyleSettings::StyleSettings() = default; |
592 | 87.2k | StyleSettings::StyleSettings(const StyleSettings&) = default; |
593 | 87.3k | StyleSettings::~StyleSettings() = default; |
594 | 41.7k | StyleSettings& StyleSettings::operator=(const StyleSettings&) = default; |
595 | | |
596 | | void |
597 | | StyleSettings::SetFaceColor( const Color& rColor ) |
598 | 2 | { |
599 | 2 | mxData->maColors.maFaceColor = rColor; |
600 | 2 | } |
601 | | |
602 | | void |
603 | | StyleSettings::SetSystemColorsLoaded( bool bLoaded ) |
604 | 0 | { |
605 | 0 | mxData->mbSystemColorsLoaded = bLoaded; |
606 | 0 | } |
607 | | |
608 | | bool |
609 | | StyleSettings::GetSystemColorsLoaded() const |
610 | 0 | { |
611 | 0 | return mxData->mbSystemColorsLoaded; |
612 | 0 | } |
613 | | |
614 | | const Color& |
615 | | StyleSettings::GetFaceColor() const |
616 | 59.0k | { |
617 | 59.0k | return mxData->maColors.maFaceColor; |
618 | 59.0k | } |
619 | | |
620 | | void |
621 | | StyleSettings::SetCheckedColor( const Color& rColor ) |
622 | 0 | { |
623 | 0 | mxData->maColors.maCheckedColor = rColor; |
624 | 0 | } |
625 | | |
626 | | const Color& |
627 | | StyleSettings::GetCheckedColor() const |
628 | 0 | { |
629 | 0 | return mxData->maColors.maCheckedColor; |
630 | 0 | } |
631 | | |
632 | | void |
633 | | StyleSettings::SetLightColor( const Color& rColor ) |
634 | 0 | { |
635 | 0 | mxData->maColors.maLightColor = rColor; |
636 | 0 | } |
637 | | |
638 | | const Color& |
639 | | StyleSettings::GetLightColor() const |
640 | 0 | { |
641 | 0 | return mxData->maColors.maLightColor; |
642 | 0 | } |
643 | | |
644 | | void |
645 | | StyleSettings::SetLightBorderColor( const Color& rColor ) |
646 | 0 | { |
647 | 0 | mxData->maColors.maLightBorderColor = rColor; |
648 | 0 | } |
649 | | |
650 | | const Color& |
651 | | StyleSettings::GetLightBorderColor() const |
652 | 0 | { |
653 | 0 | return mxData->maColors.maLightBorderColor; |
654 | 0 | } |
655 | | |
656 | | void |
657 | | StyleSettings::SetWarningColor( const Color& rColor ) |
658 | 0 | { |
659 | 0 | mxData->maColors.maWarningColor = rColor; |
660 | 0 | } |
661 | | |
662 | | const Color& |
663 | | StyleSettings::GetWarningColor() const |
664 | 0 | { |
665 | 0 | return mxData->maColors.maWarningColor; |
666 | 0 | } |
667 | | |
668 | | const Color& |
669 | | StyleSettings::GetWarningTextColor() const |
670 | 0 | { |
671 | 0 | return mxData->maColors.maWarningTextColor; |
672 | 0 | } |
673 | | |
674 | | const Color& |
675 | | StyleSettings::GetErrorColor() const |
676 | 0 | { |
677 | 0 | return mxData->maColors.maErrorColor; |
678 | 0 | } |
679 | | |
680 | | const Color& |
681 | | StyleSettings::GetErrorTextColor() const |
682 | 0 | { |
683 | 0 | return mxData->maColors.maErrorTextColor; |
684 | 0 | } |
685 | | |
686 | | void |
687 | | StyleSettings::SetShadowColor( const Color& rColor ) |
688 | 0 | { |
689 | 0 | mxData->maColors.maShadowColor = rColor; |
690 | 0 | } |
691 | | |
692 | | const Color& |
693 | | StyleSettings::GetShadowColor() const |
694 | 358 | { |
695 | 358 | return mxData->maColors.maShadowColor; |
696 | 358 | } |
697 | | |
698 | | void |
699 | | StyleSettings::SetDarkShadowColor( const Color& rColor ) |
700 | 0 | { |
701 | 0 | mxData->maColors.maDarkShadowColor = rColor; |
702 | 0 | } |
703 | | |
704 | | const Color& |
705 | | StyleSettings::GetDarkShadowColor() const |
706 | 8.28k | { |
707 | 8.28k | return mxData->maColors.maDarkShadowColor; |
708 | 8.28k | } |
709 | | |
710 | | void |
711 | | StyleSettings::SetDefaultButtonTextColor( const Color& rColor ) |
712 | 0 | { |
713 | 0 | mxData->maColors.maDefaultButtonTextColor = rColor; |
714 | 0 | } |
715 | | |
716 | | const Color& |
717 | | StyleSettings::GetDefaultButtonTextColor() const |
718 | 0 | { |
719 | 0 | return mxData->maColors.maDefaultButtonTextColor; |
720 | 0 | } |
721 | | |
722 | | void |
723 | | StyleSettings::SetButtonTextColor( const Color& rColor ) |
724 | 0 | { |
725 | 0 | mxData->maColors.maButtonTextColor = rColor; |
726 | 0 | } |
727 | | |
728 | | const Color& |
729 | | StyleSettings::GetButtonTextColor() const |
730 | 8.55k | { |
731 | 8.55k | return mxData->maColors.maButtonTextColor; |
732 | 8.55k | } |
733 | | |
734 | | void |
735 | | StyleSettings::SetDefaultActionButtonTextColor( const Color& rColor ) |
736 | 0 | { |
737 | 0 | mxData->maColors.maDefaultActionButtonTextColor = rColor; |
738 | 0 | } |
739 | | |
740 | | const Color& |
741 | | StyleSettings::GetDefaultActionButtonTextColor() const |
742 | 0 | { |
743 | 0 | return mxData->maColors.maDefaultActionButtonTextColor; |
744 | 0 | } |
745 | | |
746 | | void |
747 | | StyleSettings::SetActionButtonTextColor( const Color& rColor ) |
748 | 0 | { |
749 | 0 | mxData->maColors.maActionButtonTextColor = rColor; |
750 | 0 | } |
751 | | |
752 | | const Color& |
753 | | StyleSettings::GetActionButtonTextColor() const |
754 | 0 | { |
755 | 0 | return mxData->maColors.maActionButtonTextColor; |
756 | 0 | } |
757 | | |
758 | | void |
759 | | StyleSettings::SetFlatButtonTextColor( const Color& rColor ) |
760 | 0 | { |
761 | 0 | mxData->maColors.maFlatButtonTextColor = rColor; |
762 | 0 | } |
763 | | |
764 | | const Color& |
765 | | StyleSettings::GetFlatButtonTextColor() const |
766 | 0 | { |
767 | 0 | return mxData->maColors.maFlatButtonTextColor; |
768 | 0 | } |
769 | | |
770 | | void |
771 | | StyleSettings::SetDefaultButtonRolloverTextColor( const Color& rColor ) |
772 | 0 | { |
773 | 0 | mxData->maColors.maDefaultButtonRolloverTextColor = rColor; |
774 | 0 | } |
775 | | |
776 | | const Color& |
777 | | StyleSettings::GetDefaultButtonRolloverTextColor() const |
778 | 0 | { |
779 | 0 | return mxData->maColors.maDefaultButtonRolloverTextColor; |
780 | 0 | } |
781 | | |
782 | | void |
783 | | StyleSettings::SetButtonRolloverTextColor( const Color& rColor ) |
784 | 0 | { |
785 | 0 | mxData->maColors.maButtonRolloverTextColor = rColor; |
786 | 0 | } |
787 | | |
788 | | const Color& |
789 | | StyleSettings::GetButtonRolloverTextColor() const |
790 | 0 | { |
791 | 0 | return mxData->maColors.maButtonRolloverTextColor; |
792 | 0 | } |
793 | | |
794 | | void |
795 | | StyleSettings::SetDefaultActionButtonRolloverTextColor( const Color& rColor ) |
796 | 0 | { |
797 | 0 | mxData->maColors.maDefaultActionButtonRolloverTextColor = rColor; |
798 | 0 | } |
799 | | |
800 | | const Color& |
801 | | StyleSettings::GetDefaultActionButtonRolloverTextColor() const |
802 | 0 | { |
803 | 0 | return mxData->maColors.maDefaultActionButtonRolloverTextColor; |
804 | 0 | } |
805 | | |
806 | | void |
807 | | StyleSettings::SetActionButtonRolloverTextColor( const Color& rColor ) |
808 | 0 | { |
809 | 0 | mxData->maColors.maActionButtonRolloverTextColor = rColor; |
810 | 0 | } |
811 | | |
812 | | const Color& |
813 | | StyleSettings::GetActionButtonRolloverTextColor() const |
814 | 0 | { |
815 | 0 | return mxData->maColors.maActionButtonRolloverTextColor; |
816 | 0 | } |
817 | | |
818 | | void |
819 | | StyleSettings::SetFlatButtonRolloverTextColor( const Color& rColor ) |
820 | 0 | { |
821 | 0 | mxData->maColors.maFlatButtonRolloverTextColor = rColor; |
822 | 0 | } |
823 | | |
824 | | const Color& |
825 | | StyleSettings::GetFlatButtonRolloverTextColor() const |
826 | 0 | { |
827 | 0 | return mxData->maColors.maFlatButtonRolloverTextColor; |
828 | 0 | } |
829 | | |
830 | | void |
831 | | StyleSettings::SetDefaultButtonPressedRolloverTextColor( const Color& rColor ) |
832 | 0 | { |
833 | 0 | mxData->maColors.maDefaultButtonPressedRolloverTextColor = rColor; |
834 | 0 | } |
835 | | |
836 | | const Color& |
837 | | StyleSettings::GetDefaultButtonPressedRolloverTextColor() const |
838 | 0 | { |
839 | 0 | return mxData->maColors.maDefaultButtonPressedRolloverTextColor; |
840 | 0 | } |
841 | | |
842 | | void |
843 | | StyleSettings::SetButtonPressedRolloverTextColor( const Color& rColor ) |
844 | 0 | { |
845 | 0 | mxData->maColors.maButtonPressedRolloverTextColor = rColor; |
846 | 0 | } |
847 | | |
848 | | const Color& |
849 | | StyleSettings::GetButtonPressedRolloverTextColor() const |
850 | 0 | { |
851 | 0 | return mxData->maColors.maButtonPressedRolloverTextColor; |
852 | 0 | } |
853 | | |
854 | | void |
855 | | StyleSettings::SetDefaultActionButtonPressedRolloverTextColor( const Color& rColor ) |
856 | 0 | { |
857 | 0 | mxData->maColors.maDefaultActionButtonPressedRolloverTextColor = rColor; |
858 | 0 | } |
859 | | |
860 | | const Color& |
861 | | StyleSettings::GetDefaultActionButtonPressedRolloverTextColor() const |
862 | 0 | { |
863 | 0 | return mxData->maColors.maDefaultActionButtonPressedRolloverTextColor; |
864 | 0 | } |
865 | | |
866 | | void |
867 | | StyleSettings::SetActionButtonPressedRolloverTextColor( const Color& rColor ) |
868 | 0 | { |
869 | 0 | mxData->maColors.maActionButtonPressedRolloverTextColor = rColor; |
870 | 0 | } |
871 | | |
872 | | const Color& |
873 | | StyleSettings::GetActionButtonPressedRolloverTextColor() const |
874 | 0 | { |
875 | 0 | return mxData->maColors.maActionButtonPressedRolloverTextColor; |
876 | 0 | } |
877 | | |
878 | | void |
879 | | StyleSettings::SetFlatButtonPressedRolloverTextColor( const Color& rColor ) |
880 | 0 | { |
881 | 0 | mxData->maColors.maFlatButtonPressedRolloverTextColor = rColor; |
882 | 0 | } |
883 | | |
884 | | const Color& |
885 | | StyleSettings::GetFlatButtonPressedRolloverTextColor() const |
886 | 0 | { |
887 | 0 | return mxData->maColors.maFlatButtonPressedRolloverTextColor; |
888 | 0 | } |
889 | | |
890 | | void |
891 | | StyleSettings::SetRadioCheckTextColor( const Color& rColor ) |
892 | 0 | { |
893 | 0 | mxData->maColors.maRadioCheckTextColor = rColor; |
894 | 0 | } |
895 | | |
896 | | const Color& |
897 | | StyleSettings::GetRadioCheckTextColor() const |
898 | 0 | { |
899 | 0 | return mxData->maColors.maRadioCheckTextColor; |
900 | 0 | } |
901 | | |
902 | | void |
903 | | StyleSettings::SetGroupTextColor( const Color& rColor ) |
904 | 0 | { |
905 | 0 | mxData->maColors.maGroupTextColor = rColor; |
906 | 0 | } |
907 | | |
908 | | const Color& |
909 | | StyleSettings::GetGroupTextColor() const |
910 | 0 | { |
911 | 0 | return mxData->maColors.maGroupTextColor; |
912 | 0 | } |
913 | | |
914 | | void |
915 | | StyleSettings::SetLabelTextColor( const Color& rColor ) |
916 | 0 | { |
917 | 0 | mxData->maColors.maLabelTextColor = rColor; |
918 | 0 | } |
919 | | |
920 | | const Color& |
921 | | StyleSettings::GetLabelTextColor() const |
922 | 114 | { |
923 | 114 | return mxData->maColors.maLabelTextColor; |
924 | 114 | } |
925 | | |
926 | | void |
927 | | StyleSettings::SetWindowColor( const Color& rColor ) |
928 | 0 | { |
929 | 0 | mxData->maColors.maWindowColor = rColor; |
930 | 0 | } |
931 | | |
932 | | const Color& |
933 | | StyleSettings::GetWindowColor() const |
934 | 562 | { |
935 | 562 | return mxData->maColors.maWindowColor; |
936 | 562 | } |
937 | | |
938 | | void |
939 | | StyleSettings::SetWindowTextColor( const Color& rColor ) |
940 | 0 | { |
941 | 0 | mxData->maColors.maWindowTextColor = rColor; |
942 | 0 | } |
943 | | |
944 | | const Color& |
945 | | StyleSettings::GetWindowTextColor() const |
946 | 1.20k | { |
947 | 1.20k | return mxData->maColors.maWindowTextColor; |
948 | 1.20k | } |
949 | | |
950 | | void |
951 | | StyleSettings::SetDialogColor( const Color& rColor ) |
952 | 2 | { |
953 | 2 | mxData->maColors.maDialogColor = rColor; |
954 | 2 | } |
955 | | |
956 | | const Color& |
957 | | StyleSettings::GetDialogColor() const |
958 | 0 | { |
959 | 0 | return mxData->maColors.maDialogColor; |
960 | 0 | } |
961 | | |
962 | | void |
963 | | StyleSettings::SetDialogTextColor( const Color& rColor ) |
964 | 0 | { |
965 | 0 | mxData->maColors.maDialogTextColor = rColor; |
966 | 0 | } |
967 | | |
968 | | const Color& |
969 | | StyleSettings::GetDialogTextColor() const |
970 | 0 | { |
971 | 0 | return mxData->maColors.maDialogTextColor; |
972 | 0 | } |
973 | | |
974 | | void |
975 | | StyleSettings::SetWorkspaceColor( const Color& rColor ) |
976 | 2 | { |
977 | 2 | mxData->maColors.maWorkspaceColor = rColor; |
978 | 2 | } |
979 | | |
980 | | const Color& |
981 | | StyleSettings::GetWorkspaceColor() const |
982 | 0 | { |
983 | 0 | return mxData->maColors.maWorkspaceColor; |
984 | 0 | } |
985 | | |
986 | | void |
987 | | StyleSettings::SetFieldColor( const Color& rColor ) |
988 | 0 | { |
989 | 0 | mxData->maColors.maFieldColor = rColor; |
990 | 0 | } |
991 | | |
992 | | const Color& |
993 | | StyleSettings::GetFieldColor() const |
994 | 0 | { |
995 | 0 | return mxData->maColors.maFieldColor; |
996 | 0 | } |
997 | | |
998 | | void |
999 | | StyleSettings::SetFieldTextColor( const Color& rColor ) |
1000 | 0 | { |
1001 | 0 | mxData->maColors.maFieldTextColor = rColor; |
1002 | 0 | } |
1003 | | |
1004 | | const Color& |
1005 | | StyleSettings::GetFieldTextColor() const |
1006 | 0 | { |
1007 | 0 | return mxData->maColors.maFieldTextColor; |
1008 | 0 | } |
1009 | | |
1010 | | void |
1011 | | StyleSettings::SetFieldRolloverTextColor( const Color& rColor ) |
1012 | 0 | { |
1013 | 0 | mxData->maColors.maFieldRolloverTextColor = rColor; |
1014 | 0 | } |
1015 | | |
1016 | | const Color& |
1017 | | StyleSettings::GetFieldRolloverTextColor() const |
1018 | 0 | { |
1019 | 0 | return mxData->maColors.maFieldRolloverTextColor; |
1020 | 0 | } |
1021 | | |
1022 | | void |
1023 | | StyleSettings::SetActiveColor( const Color& rColor ) |
1024 | 0 | { |
1025 | 0 | mxData->maColors.maActiveColor = rColor; |
1026 | 0 | } |
1027 | | |
1028 | | const Color& |
1029 | | StyleSettings::GetActiveColor() const |
1030 | 0 | { |
1031 | 0 | return mxData->maColors.maActiveColor; |
1032 | 0 | } |
1033 | | |
1034 | | void |
1035 | | StyleSettings::SetActiveTextColor( const Color& rColor ) |
1036 | 0 | { |
1037 | 0 | mxData->maColors.maActiveTextColor = rColor; |
1038 | 0 | } |
1039 | | |
1040 | | const Color& |
1041 | | StyleSettings::GetActiveTextColor() const |
1042 | 0 | { |
1043 | 0 | return mxData->maColors.maActiveTextColor; |
1044 | 0 | } |
1045 | | |
1046 | | void |
1047 | | StyleSettings::SetActiveBorderColor( const Color& rColor ) |
1048 | 0 | { |
1049 | 0 | mxData->maColors.maActiveBorderColor = rColor; |
1050 | 0 | } |
1051 | | |
1052 | | const Color& |
1053 | | StyleSettings::GetActiveBorderColor() const |
1054 | 0 | { |
1055 | 0 | return mxData->maColors.maActiveBorderColor; |
1056 | 0 | } |
1057 | | |
1058 | | void |
1059 | | StyleSettings::SetDeactiveColor( const Color& rColor ) |
1060 | 0 | { |
1061 | 0 | mxData->maColors.maDeactiveColor = rColor; |
1062 | 0 | } |
1063 | | |
1064 | | const Color& |
1065 | | StyleSettings::GetDeactiveColor() const |
1066 | 468 | { |
1067 | 468 | return mxData->maColors.maDeactiveColor; |
1068 | 468 | } |
1069 | | |
1070 | | void |
1071 | | StyleSettings::SetDeactiveTextColor( const Color& rColor ) |
1072 | 0 | { |
1073 | 0 | mxData->maColors.maDeactiveTextColor = rColor; |
1074 | 0 | } |
1075 | | |
1076 | | const Color& |
1077 | | StyleSettings::GetDeactiveTextColor() const |
1078 | 0 | { |
1079 | 0 | return mxData->maColors.maDeactiveTextColor; |
1080 | 0 | } |
1081 | | |
1082 | | void |
1083 | | StyleSettings::SetDeactiveBorderColor( const Color& rColor ) |
1084 | 0 | { |
1085 | 0 | mxData->maColors.maDeactiveBorderColor = rColor; |
1086 | 0 | } |
1087 | | |
1088 | | const Color& |
1089 | | StyleSettings::GetDeactiveBorderColor() const |
1090 | 0 | { |
1091 | 0 | return mxData->maColors.maDeactiveBorderColor; |
1092 | 0 | } |
1093 | | |
1094 | | void |
1095 | | StyleSettings::SetAccentColor( const Color& rColor ) |
1096 | 0 | { |
1097 | 0 | mxData->maColors.maAccentColor = rColor; |
1098 | 0 | } |
1099 | | |
1100 | | const Color& |
1101 | | StyleSettings::GetAccentColor() const |
1102 | 0 | { |
1103 | 0 | return mxData->maColors.maAccentColor; |
1104 | 0 | } |
1105 | | |
1106 | | void |
1107 | | StyleSettings::SetHighlightColor( const Color& rColor ) |
1108 | 0 | { |
1109 | 0 | mxData->maColors.maHighlightColor = rColor; |
1110 | 0 | } |
1111 | | |
1112 | | const Color& |
1113 | | StyleSettings::GetHighlightColor() const |
1114 | 7.76k | { |
1115 | 7.76k | return mxData->maColors.maHighlightColor; |
1116 | 7.76k | } |
1117 | | |
1118 | | void |
1119 | | StyleSettings::SetHighlightTextColor( const Color& rColor ) |
1120 | 0 | { |
1121 | 0 | mxData->maColors.maHighlightTextColor = rColor; |
1122 | 0 | } |
1123 | | |
1124 | | const Color& |
1125 | | StyleSettings::GetHighlightTextColor() const |
1126 | 413 | { |
1127 | 413 | return mxData->maColors.maHighlightTextColor; |
1128 | 413 | } |
1129 | | |
1130 | | void |
1131 | | StyleSettings::SetDisableColor( const Color& rColor ) |
1132 | 0 | { |
1133 | 0 | mxData->maColors.maDisableColor = rColor; |
1134 | 0 | } |
1135 | | |
1136 | | const Color& |
1137 | | StyleSettings::GetDisableColor() const |
1138 | 368 | { |
1139 | 368 | return mxData->maColors.maDisableColor; |
1140 | 368 | } |
1141 | | |
1142 | | void |
1143 | | StyleSettings::SetHelpColor( const Color& rColor ) |
1144 | 0 | { |
1145 | 0 | mxData->maColors.maHelpColor = rColor; |
1146 | 0 | } |
1147 | | |
1148 | | const Color& |
1149 | | StyleSettings::GetHelpColor() const |
1150 | 0 | { |
1151 | 0 | return mxData->maColors.maHelpColor; |
1152 | 0 | } |
1153 | | |
1154 | | void |
1155 | | StyleSettings::SetHelpTextColor( const Color& rColor ) |
1156 | 0 | { |
1157 | 0 | mxData->maColors.maHelpTextColor = rColor; |
1158 | 0 | } |
1159 | | |
1160 | | const Color& |
1161 | | StyleSettings::GetHelpTextColor() const |
1162 | 0 | { |
1163 | 0 | return mxData->maColors.maHelpTextColor; |
1164 | 0 | } |
1165 | | |
1166 | | void |
1167 | | StyleSettings::SetMenuColor( const Color& rColor ) |
1168 | 2 | { |
1169 | 2 | mxData->maColors.maMenuColor = rColor; |
1170 | 2 | } |
1171 | | |
1172 | | const Color& |
1173 | | StyleSettings::GetMenuColor() const |
1174 | 268 | { |
1175 | 268 | return mxData->maColors.maMenuColor; |
1176 | 268 | } |
1177 | | |
1178 | | void |
1179 | | StyleSettings::SetMenuBarColor( const Color& rColor ) |
1180 | 2 | { |
1181 | 2 | mxData->maColors.maMenuBarColor = rColor; |
1182 | 2 | } |
1183 | | |
1184 | | const Color& |
1185 | | StyleSettings::GetMenuBarColor() const |
1186 | 0 | { |
1187 | 0 | return mxData->maColors.maMenuBarColor; |
1188 | 0 | } |
1189 | | |
1190 | | void |
1191 | | StyleSettings::SetMenuBarRolloverColor( const Color& rColor ) |
1192 | 0 | { |
1193 | 0 | mxData->maColors.maMenuBarRolloverColor = rColor; |
1194 | 0 | } |
1195 | | |
1196 | | const Color& |
1197 | | StyleSettings::GetMenuBarRolloverColor() const |
1198 | 0 | { |
1199 | 0 | return mxData->maColors.maMenuBarRolloverColor; |
1200 | 0 | } |
1201 | | |
1202 | | void |
1203 | | StyleSettings::SetMenuBorderColor( const Color& rColor ) |
1204 | 0 | { |
1205 | 0 | mxData->maColors.maMenuBorderColor = rColor; |
1206 | 0 | } |
1207 | | |
1208 | | const Color& |
1209 | | StyleSettings::GetMenuBorderColor() const |
1210 | 0 | { |
1211 | 0 | return mxData->maColors.maMenuBorderColor; |
1212 | 0 | } |
1213 | | |
1214 | | void |
1215 | | StyleSettings::SetMenuTextColor( const Color& rColor ) |
1216 | 0 | { |
1217 | 0 | mxData->maColors.maMenuTextColor = rColor; |
1218 | 0 | } |
1219 | | |
1220 | | const Color& |
1221 | | StyleSettings::GetMenuTextColor() const |
1222 | 944 | { |
1223 | 944 | return mxData->maColors.maMenuTextColor; |
1224 | 944 | } |
1225 | | |
1226 | | void |
1227 | | StyleSettings::SetMenuBarTextColor( const Color& rColor ) |
1228 | 0 | { |
1229 | 0 | mxData->maColors.maMenuBarTextColor = rColor; |
1230 | 0 | } |
1231 | | |
1232 | | const Color& |
1233 | | StyleSettings::GetMenuBarTextColor() const |
1234 | 0 | { |
1235 | 0 | return mxData->maColors.maMenuBarTextColor; |
1236 | 0 | } |
1237 | | |
1238 | | void |
1239 | | StyleSettings::SetMenuBarRolloverTextColor( const Color& rColor ) |
1240 | 0 | { |
1241 | 0 | mxData->maColors.maMenuBarRolloverTextColor = rColor; |
1242 | 0 | } |
1243 | | |
1244 | | const Color& |
1245 | | StyleSettings::GetMenuBarRolloverTextColor() const |
1246 | 0 | { |
1247 | 0 | return mxData->maColors.maMenuBarRolloverTextColor; |
1248 | 0 | } |
1249 | | |
1250 | | void |
1251 | | StyleSettings::SetMenuBarHighlightTextColor( const Color& rColor ) |
1252 | 0 | { |
1253 | 0 | mxData->maColors.maMenuBarHighlightTextColor = rColor; |
1254 | 0 | } |
1255 | | |
1256 | | const Color& |
1257 | | StyleSettings::GetMenuBarHighlightTextColor() const |
1258 | 0 | { |
1259 | 0 | return mxData->maColors.maMenuBarHighlightTextColor; |
1260 | 0 | } |
1261 | | |
1262 | | void |
1263 | | StyleSettings::SetMenuHighlightColor( const Color& rColor ) |
1264 | 0 | { |
1265 | 0 | mxData->maColors.maMenuHighlightColor = rColor; |
1266 | 0 | } |
1267 | | |
1268 | | const Color& |
1269 | | StyleSettings::GetMenuHighlightColor() const |
1270 | 0 | { |
1271 | 0 | return mxData->maColors.maMenuHighlightColor; |
1272 | 0 | } |
1273 | | |
1274 | | void |
1275 | | StyleSettings::SetMenuHighlightTextColor( const Color& rColor ) |
1276 | 0 | { |
1277 | 0 | mxData->maColors.maMenuHighlightTextColor = rColor; |
1278 | 0 | } |
1279 | | |
1280 | | const Color& |
1281 | | StyleSettings::GetMenuHighlightTextColor() const |
1282 | 0 | { |
1283 | 0 | return mxData->maColors.maMenuHighlightTextColor; |
1284 | 0 | } |
1285 | | |
1286 | | void |
1287 | | StyleSettings::SetListBoxWindowBackgroundColor( const Color& rColor ) |
1288 | 0 | { |
1289 | 0 | mxData->maColors.maListBoxWindowBackgroundColor = rColor; |
1290 | 0 | } |
1291 | | |
1292 | | const Color& |
1293 | | StyleSettings::GetListBoxWindowBackgroundColor() const |
1294 | 0 | { |
1295 | 0 | return mxData->maColors.maListBoxWindowBackgroundColor; |
1296 | 0 | } |
1297 | | |
1298 | | void |
1299 | | StyleSettings::SetListBoxWindowTextColor( const Color& rColor ) |
1300 | 0 | { |
1301 | 0 | mxData->maColors.maListBoxWindowTextColor = rColor; |
1302 | 0 | } |
1303 | | |
1304 | | const Color& |
1305 | | StyleSettings::GetListBoxWindowTextColor() const |
1306 | 0 | { |
1307 | 0 | return mxData->maColors.maListBoxWindowTextColor; |
1308 | 0 | } |
1309 | | |
1310 | | void |
1311 | | StyleSettings::SetListBoxWindowHighlightColor( const Color& rColor ) |
1312 | 0 | { |
1313 | 0 | mxData->maColors.maListBoxWindowHighlightColor = rColor; |
1314 | 0 | } |
1315 | | |
1316 | | const Color& |
1317 | | StyleSettings::GetListBoxWindowHighlightColor() const |
1318 | 0 | { |
1319 | 0 | return mxData->maColors.maListBoxWindowHighlightColor; |
1320 | 0 | } |
1321 | | |
1322 | | void |
1323 | | StyleSettings::SetListBoxWindowHighlightTextColor( const Color& rColor ) |
1324 | 0 | { |
1325 | 0 | mxData->maColors.maListBoxWindowHighlightTextColor = rColor; |
1326 | 0 | } |
1327 | | |
1328 | | const Color& |
1329 | | StyleSettings::GetListBoxWindowHighlightTextColor() const |
1330 | 0 | { |
1331 | 0 | return mxData->maColors.maListBoxWindowHighlightTextColor; |
1332 | 0 | } |
1333 | | |
1334 | | void |
1335 | | StyleSettings::SetTabTextColor( const Color& rColor ) |
1336 | 0 | { |
1337 | 0 | mxData->maColors.maTabTextColor = rColor; |
1338 | 0 | } |
1339 | | |
1340 | | const Color& |
1341 | | StyleSettings::GetTabTextColor() const |
1342 | 0 | { |
1343 | 0 | return mxData->maColors.maTabTextColor; |
1344 | 0 | } |
1345 | | |
1346 | | void |
1347 | | StyleSettings::SetTabRolloverTextColor( const Color& rColor ) |
1348 | 0 | { |
1349 | 0 | mxData->maColors.maTabRolloverTextColor = rColor; |
1350 | 0 | } |
1351 | | |
1352 | | const Color& |
1353 | | StyleSettings::GetTabRolloverTextColor() const |
1354 | 0 | { |
1355 | 0 | return mxData->maColors.maTabRolloverTextColor; |
1356 | 0 | } |
1357 | | |
1358 | | void |
1359 | | StyleSettings::SetTabHighlightTextColor( const Color& rColor ) |
1360 | 0 | { |
1361 | 0 | mxData->maColors.maTabHighlightTextColor = rColor; |
1362 | 0 | } |
1363 | | |
1364 | | const Color& |
1365 | | StyleSettings::GetTabHighlightTextColor() const |
1366 | 0 | { |
1367 | 0 | return mxData->maColors.maTabHighlightTextColor; |
1368 | 0 | } |
1369 | | |
1370 | | void |
1371 | | StyleSettings::SetLinkColor( const Color& rColor ) |
1372 | 0 | { |
1373 | 0 | mxData->maColors.maLinkColor = rColor; |
1374 | 0 | } |
1375 | | |
1376 | | const Color& |
1377 | | StyleSettings::GetLinkColor() const |
1378 | 0 | { |
1379 | 0 | return mxData->maColors.maLinkColor; |
1380 | 0 | } |
1381 | | |
1382 | | void |
1383 | | StyleSettings::SetVisitedLinkColor( const Color& rColor ) |
1384 | 0 | { |
1385 | 0 | mxData->maColors.maVisitedLinkColor = rColor; |
1386 | 0 | } |
1387 | | |
1388 | | const Color& |
1389 | | StyleSettings::GetVisitedLinkColor() const |
1390 | 0 | { |
1391 | 0 | return mxData->maColors.maVisitedLinkColor; |
1392 | 0 | } |
1393 | | |
1394 | | void |
1395 | | StyleSettings::SetToolTextColor( const Color& rColor ) |
1396 | 0 | { |
1397 | 0 | mxData->maColors.maToolTextColor = rColor; |
1398 | 0 | } |
1399 | | |
1400 | | const Color& |
1401 | | StyleSettings::GetToolTextColor() const |
1402 | 0 | { |
1403 | 0 | return mxData->maColors.maToolTextColor; |
1404 | 0 | } |
1405 | | |
1406 | | void |
1407 | | StyleSettings::SetMonoColor( const Color& rColor ) |
1408 | 0 | { |
1409 | 0 | mxData->maColors.maMonoColor = rColor; |
1410 | 0 | } |
1411 | | |
1412 | | const Color& |
1413 | | StyleSettings::GetMonoColor() const |
1414 | 0 | { |
1415 | 0 | return mxData->maColors.maMonoColor; |
1416 | 0 | } |
1417 | | |
1418 | | void |
1419 | | StyleSettings::SetActiveTabColor( const Color& rColor ) |
1420 | 0 | { |
1421 | 0 | mxData->maColors.maActiveTabColor = rColor; |
1422 | 0 | } |
1423 | | |
1424 | | const Color& |
1425 | | StyleSettings::GetActiveTabColor() const |
1426 | 0 | { |
1427 | 0 | return mxData->maColors.maActiveTabColor; |
1428 | 0 | } |
1429 | | |
1430 | | void |
1431 | | StyleSettings::SetInactiveTabColor( const Color& rColor ) |
1432 | 0 | { |
1433 | 0 | mxData->maColors.maInactiveTabColor = rColor; |
1434 | 0 | } |
1435 | | |
1436 | | const Color& |
1437 | | StyleSettings::GetInactiveTabColor() const |
1438 | 0 | { |
1439 | 0 | return mxData->maColors.maInactiveTabColor; |
1440 | 0 | } |
1441 | | |
1442 | | void StyleSettings::SetAlternatingRowColor(const Color& rColor) |
1443 | 0 | { |
1444 | 0 | mxData->maColors.maAlternatingRowColor = rColor; |
1445 | 0 | } |
1446 | | |
1447 | | void |
1448 | | StyleSettings::SetUseSystemUIFonts( bool bUseSystemUIFonts ) |
1449 | 0 | { |
1450 | 0 | mxData->mbUseSystemUIFonts = bUseSystemUIFonts; |
1451 | 0 | } |
1452 | | |
1453 | | bool |
1454 | | StyleSettings::GetUseSystemUIFonts() const |
1455 | 0 | { |
1456 | 0 | return mxData->mbUseSystemUIFonts; |
1457 | 0 | } |
1458 | | |
1459 | | void StyleSettings::SetUseFontAAFromSystem(bool bUseFontAAFromSystem) |
1460 | 0 | { |
1461 | 0 | mxData->mbUseFontAAFromSystem = bUseFontAAFromSystem; |
1462 | 0 | } |
1463 | | |
1464 | | bool StyleSettings::GetUseFontAAFromSystem() const |
1465 | 2.40k | { |
1466 | 2.40k | return mxData->mbUseFontAAFromSystem; |
1467 | 2.40k | } |
1468 | | |
1469 | | void StyleSettings::SetUseSubpixelAA(bool val) |
1470 | 556 | { |
1471 | 556 | mxData->mbUseSubpixelAA = val; |
1472 | 556 | } |
1473 | | |
1474 | | bool StyleSettings::GetUseSubpixelAA() const |
1475 | 278 | { |
1476 | 278 | return mxData->mbUseSubpixelAA; |
1477 | 278 | } |
1478 | | |
1479 | | void |
1480 | | StyleSettings::SetUseFlatBorders( bool bUseFlatBorders ) |
1481 | 0 | { |
1482 | 0 | mxData->mnUseFlatBorders = bUseFlatBorders; |
1483 | 0 | } |
1484 | | |
1485 | | bool |
1486 | | StyleSettings::GetUseFlatBorders() const |
1487 | 8.28k | { |
1488 | 8.28k | return mxData->mnUseFlatBorders; |
1489 | 8.28k | } |
1490 | | |
1491 | | void |
1492 | | StyleSettings::SetUseFlatMenus( bool bUseFlatMenus ) |
1493 | 0 | { |
1494 | 0 | mxData->mnUseFlatMenus = bUseFlatMenus; |
1495 | 0 | } |
1496 | | |
1497 | | bool |
1498 | | StyleSettings::GetUseFlatMenus() const |
1499 | 0 | { |
1500 | 0 | return mxData->mnUseFlatMenus; |
1501 | 0 | } |
1502 | | |
1503 | | void |
1504 | | StyleSettings::SetUseImagesInMenus( TriState eUseImagesInMenus ) |
1505 | 0 | { |
1506 | 0 | mxData->meUseImagesInMenus = eUseImagesInMenus; |
1507 | 0 | } |
1508 | | |
1509 | | void |
1510 | | StyleSettings::SetPreferredUseImagesInMenus( bool bPreferredUseImagesInMenus ) |
1511 | 0 | { |
1512 | 0 | mxData->mbPreferredUseImagesInMenus = bPreferredUseImagesInMenus; |
1513 | 0 | } |
1514 | | |
1515 | | bool |
1516 | | StyleSettings::GetPreferredUseImagesInMenus() const |
1517 | 0 | { |
1518 | 0 | return mxData->mbPreferredUseImagesInMenus; |
1519 | 0 | } |
1520 | | |
1521 | | void |
1522 | | StyleSettings::SetSkipDisabledInMenus( bool bSkipDisabledInMenus ) |
1523 | 0 | { |
1524 | 0 | mxData->mbSkipDisabledInMenus = bSkipDisabledInMenus; |
1525 | 0 | } |
1526 | | |
1527 | | bool |
1528 | | StyleSettings::GetSkipDisabledInMenus() const |
1529 | 0 | { |
1530 | 0 | return mxData->mbSkipDisabledInMenus; |
1531 | 0 | } |
1532 | | |
1533 | | void |
1534 | | StyleSettings::SetHideDisabledMenuItems( bool bHideDisabledMenuItems ) |
1535 | 0 | { |
1536 | 0 | mxData->mbHideDisabledMenuItems = bHideDisabledMenuItems; |
1537 | 0 | } |
1538 | | |
1539 | | bool |
1540 | | StyleSettings::GetHideDisabledMenuItems() const |
1541 | 0 | { |
1542 | 0 | return mxData->mbHideDisabledMenuItems; |
1543 | 0 | } |
1544 | | |
1545 | | void |
1546 | | StyleSettings::SetContextMenuShortcuts( TriState eContextMenuShortcuts ) |
1547 | 0 | { |
1548 | 0 | mxData->meContextMenuShortcuts = eContextMenuShortcuts; |
1549 | 0 | } |
1550 | | |
1551 | | bool |
1552 | | StyleSettings::GetContextMenuShortcuts() const |
1553 | 0 | { |
1554 | 0 | switch (mxData->meContextMenuShortcuts) |
1555 | 0 | { |
1556 | 0 | case TRISTATE_FALSE: |
1557 | 0 | return false; |
1558 | 0 | case TRISTATE_TRUE: |
1559 | 0 | return true; |
1560 | 0 | default: // TRISTATE_INDET: |
1561 | 0 | return GetPreferredContextMenuShortcuts(); |
1562 | 0 | } |
1563 | 0 | } |
1564 | | |
1565 | | void |
1566 | | StyleSettings::SetPreferredContextMenuShortcuts( bool bContextMenuShortcuts ) |
1567 | 0 | { |
1568 | 0 | mxData->mbPreferredContextMenuShortcuts = bContextMenuShortcuts; |
1569 | 0 | } |
1570 | | |
1571 | | bool |
1572 | | StyleSettings::GetPreferredContextMenuShortcuts() const |
1573 | 0 | { |
1574 | 0 | return mxData->mbPreferredContextMenuShortcuts; |
1575 | 0 | } |
1576 | | |
1577 | | void |
1578 | | StyleSettings::SetPrimaryButtonWarpsSlider( bool bPrimaryButtonWarpsSlider ) |
1579 | 0 | { |
1580 | 0 | mxData->mbPrimaryButtonWarpsSlider = bPrimaryButtonWarpsSlider; |
1581 | 0 | } |
1582 | | |
1583 | | bool |
1584 | | StyleSettings::GetPrimaryButtonWarpsSlider() const |
1585 | 0 | { |
1586 | 0 | return mxData->mbPrimaryButtonWarpsSlider; |
1587 | 0 | } |
1588 | | |
1589 | | void |
1590 | | StyleSettings::SetAppFont( const vcl::Font& rFont ) |
1591 | 2 | { |
1592 | 2 | mxData->maFonts.maAppFont = rFont; |
1593 | 2 | } |
1594 | | |
1595 | | const vcl::Font& |
1596 | | StyleSettings::GetAppFont() const |
1597 | 4 | { |
1598 | 4 | return mxData->maFonts.maAppFont; |
1599 | 4 | } |
1600 | | |
1601 | | void |
1602 | | StyleSettings::SetHelpFont( const vcl::Font& rFont ) |
1603 | 0 | { |
1604 | 0 | mxData->maFonts.maHelpFont = rFont; |
1605 | 0 | } |
1606 | | |
1607 | | const vcl::Font& |
1608 | | StyleSettings::GetHelpFont() const |
1609 | 0 | { |
1610 | 0 | return mxData->maFonts.maHelpFont; |
1611 | 0 | } |
1612 | | |
1613 | | void |
1614 | | StyleSettings::SetTitleFont( const vcl::Font& rFont ) |
1615 | 2 | { |
1616 | 2 | mxData->maFonts.maTitleFont = rFont; |
1617 | 2 | } |
1618 | | |
1619 | | const vcl::Font& |
1620 | | StyleSettings::GetTitleFont() const |
1621 | 2 | { |
1622 | 2 | return mxData->maFonts.maTitleFont; |
1623 | 2 | } |
1624 | | |
1625 | | void |
1626 | | StyleSettings::SetFloatTitleFont( const vcl::Font& rFont ) |
1627 | 2 | { |
1628 | 2 | mxData->maFonts.maFloatTitleFont = rFont; |
1629 | 2 | } |
1630 | | |
1631 | | const vcl::Font& |
1632 | | StyleSettings::GetFloatTitleFont() const |
1633 | 2 | { |
1634 | 2 | return mxData->maFonts.maFloatTitleFont; |
1635 | 2 | } |
1636 | | |
1637 | | void |
1638 | | StyleSettings::SetMenuFont( const vcl::Font& rFont ) |
1639 | 0 | { |
1640 | 0 | mxData->maFonts.maMenuFont = rFont; |
1641 | 0 | } |
1642 | | |
1643 | | const vcl::Font& |
1644 | | StyleSettings::GetMenuFont() const |
1645 | 2 | { |
1646 | 2 | return mxData->maFonts.maMenuFont; |
1647 | 2 | } |
1648 | | |
1649 | | void |
1650 | | StyleSettings::SetToolFont( const vcl::Font& rFont ) |
1651 | 2 | { |
1652 | 2 | mxData->maFonts.maToolFont = rFont; |
1653 | 2 | } |
1654 | | |
1655 | | const vcl::Font& |
1656 | | StyleSettings::GetToolFont() const |
1657 | 16.7k | { |
1658 | 16.7k | return mxData->maFonts.maToolFont; |
1659 | 16.7k | } |
1660 | | |
1661 | | void |
1662 | | StyleSettings::SetGroupFont( const vcl::Font& rFont ) |
1663 | 2 | { |
1664 | 2 | mxData->maFonts.maGroupFont = rFont; |
1665 | 2 | } |
1666 | | |
1667 | | const vcl::Font& |
1668 | | StyleSettings::GetGroupFont() const |
1669 | 2 | { |
1670 | 2 | return mxData->maFonts.maGroupFont; |
1671 | 2 | } |
1672 | | |
1673 | | void |
1674 | | StyleSettings::SetLabelFont( const vcl::Font& rFont ) |
1675 | 2 | { |
1676 | 2 | mxData->maFonts.maLabelFont = rFont; |
1677 | 2 | } |
1678 | | |
1679 | | const vcl::Font& |
1680 | | StyleSettings::GetLabelFont() const |
1681 | 2 | { |
1682 | 2 | return mxData->maFonts.maLabelFont; |
1683 | 2 | } |
1684 | | |
1685 | | void |
1686 | | StyleSettings::SetRadioCheckFont( const vcl::Font& rFont ) |
1687 | 2 | { |
1688 | 2 | mxData->maFonts.maRadioCheckFont = rFont; |
1689 | 2 | } |
1690 | | |
1691 | | const vcl::Font& |
1692 | | StyleSettings::GetRadioCheckFont() const |
1693 | 2 | { |
1694 | 2 | return mxData->maFonts.maRadioCheckFont; |
1695 | 2 | } |
1696 | | |
1697 | | void |
1698 | | StyleSettings::SetPushButtonFont( const vcl::Font& rFont ) |
1699 | 2 | { |
1700 | 2 | mxData->maFonts.maPushButtonFont = rFont; |
1701 | 2 | } |
1702 | | |
1703 | | const vcl::Font& |
1704 | | StyleSettings::GetPushButtonFont() const |
1705 | 2 | { |
1706 | 2 | return mxData->maFonts.maPushButtonFont; |
1707 | 2 | } |
1708 | | |
1709 | | void |
1710 | | StyleSettings::SetFieldFont( const vcl::Font& rFont ) |
1711 | 2 | { |
1712 | 2 | mxData->maFonts.maFieldFont = rFont; |
1713 | 2 | } |
1714 | | |
1715 | | const vcl::Font& |
1716 | | StyleSettings::GetFieldFont() const |
1717 | 2 | { |
1718 | 2 | return mxData->maFonts.maFieldFont; |
1719 | 2 | } |
1720 | | |
1721 | | void |
1722 | | StyleSettings::SetIconFont( const vcl::Font& rFont ) |
1723 | 2 | { |
1724 | 2 | mxData->maFonts.maIconFont = rFont; |
1725 | 2 | } |
1726 | | |
1727 | | const vcl::Font& |
1728 | | StyleSettings::GetIconFont() const |
1729 | 2 | { |
1730 | 2 | return mxData->maFonts.maIconFont; |
1731 | 2 | } |
1732 | | |
1733 | | void |
1734 | | StyleSettings::SetTabFont( const vcl::Font& rFont ) |
1735 | 2 | { |
1736 | 2 | mxData->maFonts.maTabFont = rFont; |
1737 | 2 | } |
1738 | | |
1739 | | const vcl::Font& |
1740 | | StyleSettings::GetTabFont() const |
1741 | 2 | { |
1742 | 2 | return mxData->maFonts.maTabFont; |
1743 | 2 | } |
1744 | | |
1745 | | sal_Int32 |
1746 | | StyleSettings::GetBorderSize() |
1747 | 0 | { |
1748 | 0 | return 1; |
1749 | 0 | } |
1750 | | |
1751 | | void |
1752 | | StyleSettings::SetTitleHeight( sal_Int32 nSize ) |
1753 | 0 | { |
1754 | 0 | mxData->mnTitleHeight = nSize; |
1755 | 0 | } |
1756 | | |
1757 | | sal_Int32 |
1758 | | StyleSettings::GetTitleHeight() const |
1759 | 0 | { |
1760 | 0 | return mxData->mnTitleHeight; |
1761 | 0 | } |
1762 | | |
1763 | | void |
1764 | | StyleSettings::SetFloatTitleHeight( sal_Int32 nSize ) |
1765 | 0 | { |
1766 | 0 | mxData->mnFloatTitleHeight = nSize; |
1767 | 0 | } |
1768 | | |
1769 | | sal_Int32 |
1770 | | StyleSettings::GetFloatTitleHeight() const |
1771 | 0 | { |
1772 | 0 | return mxData->mnFloatTitleHeight; |
1773 | 0 | } |
1774 | | |
1775 | | void |
1776 | | StyleSettings::SetScrollBarSize( sal_Int32 nSize ) |
1777 | 0 | { |
1778 | 0 | mxData->mnScrollBarSize = nSize; |
1779 | 0 | } |
1780 | | |
1781 | | sal_Int32 |
1782 | | StyleSettings::GetScrollBarSize() const |
1783 | 0 | { |
1784 | 0 | return mxData->mnScrollBarSize; |
1785 | 0 | } |
1786 | | |
1787 | | void |
1788 | | StyleSettings::SetMinThumbSize( sal_Int32 nSize ) |
1789 | 0 | { |
1790 | 0 | mxData->mnMinThumbSize = nSize; |
1791 | 0 | } |
1792 | | |
1793 | | sal_Int32 |
1794 | | StyleSettings::GetMinThumbSize() const |
1795 | 0 | { |
1796 | 0 | return mxData->mnMinThumbSize; |
1797 | 0 | } |
1798 | | |
1799 | | void |
1800 | | StyleSettings::SetSpinSize( sal_Int32 nSize ) |
1801 | 0 | { |
1802 | 0 | mxData->mnSpinSize = nSize; |
1803 | 0 | } |
1804 | | |
1805 | | sal_Int32 |
1806 | | StyleSettings::GetSpinSize() const |
1807 | 0 | { |
1808 | 0 | return mxData->mnSpinSize; |
1809 | 0 | } |
1810 | | |
1811 | | sal_Int32 |
1812 | | StyleSettings::GetSplitSize() |
1813 | 0 | { |
1814 | 0 | return 3; |
1815 | 0 | } |
1816 | | |
1817 | | void |
1818 | | StyleSettings::SetCursorSize( sal_Int32 nSize ) |
1819 | 0 | { |
1820 | 0 | mxData->mnCursorSize = nSize; |
1821 | 0 | } |
1822 | | |
1823 | | sal_Int32 |
1824 | | StyleSettings::GetCursorSize() const |
1825 | 46 | { |
1826 | 46 | return mxData->mnCursorSize; |
1827 | 46 | } |
1828 | | |
1829 | | void |
1830 | | StyleSettings::SetCursorBlinkTime( sal_uInt64 nBlinkTime ) |
1831 | 41.1k | { |
1832 | 41.1k | mxData->mnCursorBlinkTime = nBlinkTime; |
1833 | 41.1k | } |
1834 | | |
1835 | | sal_uInt64 |
1836 | | StyleSettings::GetCursorBlinkTime() const |
1837 | 82.2k | { |
1838 | 82.2k | return mxData->mnCursorBlinkTime; |
1839 | 82.2k | } |
1840 | | |
1841 | | void |
1842 | | StyleSettings::SetDragFullOptions( DragFullOptions nOptions ) |
1843 | 0 | { |
1844 | 0 | mxData->mnDragFullOptions = nOptions; |
1845 | 0 | } |
1846 | | |
1847 | | DragFullOptions |
1848 | | StyleSettings::GetDragFullOptions() const |
1849 | 0 | { |
1850 | 0 | return mxData->mnDragFullOptions; |
1851 | 0 | } |
1852 | | |
1853 | | void |
1854 | | StyleSettings::SetSelectionOptions( SelectionOptions nOptions ) |
1855 | 0 | { |
1856 | 0 | mxData->mnSelectionOptions = nOptions; |
1857 | 0 | } |
1858 | | |
1859 | | SelectionOptions |
1860 | | StyleSettings::GetSelectionOptions() const |
1861 | 0 | { |
1862 | 0 | return mxData->mnSelectionOptions; |
1863 | 0 | } |
1864 | | |
1865 | | void |
1866 | | StyleSettings::SetDisplayOptions( DisplayOptions nOptions ) |
1867 | 0 | { |
1868 | 0 | mxData->mnDisplayOptions = nOptions; |
1869 | 0 | } |
1870 | | |
1871 | | DisplayOptions |
1872 | | StyleSettings::GetDisplayOptions() const |
1873 | 0 | { |
1874 | 0 | return mxData->mnDisplayOptions; |
1875 | 0 | } |
1876 | | |
1877 | | void |
1878 | | StyleSettings::SetAntialiasingMinPixelHeight( sal_Int32 nMinPixel ) |
1879 | 0 | { |
1880 | 0 | mxData->mnAntialiasedMin = nMinPixel; |
1881 | 0 | } |
1882 | | |
1883 | | sal_Int32 |
1884 | | StyleSettings::GetAntialiasingMinPixelHeight() const |
1885 | 0 | { |
1886 | 0 | return mxData->mnAntialiasedMin; |
1887 | 0 | } |
1888 | | |
1889 | | void |
1890 | | StyleSettings::SetOptions( StyleSettingsOptions nOptions ) |
1891 | 0 | { |
1892 | 0 | mxData->mnOptions = nOptions; |
1893 | 0 | } |
1894 | | |
1895 | | void |
1896 | | StyleSettings::SetAutoMnemonic( bool bAutoMnemonic ) |
1897 | 0 | { |
1898 | 0 | mxData->mbAutoMnemonic = bAutoMnemonic; |
1899 | 0 | } |
1900 | | |
1901 | | bool |
1902 | | StyleSettings::GetAutoMnemonic() const |
1903 | 0 | { |
1904 | 0 | return mxData->mbAutoMnemonic; |
1905 | 0 | } |
1906 | | |
1907 | | bool |
1908 | | StyleSettings::GetDockingFloatsSupported() |
1909 | 0 | { |
1910 | 0 | ImplSVData* pSVData = ImplGetSVData(); |
1911 | 0 | return pSVData->maNWFData.mbCanDetermineWindowPosition; |
1912 | 0 | } |
1913 | | |
1914 | | void |
1915 | | StyleSettings::SetToolbarIconSize( ToolbarIconSize nSize ) |
1916 | 0 | { |
1917 | 0 | mxData->mnToolbarIconSize = nSize; |
1918 | 0 | } |
1919 | | |
1920 | | ToolbarIconSize |
1921 | | StyleSettings::GetToolbarIconSize() const |
1922 | 0 | { |
1923 | 0 | return mxData->mnToolbarIconSize; |
1924 | 0 | } |
1925 | | |
1926 | | const DialogStyle& |
1927 | | StyleSettings::GetDialogStyle() const |
1928 | 0 | { |
1929 | 0 | return mxData->maDialogStyle; |
1930 | 0 | } |
1931 | | |
1932 | | static Bitmap readBitmap(const OUString& rPath) |
1933 | 0 | { |
1934 | 0 | OUString aPath(rPath); |
1935 | 0 | rtl::Bootstrap::expandMacros(aPath); |
1936 | | |
1937 | | // import the image |
1938 | 0 | Graphic aGraphic; |
1939 | 0 | if (GraphicFilter::LoadGraphic(aPath, OUString(), aGraphic) != ERRCODE_NONE) |
1940 | 0 | return Bitmap(); |
1941 | 0 | return aGraphic.GetBitmap(); |
1942 | 0 | } |
1943 | | |
1944 | | static void setupAppBackgroundBitmap(OUString& rAppBackBitmapFileName, Bitmap& rAppBackBitmap) |
1945 | 0 | { |
1946 | 0 | if (Application::IsHeadlessModeEnabled() || !ThemeColors::UseBmpForAppBack()) |
1947 | 0 | return; |
1948 | | |
1949 | 0 | OUString sAppBackgroundBitmap = ThemeColors::GetAppBackBmpFileName(); |
1950 | 0 | if (rAppBackBitmapFileName == sAppBackgroundBitmap) |
1951 | 0 | return; |
1952 | | |
1953 | 0 | rAppBackBitmapFileName = sAppBackgroundBitmap; |
1954 | |
|
1955 | 0 | if (!rAppBackBitmapFileName.isEmpty()) |
1956 | 0 | { |
1957 | 0 | rAppBackBitmap = readBitmap("$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER "/gallery/backgrounds/" |
1958 | 0 | + rAppBackBitmapFileName); |
1959 | 0 | } |
1960 | |
|
1961 | 0 | if (rAppBackBitmap.IsEmpty()) |
1962 | 0 | { |
1963 | 0 | SAL_WARN("vcl.app", "Failed to load AppBackground bitmap file: " << rAppBackBitmapFileName); |
1964 | 0 | ThemeColors::SetUseBmpForAppBack(false); |
1965 | 0 | } |
1966 | 0 | } |
1967 | | |
1968 | | Bitmap const& StyleSettings::GetAppBackgroundBitmap() const |
1969 | 0 | { |
1970 | 0 | setupAppBackgroundBitmap(mxData->maAppBackgroundBitmapFileName, mxData->maAppBackgroundBitmap); |
1971 | 0 | return mxData->maAppBackgroundBitmap; |
1972 | 0 | } |
1973 | | |
1974 | | void |
1975 | | StyleSettings::SetEdgeBlending(sal_uInt16 nCount) |
1976 | 0 | { |
1977 | 0 | mxData->mnEdgeBlending = nCount; |
1978 | 0 | } |
1979 | | |
1980 | | sal_uInt16 |
1981 | | StyleSettings::GetEdgeBlending() const |
1982 | 0 | { |
1983 | 0 | return mxData->mnEdgeBlending; |
1984 | 0 | } |
1985 | | |
1986 | | const Color& |
1987 | | StyleSettings::GetEdgeBlendingTopLeftColor() const |
1988 | 0 | { |
1989 | 0 | return mxData->maEdgeBlendingTopLeftColor; |
1990 | 0 | } |
1991 | | |
1992 | | const Color& |
1993 | | StyleSettings::GetEdgeBlendingBottomRightColor() const |
1994 | 0 | { |
1995 | 0 | return mxData->maEdgeBlendingBottomRightColor; |
1996 | 0 | } |
1997 | | |
1998 | | void |
1999 | | StyleSettings::SetListBoxMaximumLineCount(sal_uInt16 nCount) |
2000 | 0 | { |
2001 | 0 | mxData->mnListBoxMaximumLineCount = nCount; |
2002 | 0 | } |
2003 | | |
2004 | | sal_uInt16 |
2005 | | StyleSettings::GetListBoxMaximumLineCount() const |
2006 | 0 | { |
2007 | 0 | return mxData->mnListBoxMaximumLineCount; |
2008 | 0 | } |
2009 | | |
2010 | | void |
2011 | | StyleSettings::SetColorValueSetColumnCount(sal_uInt16 nCount) |
2012 | 0 | { |
2013 | 0 | mxData->mnColorValueSetColumnCount = nCount; |
2014 | 0 | } |
2015 | | |
2016 | | sal_uInt16 |
2017 | | StyleSettings::GetColorValueSetColumnCount() const |
2018 | 0 | { |
2019 | 0 | return mxData->mnColorValueSetColumnCount; |
2020 | 0 | } |
2021 | | |
2022 | | sal_uInt16 |
2023 | | StyleSettings::GetListBoxPreviewDefaultLineWidth() |
2024 | 0 | { |
2025 | 0 | return 1; |
2026 | 0 | } |
2027 | | |
2028 | | void StyleSettings::SetComboBoxTextSelectionMode( |
2029 | | ComboBoxTextSelectionMode eMode) |
2030 | 0 | { |
2031 | 0 | mxData->meComboBoxTextSelectionMode = eMode; |
2032 | 0 | } |
2033 | | |
2034 | | ComboBoxTextSelectionMode StyleSettings::GetComboBoxTextSelectionMode() const |
2035 | 0 | { |
2036 | 0 | return mxData->meComboBoxTextSelectionMode; |
2037 | 0 | } |
2038 | | |
2039 | | void |
2040 | | StyleSettings::SetPreviewUsesCheckeredBackground(bool bNew) |
2041 | 0 | { |
2042 | 0 | mxData->mbPreviewUsesCheckeredBackground = bNew; |
2043 | 0 | } |
2044 | | |
2045 | | bool |
2046 | | StyleSettings::GetPreviewUsesCheckeredBackground() const |
2047 | 0 | { |
2048 | 0 | return mxData->mbPreviewUsesCheckeredBackground; |
2049 | 0 | } |
2050 | | |
2051 | | void StyleSettings::SetListBoxPreviewDefaultLogicSize(Size const& rSize) |
2052 | 0 | { |
2053 | 0 | auto* myData = mxData.get(); |
2054 | 0 | myData->maListBoxPreviewDefaultLogicSize = rSize; |
2055 | 0 | mxData->maListBoxPreviewDefaultPixelSize = {}; // recalc |
2056 | 0 | } |
2057 | | |
2058 | | const Size& StyleSettings::GetListBoxPreviewDefaultPixelSize() const |
2059 | 0 | { |
2060 | 0 | if(0 == mxData->maListBoxPreviewDefaultPixelSize.Width() || 0 == mxData->maListBoxPreviewDefaultPixelSize.Height()) |
2061 | 0 | { |
2062 | 0 | mxData->maListBoxPreviewDefaultPixelSize = |
2063 | 0 | Application::GetDefaultDevice()->LogicToPixel(mxData->maListBoxPreviewDefaultLogicSize, MapMode(MapUnit::MapAppFont)); |
2064 | 0 | } |
2065 | |
|
2066 | 0 | return mxData->maListBoxPreviewDefaultPixelSize; |
2067 | 0 | } |
2068 | | |
2069 | | void StyleSettings::Set3DColors( const Color& rColor ) |
2070 | 2 | { |
2071 | 2 | auto* myData = mxData.get(); |
2072 | 2 | myData->maColors.maFaceColor = rColor; |
2073 | 2 | myData->maColors.maLightBorderColor = rColor; |
2074 | 2 | myData->maColors.maMenuBorderColor = rColor; |
2075 | 2 | myData->maColors.maDarkShadowColor = COL_BLACK; |
2076 | 2 | if ( rColor != COL_LIGHTGRAY ) |
2077 | 2 | { |
2078 | 2 | myData->maColors.maLightColor = rColor; |
2079 | 2 | myData->maColors.maShadowColor = rColor; |
2080 | 2 | myData->maColors.maDarkShadowColor = rColor; |
2081 | | |
2082 | 2 | if (!rColor.IsDark()) |
2083 | 2 | { |
2084 | 2 | myData->maColors.maLightColor.IncreaseLuminance(64); |
2085 | 2 | myData->maColors.maShadowColor.DecreaseLuminance(64); |
2086 | 2 | myData->maColors.maDarkShadowColor.DecreaseLuminance(100); |
2087 | 2 | } |
2088 | 0 | else |
2089 | 0 | { |
2090 | 0 | myData->maColors.maLightColor.DecreaseLuminance(64); |
2091 | 0 | myData->maColors.maShadowColor.IncreaseLuminance(64); |
2092 | 0 | myData->maColors.maDarkShadowColor.IncreaseLuminance(100); |
2093 | 0 | } |
2094 | | |
2095 | 2 | sal_uInt8 nRed = (myData->maColors.maLightColor.GetRed() + myData->maColors.maShadowColor.GetRed()) / 2; |
2096 | 2 | sal_uInt8 nGreen = (myData->maColors.maLightColor.GetGreen() + myData->maColors.maShadowColor.GetGreen()) / 2; |
2097 | 2 | sal_uInt8 nBlue = (myData->maColors.maLightColor.GetBlue() + myData->maColors.maShadowColor.GetBlue()) / 2; |
2098 | 2 | myData->maColors.maCheckedColor = Color(nRed, nGreen, nBlue); |
2099 | 2 | } |
2100 | 0 | else |
2101 | 0 | { |
2102 | 0 | myData->maColors.maCheckedColor = Color( 0x99, 0x99, 0x99 ); |
2103 | 0 | myData->maColors.maLightColor = COL_WHITE; |
2104 | 0 | myData->maColors.maShadowColor = COL_GRAY; |
2105 | 0 | } |
2106 | 2 | } |
2107 | | |
2108 | | void StyleSettings::SetCheckedColorSpecialCase( ) |
2109 | 0 | { |
2110 | 0 | auto* myData = mxData.get(); |
2111 | | // Light gray checked color special case |
2112 | 0 | if ( GetFaceColor() == COL_LIGHTGRAY ) |
2113 | 0 | myData->maColors.maCheckedColor = Color(0xCC, 0xCC, 0xCC); |
2114 | 0 | else |
2115 | 0 | { |
2116 | 0 | sal_uInt8 nRed = static_cast<sal_uInt8>((static_cast<sal_uInt16>(myData->maColors.maFaceColor.GetRed()) + static_cast<sal_uInt16>(myData->maColors.maLightColor.GetRed()))/2); |
2117 | 0 | sal_uInt8 nGreen = static_cast<sal_uInt8>((static_cast<sal_uInt16>(myData->maColors.maFaceColor.GetGreen()) + static_cast<sal_uInt16>(myData->maColors.maLightColor.GetGreen()))/2); |
2118 | 0 | sal_uInt8 nBlue = static_cast<sal_uInt8>((static_cast<sal_uInt16>(myData->maColors.maFaceColor.GetBlue()) + static_cast<sal_uInt16>(myData->maColors.maLightColor.GetBlue()))/2); |
2119 | 0 | myData->maColors.maCheckedColor = Color(nRed, nGreen, nBlue); |
2120 | 0 | } |
2121 | 0 | } |
2122 | | |
2123 | | bool StyleSettings::GetUseImagesInMenus() const |
2124 | 0 | { |
2125 | | // icon mode selected in Tools -> Options... -> OpenOffice.org -> View |
2126 | 0 | switch (mxData->meUseImagesInMenus) { |
2127 | 0 | case TRISTATE_FALSE: |
2128 | 0 | return false; |
2129 | 0 | case TRISTATE_TRUE: |
2130 | 0 | return true; |
2131 | 0 | default: // TRISTATE_INDET: |
2132 | 0 | return GetPreferredUseImagesInMenus(); |
2133 | 0 | } |
2134 | 0 | } |
2135 | | |
2136 | | void StyleSettings::SetStandardStyles() |
2137 | 4.14k | { |
2138 | 4.14k | mxData->SetStandardStyles(); |
2139 | 4.14k | } |
2140 | | |
2141 | | Color StyleSettings::GetFaceGradientColor() const |
2142 | 0 | { |
2143 | | // compute a brighter face color that can be used in gradients |
2144 | | // for a convex look (eg toolbars) |
2145 | |
|
2146 | 0 | sal_uInt16 h, s, b; |
2147 | 0 | GetFaceColor().RGBtoHSB( h, s, b ); |
2148 | 0 | if( s > 1) s=1; |
2149 | 0 | if( b < 98) b=98; |
2150 | 0 | return Color::HSBtoRGB( h, s, b ); |
2151 | 0 | } |
2152 | | |
2153 | | Color StyleSettings::GetSeparatorColor() const |
2154 | 0 | { |
2155 | | // compute a brighter shadow color for separators (used in toolbars or between menubar and toolbars on Windows XP) |
2156 | 0 | sal_uInt16 h, s, b; |
2157 | 0 | GetShadowColor().RGBtoHSB( h, s, b ); |
2158 | 0 | b += b/4; |
2159 | 0 | s -= s/4; |
2160 | 0 | return Color::HSBtoRGB( h, s, b ); |
2161 | 0 | } |
2162 | | |
2163 | | // Until Clang 14, P2085R0 is unsupported, and the operator can't be default outside of declaration |
2164 | | bool StyleSettings::operator ==( const StyleSettings& rSet ) const |
2165 | 41.1k | { |
2166 | 41.1k | return mxData == rSet.mxData; |
2167 | 41.1k | } |
2168 | | |
2169 | | bool ImplStyleData::operator==(const ImplStyleData& rSet) const |
2170 | 41.1k | { |
2171 | 41.1k | if (mIconTheme != rSet.mIconTheme) { |
2172 | 0 | return false; |
2173 | 0 | } |
2174 | | |
2175 | 41.1k | if (mIconThemeSelector != rSet.mIconThemeSelector) { |
2176 | 0 | return false; |
2177 | 0 | } |
2178 | | |
2179 | 41.1k | return (mnOptions == rSet.mnOptions) && |
2180 | 41.1k | (mbAutoMnemonic == rSet.mbAutoMnemonic) && |
2181 | 41.1k | (mnDragFullOptions == rSet.mnDragFullOptions) && |
2182 | 41.1k | (mnSelectionOptions == rSet.mnSelectionOptions) && |
2183 | 41.1k | (mnDisplayOptions == rSet.mnDisplayOptions) && |
2184 | 41.1k | (mnCursorSize == rSet.mnCursorSize) && |
2185 | 41.1k | (mnCursorBlinkTime == rSet.mnCursorBlinkTime) && |
2186 | 41.1k | (mnTitleHeight == rSet.mnTitleHeight) && |
2187 | 41.1k | (mnFloatTitleHeight == rSet.mnFloatTitleHeight) && |
2188 | 41.1k | (mnScrollBarSize == rSet.mnScrollBarSize) && |
2189 | 41.1k | (mnMinThumbSize == rSet.mnMinThumbSize) && |
2190 | 41.1k | (mnSpinSize == rSet.mnSpinSize) && |
2191 | 41.1k | (mnAntialiasedMin == rSet.mnAntialiasedMin) && |
2192 | 41.1k | (mbHighContrast == rSet.mbHighContrast) && |
2193 | 41.1k | (mbUseSystemUIFonts == rSet.mbUseSystemUIFonts) && |
2194 | 41.1k | (mbUseFontAAFromSystem == rSet.mbUseFontAAFromSystem) && |
2195 | 41.1k | (mbUseSubpixelAA == rSet.mbUseSubpixelAA) && |
2196 | 41.1k | (mnUseFlatBorders == rSet.mnUseFlatBorders) && |
2197 | 41.1k | (mnUseFlatMenus == rSet.mnUseFlatMenus) && |
2198 | 41.1k | (maColors == rSet.maColors) && |
2199 | 41.1k | (maFonts == rSet.maFonts) && |
2200 | 41.1k | (meUseImagesInMenus == rSet.meUseImagesInMenus) && |
2201 | 41.1k | (mbPreferredUseImagesInMenus == rSet.mbPreferredUseImagesInMenus) && |
2202 | 41.1k | (mbSkipDisabledInMenus == rSet.mbSkipDisabledInMenus) && |
2203 | 41.1k | (mbHideDisabledMenuItems == rSet.mbHideDisabledMenuItems) && |
2204 | 41.1k | (mbPreferredContextMenuShortcuts == rSet.mbPreferredContextMenuShortcuts) && |
2205 | 41.1k | (mbSystemColorsLoaded == rSet.mbSystemColorsLoaded) && |
2206 | 41.1k | (meContextMenuShortcuts == rSet.meContextMenuShortcuts) && |
2207 | 41.1k | (mbPrimaryButtonWarpsSlider == rSet.mbPrimaryButtonWarpsSlider) && |
2208 | 41.1k | (mnEdgeBlending == rSet.mnEdgeBlending) && |
2209 | 41.1k | (maEdgeBlendingTopLeftColor == rSet.maEdgeBlendingTopLeftColor) && |
2210 | 41.1k | (maEdgeBlendingBottomRightColor == rSet.maEdgeBlendingBottomRightColor) && |
2211 | 41.1k | (mnListBoxMaximumLineCount == rSet.mnListBoxMaximumLineCount) && |
2212 | 41.1k | (mnColorValueSetColumnCount == rSet.mnColorValueSetColumnCount) && |
2213 | 41.1k | (maListBoxPreviewDefaultLogicSize == rSet.maListBoxPreviewDefaultLogicSize) && |
2214 | 41.1k | (mbPreviewUsesCheckeredBackground == rSet.mbPreviewUsesCheckeredBackground) && |
2215 | 41.1k | (maAppBackgroundBitmapFileName == rSet.maAppBackgroundBitmapFileName) && |
2216 | 41.1k | (maAppBackgroundBitmap == rSet.maAppBackgroundBitmap); |
2217 | 41.1k | } |
2218 | | |
2219 | | ImplMiscData::ImplMiscData() : |
2220 | 82 | mnDisablePrinting(TRISTATE_INDET) |
2221 | 82 | { |
2222 | 82 | static const char* pEnv = getenv("SAL_DECIMALSEP_ENABLED" ); // set default without UI |
2223 | 82 | mbEnableLocalizedDecimalSep = (pEnv != nullptr); |
2224 | 82 | } |
2225 | | |
2226 | | MiscSettings::MiscSettings() |
2227 | 82 | : mxData(std::make_shared<ImplMiscData>()) |
2228 | 82 | { |
2229 | 82 | } |
2230 | | |
2231 | | bool MiscSettings::operator ==( const MiscSettings& rSet ) const |
2232 | 41.1k | { |
2233 | 41.1k | if ( mxData == rSet.mxData ) |
2234 | 41.1k | return true; |
2235 | | |
2236 | 0 | return (mxData->mnDisablePrinting == rSet.mxData->mnDisablePrinting ) && |
2237 | 0 | (mxData->mbEnableLocalizedDecimalSep == rSet.mxData->mbEnableLocalizedDecimalSep ); |
2238 | 41.1k | } |
2239 | | |
2240 | | bool |
2241 | | MiscSettings::operator !=( const MiscSettings& rSet ) const |
2242 | 41.1k | { |
2243 | 41.1k | return !(*this == rSet); |
2244 | 41.1k | } |
2245 | | |
2246 | | bool MiscSettings::GetDisablePrinting() const |
2247 | 0 | { |
2248 | 0 | if( mxData->mnDisablePrinting == TRISTATE_INDET ) |
2249 | 0 | { |
2250 | 0 | mxData->mnDisablePrinting = officecfg::VCL::VCLSettings::DesktopManagement::DisablePrinting::get() ? TRISTATE_TRUE : TRISTATE_FALSE; |
2251 | 0 | } |
2252 | |
|
2253 | 0 | return mxData->mnDisablePrinting != TRISTATE_FALSE; |
2254 | 0 | } |
2255 | | |
2256 | | bool MiscSettings::GetEnableATToolSupport() |
2257 | 0 | { |
2258 | 0 | static const char* pEnv = getenv("SAL_ACCESSIBILITY_ENABLED"); |
2259 | 0 | if (pEnv && *pEnv) |
2260 | 0 | return pEnv[0] != '0'; |
2261 | | |
2262 | 0 | ImplSVData* pSVData = ImplGetSVData(); |
2263 | 0 | return pSVData->mxAccessBridge.is(); |
2264 | 0 | } |
2265 | | |
2266 | | void MiscSettings::SetEnableLocalizedDecimalSep( bool bEnable ) |
2267 | 0 | { |
2268 | | // copy if other references exist |
2269 | 0 | if (mxData.use_count() > 1) |
2270 | 0 | { |
2271 | 0 | mxData = std::make_shared<ImplMiscData>(*mxData); |
2272 | 0 | } |
2273 | 0 | mxData->mbEnableLocalizedDecimalSep = bEnable; |
2274 | 0 | } |
2275 | | |
2276 | | bool MiscSettings::GetEnableLocalizedDecimalSep() const |
2277 | 0 | { |
2278 | 0 | return mxData->mbEnableLocalizedDecimalSep; |
2279 | 0 | } |
2280 | | |
2281 | | bool MiscSettings::GetUseDarkMode() |
2282 | 27.7k | { |
2283 | 27.7k | vcl::Window* pDefWindow = ImplGetDefaultWindow(); |
2284 | 27.7k | if (pDefWindow == nullptr) |
2285 | 0 | return false; |
2286 | 27.7k | return pDefWindow->ImplGetFrame()->GetUseDarkMode(); |
2287 | 27.7k | } |
2288 | | |
2289 | | AppearanceMode MiscSettings::GetAppColorMode() |
2290 | 27.7k | { |
2291 | 27.7k | if (comphelper::IsFuzzing()) |
2292 | 27.7k | return AppearanceMode::AUTO; |
2293 | | |
2294 | 0 | int nMode = officecfg::Office::Common::Appearance::ApplicationAppearance::get(); |
2295 | | |
2296 | | // check for invalid appearance mode, and if found, set it back to AUTO |
2297 | 0 | if (nMode < static_cast<int>(AppearanceMode::AUTO) |
2298 | 0 | || static_cast<int>(AppearanceMode::COUNT) <= nMode) |
2299 | 0 | { |
2300 | 0 | SAL_WARN("vcl.app", "invalid appearance mode! setting back to AppearanceMode::AUTO"); |
2301 | 0 | MiscSettings::SetAppColorMode(AppearanceMode::AUTO); |
2302 | 0 | return AppearanceMode::AUTO; |
2303 | 0 | } |
2304 | | |
2305 | 0 | return static_cast<AppearanceMode>(nMode); |
2306 | 0 | } |
2307 | | |
2308 | | void MiscSettings::SetAppColorMode(AppearanceMode eMode) |
2309 | 0 | { |
2310 | | // Partial: tdf#156855 update native and LibreOffice dark mode states |
2311 | | // Updating the dark mode state of everything all at once does not |
2312 | | // solve all failures to update colors when the light/dark mode |
2313 | | // changes, but it eliminates enough failures that the UI is now |
2314 | | // generally readable without restarting LibreOffice. |
2315 | | // Important: all of the following steps must be done. Otherwise, |
2316 | | // changing the macOS light/dark mode preference while LibreOffice |
2317 | | // is running will cause the color mode state change to fail. |
2318 | | |
2319 | | // 1. Save the new mode. |
2320 | 0 | std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create()); |
2321 | 0 | officecfg::Office::Common::Appearance::ApplicationAppearance::set(static_cast<int>(eMode), |
2322 | 0 | batch); |
2323 | 0 | batch->commit(); |
2324 | | |
2325 | | // 2. Force the native windows to update their dark mode state so |
2326 | | // that we can fetch the correct native colors. |
2327 | 0 | vcl::Window *pWin = Application::GetFirstTopLevelWindow(); |
2328 | 0 | while (pWin) |
2329 | 0 | { |
2330 | 0 | pWin->ImplGetFrame()->UpdateDarkMode(); |
2331 | 0 | pWin = Application::GetNextTopLevelWindow(pWin); |
2332 | 0 | } |
2333 | |
|
2334 | | #ifdef MACOSX |
2335 | | // 3. Reset the native colors in AllSettings. Note: the current theme |
2336 | | // is disabled during this step to stop SalFrame::UpdateSettings() |
2337 | | // from adding the current theme's colors which are still set to |
2338 | | // the previous light/dark mode's colors. |
2339 | | if (ThemeColors::IsThemeCached()) |
2340 | | ThemeColors::SetThemeCached(false); |
2341 | | AllSettings aSettings = Application::GetSettings(); |
2342 | | Application::MergeSystemSettings(aSettings); |
2343 | | Application *pApp = GetpApp(); |
2344 | | if (pApp) |
2345 | | pApp->OverrideSystemSettings(aSettings); |
2346 | | Application::SetSettings(aSettings); |
2347 | | |
2348 | | // 4. Force the current theme's ColorConfig to reload itself |
2349 | | // with the correct light/dark mode colors. It will also |
2350 | | // merge the native colors updated in the previous step. |
2351 | | DataChangedEvent aDCEvt(DataChangedEventType::SETTINGS); |
2352 | | Application::ImplCallEventListenersApplicationDataChanged(&aDCEvt); |
2353 | | Application::NotifyAllWindows(aDCEvt); |
2354 | | #else |
2355 | | // Note for Windows and Linux: the above macOS code doesn't appear |
2356 | | // to work as expected on Windows and Linux. One thing that might |
2357 | | // make the above code work on those platforms is by delaying the |
2358 | | // firing of the SalEvent::SettingsChanged event. macos uses the |
2359 | | // AquaSalInstance::delayedSettingsChanged() method to delay firing |
2360 | | // and also invalidate all the open windows so that may need to be |
2361 | | // moved to the SalInstance base class. |
2362 | 0 | #endif |
2363 | 0 | } |
2364 | | |
2365 | | bool MiscSettings::GetUseReducedAnimation() |
2366 | 0 | { |
2367 | 0 | vcl::Window* pDefWindow = ImplGetDefaultWindow(); |
2368 | 0 | if (pDefWindow == nullptr) |
2369 | 0 | return false; |
2370 | 0 | return pDefWindow->ImplGetFrame()->GetUseReducedAnimation(); |
2371 | 0 | } |
2372 | | |
2373 | | // tdf#115688: Let the user choose in the accessibility option page ("Tools" --> "Options" --> "Accessibility --> "Allow other animations") if the "marching ants" animation is allowed. |
2374 | | // tdf#161765: Let the user choose which animation settings to use: OS's / LO's |
2375 | | // New options: "System"/"No"/"Yes". |
2376 | | // Do respect OS's animation setting if the user has selected the option "System" |
2377 | | bool MiscSettings::IsAnimatedOthersAllowed() |
2378 | 0 | { |
2379 | 0 | sal_Int16 nAllowAnimatedOthers = officecfg::Office::Common::Accessibility::AllowAnimatedOthers::get(); |
2380 | 0 | bool bIsAllowed = false; // false is the default value, if someone sets the enum to other values than the allowed ones. |
2381 | 0 | switch (nAllowAnimatedOthers) |
2382 | 0 | { |
2383 | 0 | case 0: // "System": Use OS's setting |
2384 | 0 | bIsAllowed = ! MiscSettings::GetUseReducedAnimation(); |
2385 | 0 | break; |
2386 | 0 | case 1: // "No": Disallow animation |
2387 | 0 | bIsAllowed = false; |
2388 | 0 | break; |
2389 | 0 | case 2: // "Yes": Allow animation |
2390 | 0 | bIsAllowed = true; |
2391 | 0 | break; |
2392 | 0 | default: |
2393 | 0 | SAL_WARN( "accessibility", "Invalid value of AllowAnimatedOthers: 0x" << std::hex << nAllowAnimatedOthers << std::dec); |
2394 | 0 | break; |
2395 | 0 | } |
2396 | 0 | return bIsAllowed; |
2397 | 0 | } |
2398 | | |
2399 | | // tdf#161765: Let the user choose which animation settings to use: OS's / LO's |
2400 | | // New options: "System"/"No"/"Yes". |
2401 | | // Do respect OS's animation setting if the user has selected the option "System" |
2402 | | bool MiscSettings::IsAnimatedGraphicAllowed() |
2403 | 0 | { |
2404 | 0 | sal_Int16 nAllowAnimatedGraphic = officecfg::Office::Common::Accessibility::AllowAnimatedGraphic::get(); |
2405 | 0 | bool bIsAllowed = false; // false is the default value, if someone sets the enum to other values than the allowed ones. |
2406 | 0 | switch (nAllowAnimatedGraphic) |
2407 | 0 | { |
2408 | 0 | case 0: // "System": Use OS's setting |
2409 | 0 | bIsAllowed = ! MiscSettings::GetUseReducedAnimation(); |
2410 | 0 | break; |
2411 | 0 | case 1: // "No": Disallow animation |
2412 | 0 | bIsAllowed = false; |
2413 | 0 | break; |
2414 | 0 | case 2: // "Yes": Allow animation |
2415 | 0 | bIsAllowed = true; |
2416 | 0 | break; |
2417 | 0 | default: |
2418 | 0 | SAL_WARN( "accessibility", "Invalid value of officecfg::Office::Common::Accessibility::AllowAnimatedGraphic: 0x" << std::hex << nAllowAnimatedGraphic << std::dec); |
2419 | 0 | break; |
2420 | 0 | } |
2421 | 0 | return bIsAllowed; |
2422 | 0 | } |
2423 | | |
2424 | | // tdf#161765: Let the user choose which animation settings to use: OS's / LO's |
2425 | | // New options: "System"/"No"/"Yes". |
2426 | | // Do respect OS's animation setting if the user has selected the option "System" |
2427 | | bool MiscSettings::IsAnimatedTextAllowed() |
2428 | 0 | { |
2429 | 0 | sal_Int16 nAllowAnimatedText = officecfg::Office::Common::Accessibility::AllowAnimatedText::get(); |
2430 | 0 | bool bIsAllowed = false; // false is the default value, if someone sets the enum to other values than the allowed ones. |
2431 | 0 | switch (nAllowAnimatedText) |
2432 | 0 | { |
2433 | 0 | case 0: // "System": Use OS's setting |
2434 | 0 | bIsAllowed = ! MiscSettings::GetUseReducedAnimation(); |
2435 | 0 | break; |
2436 | 0 | case 1: // "No": Disallow animation |
2437 | 0 | bIsAllowed = false; |
2438 | 0 | break; |
2439 | 0 | case 2: // "Yes": Allow animation |
2440 | 0 | bIsAllowed = true; |
2441 | 0 | break; |
2442 | 0 | default: |
2443 | 0 | SAL_WARN( "accessibility", "Invalid value of officecfg::Office::Common::Accessibility::AllowAnimatedText: 0x" << std::hex << nAllowAnimatedText << std::dec); |
2444 | 0 | break; |
2445 | 0 | } |
2446 | 0 | return bIsAllowed; |
2447 | 0 | } |
2448 | | |
2449 | | HelpSettings::HelpSettings() |
2450 | 82 | : mxData(std::make_shared<ImplHelpData>()) |
2451 | 82 | { |
2452 | 82 | } |
2453 | | |
2454 | | bool HelpSettings::operator ==( const HelpSettings& rSet ) const |
2455 | 0 | { |
2456 | 0 | if ( mxData == rSet.mxData ) |
2457 | 0 | return true; |
2458 | | |
2459 | 0 | return (mxData->mnTipTimeout == rSet.mxData->mnTipTimeout ); |
2460 | 0 | } |
2461 | | |
2462 | | sal_Int32 |
2463 | | HelpSettings::GetTipDelay() |
2464 | 0 | { |
2465 | 0 | return 500; |
2466 | 0 | } |
2467 | | |
2468 | | void |
2469 | | HelpSettings::SetTipTimeout( sal_Int32 nTipTimeout ) |
2470 | 0 | { |
2471 | | // copy if other references exist |
2472 | 0 | if (mxData.use_count() > 1) |
2473 | 0 | { |
2474 | 0 | mxData = std::make_shared<ImplHelpData>(*mxData); |
2475 | 0 | } |
2476 | 0 | mxData->mnTipTimeout = nTipTimeout; |
2477 | 0 | } |
2478 | | |
2479 | | sal_Int32 |
2480 | | HelpSettings::GetTipTimeout() const |
2481 | 0 | { |
2482 | 0 | return mxData->mnTipTimeout; |
2483 | 0 | } |
2484 | | |
2485 | | sal_Int32 |
2486 | | HelpSettings::GetBalloonDelay() |
2487 | 0 | { |
2488 | 0 | return 1500; |
2489 | 0 | } |
2490 | | |
2491 | | bool |
2492 | | HelpSettings::operator !=( const HelpSettings& rSet ) const |
2493 | 0 | { |
2494 | 0 | return !(*this == rSet); |
2495 | 0 | } |
2496 | | |
2497 | | ImplAllSettingsData::ImplAllSettingsData() |
2498 | | : |
2499 | 82 | maLocale( maSysLocale.GetLanguageTag() ), |
2500 | 82 | maUILocale( maSysLocale.GetUILanguageTag() ) |
2501 | 82 | { |
2502 | 82 | if (!comphelper::IsFuzzing()) |
2503 | 0 | maMiscSettings.SetEnableLocalizedDecimalSep( maSysLocale.GetOptions().IsDecimalSeparatorAsLocale() ); |
2504 | 82 | } |
2505 | | |
2506 | | ImplAllSettingsData::ImplAllSettingsData( const ImplAllSettingsData& rData ) : |
2507 | 41.7k | maMouseSettings( rData.maMouseSettings ), |
2508 | 41.7k | maStyleSettings( rData.maStyleSettings ), |
2509 | 41.7k | maMiscSettings( rData.maMiscSettings ), |
2510 | 41.7k | maHelpSettings( rData.maHelpSettings ), |
2511 | 41.7k | maLocale( rData.maLocale ), |
2512 | 41.7k | maUILocale( rData.maUILocale ) |
2513 | 41.7k | { |
2514 | | // Create the cache objects new when their getter is called. |
2515 | 41.7k | } |
2516 | | |
2517 | | ImplAllSettingsData::~ImplAllSettingsData() |
2518 | 41.7k | { |
2519 | 41.7k | mpI18nHelper.reset(); |
2520 | 41.7k | mpUII18nHelper.reset(); |
2521 | 41.7k | } |
2522 | | |
2523 | 82 | AllSettings::AllSettings() = default; |
2524 | 1.26M | AllSettings::AllSettings(const AllSettings&) = default; |
2525 | 1.22M | AllSettings::~AllSettings() = default; |
2526 | 49.9k | AllSettings& AllSettings::operator=(const AllSettings&) = default; |
2527 | | |
2528 | | AllSettingsFlags AllSettings::Update( AllSettingsFlags nFlags, const AllSettings& rSet ) |
2529 | 0 | { |
2530 | 0 | const auto* constData = std::as_const(mxData).get(); |
2531 | 0 | AllSettingsFlags nChangeFlags = AllSettingsFlags::NONE; |
2532 | |
|
2533 | 0 | if ( nFlags & AllSettingsFlags::MOUSE ) |
2534 | 0 | { |
2535 | 0 | if (constData->maMouseSettings != rSet.mxData->maMouseSettings) |
2536 | 0 | { |
2537 | 0 | mxData->maMouseSettings = rSet.mxData->maMouseSettings; |
2538 | 0 | nChangeFlags |= AllSettingsFlags::MOUSE; |
2539 | 0 | } |
2540 | 0 | } |
2541 | |
|
2542 | 0 | if ( nFlags & AllSettingsFlags::STYLE ) |
2543 | 0 | { |
2544 | 0 | if (constData->maStyleSettings != rSet.mxData->maStyleSettings) |
2545 | 0 | { |
2546 | 0 | mxData->maStyleSettings = rSet.mxData->maStyleSettings; |
2547 | 0 | nChangeFlags |= AllSettingsFlags::STYLE; |
2548 | 0 | } |
2549 | 0 | } |
2550 | |
|
2551 | 0 | if ( nFlags & AllSettingsFlags::MISC ) |
2552 | 0 | { |
2553 | 0 | if (constData->maMiscSettings != rSet.mxData->maMiscSettings) |
2554 | 0 | { |
2555 | 0 | mxData->maMiscSettings = rSet.mxData->maMiscSettings; |
2556 | 0 | nChangeFlags |= AllSettingsFlags::MISC; |
2557 | 0 | } |
2558 | 0 | } |
2559 | |
|
2560 | 0 | if ( nFlags & AllSettingsFlags::LOCALE ) |
2561 | 0 | { |
2562 | 0 | if (constData->maLocale != rSet.mxData->maLocale) |
2563 | 0 | { |
2564 | 0 | SetLanguageTag( rSet.mxData->maLocale ); |
2565 | 0 | nChangeFlags |= AllSettingsFlags::LOCALE; |
2566 | 0 | } |
2567 | 0 | } |
2568 | |
|
2569 | 0 | return nChangeFlags; |
2570 | 0 | } |
2571 | | |
2572 | | AllSettingsFlags AllSettings::GetChangeFlags( const AllSettings& rSet ) const |
2573 | 41.1k | { |
2574 | | |
2575 | 41.1k | AllSettingsFlags nChangeFlags = AllSettingsFlags::NONE; |
2576 | | |
2577 | 41.1k | if ( mxData->maStyleSettings != rSet.mxData->maStyleSettings ) |
2578 | 2 | nChangeFlags |= AllSettingsFlags::STYLE; |
2579 | | |
2580 | 41.1k | if ( mxData->maMiscSettings != rSet.mxData->maMiscSettings ) |
2581 | 0 | nChangeFlags |= AllSettingsFlags::MISC; |
2582 | | |
2583 | 41.1k | if ( mxData->maLocale != rSet.mxData->maLocale ) |
2584 | 0 | nChangeFlags |= AllSettingsFlags::LOCALE; |
2585 | | |
2586 | 41.1k | return nChangeFlags; |
2587 | 41.1k | } |
2588 | | |
2589 | | // Until Clang 14, P2085R0 is unsupported, and the operator can't be default outside of declaration |
2590 | | bool AllSettings::operator ==( const AllSettings& rSet ) const |
2591 | 0 | { |
2592 | 0 | return mxData == rSet.mxData; |
2593 | 0 | } |
2594 | | |
2595 | | bool ImplAllSettingsData::operator==(const ImplAllSettingsData& rSet) const |
2596 | 0 | { |
2597 | 0 | return (maMouseSettings == rSet.maMouseSettings) && |
2598 | 0 | (maStyleSettings == rSet.maStyleSettings) && |
2599 | 0 | (maMiscSettings == rSet.maMiscSettings) && |
2600 | 0 | (maHelpSettings == rSet.maHelpSettings) && |
2601 | 0 | (maLocale == rSet.maLocale); |
2602 | 0 | } |
2603 | | |
2604 | | void AllSettings::SetLanguageTag(const OUString& rLanguage, bool bCanonicalize) |
2605 | 0 | { |
2606 | 0 | SetLanguageTag(LanguageTag(rLanguage, bCanonicalize)); |
2607 | 0 | } |
2608 | | |
2609 | | void AllSettings::SetLanguageTag( const LanguageTag& rLanguageTag ) |
2610 | 0 | { |
2611 | 0 | if (std::as_const(mxData)->maLocale == rLanguageTag) |
2612 | 0 | return; |
2613 | | |
2614 | 0 | auto* myData = mxData.get(); |
2615 | |
|
2616 | 0 | myData->maLocale |
2617 | 0 | = rLanguageTag.isSystemLocale() ? GetSysLocale().GetLanguageTag() : rLanguageTag; |
2618 | |
|
2619 | 0 | if ( myData->mpLocaleDataWrapper ) |
2620 | 0 | { |
2621 | 0 | myData->mpLocaleDataWrapper = nullptr; |
2622 | 0 | } |
2623 | 0 | if ( myData->mpI18nHelper ) |
2624 | 0 | { |
2625 | 0 | myData->mpI18nHelper.reset(); |
2626 | 0 | } |
2627 | 0 | } |
2628 | | |
2629 | | namespace |
2630 | | { |
2631 | | bool GetConfigLayoutRTL(bool bMath) |
2632 | 0 | { |
2633 | 0 | static const char* pEnv = getenv("SAL_RTL_ENABLED" ); |
2634 | 0 | static int nUIMirroring = -1; // -1: undef, 0: auto, 1: on 2: off |
2635 | 0 |
|
2636 | 0 | // environment always overrides |
2637 | 0 | if( pEnv ) |
2638 | 0 | return true; |
2639 | 0 |
|
2640 | 0 | bool bRTL = false; |
2641 | 0 |
|
2642 | 0 | if( nUIMirroring == -1 ) |
2643 | 0 | { |
2644 | 0 | nUIMirroring = 0; // ask configuration only once |
2645 | 0 | utl::OConfigurationNode aNode = utl::OConfigurationTreeRoot::tryCreateWithComponentContext( |
2646 | 0 | comphelper::getProcessComponentContext(), |
2647 | 0 | u"org.openoffice.Office.Common/I18N/CTL"_ustr ); // note: case sensitive ! |
2648 | 0 | if ( aNode.isValid() ) |
2649 | 0 | { |
2650 | 0 | bool bTmp = bool(); |
2651 | 0 | css::uno::Any aValue = aNode.getNodeValue( u"UIMirroring"_ustr ); |
2652 | 0 | if( aValue >>= bTmp ) |
2653 | 0 | { |
2654 | 0 | // found true or false; if it was nil, nothing is changed |
2655 | 0 | nUIMirroring = bTmp ? 1 : 2; |
2656 | 0 | } |
2657 | 0 | } |
2658 | 0 | } |
2659 | 0 |
|
2660 | 0 | if( nUIMirroring == 0 ) // no config found (eg, setup) or default (nil) was set: check language |
2661 | 0 | { |
2662 | 0 | LanguageType aLang = SvtSysLocaleOptions().GetRealUILanguageTag().getLanguageType(); |
2663 | 0 | if (bMath) |
2664 | 0 | bRTL = MsLangId::isRightToLeftMath( aLang ); |
2665 | 0 | else |
2666 | 0 | bRTL = MsLangId::isRightToLeft( aLang ); |
2667 | 0 | } |
2668 | 0 | else |
2669 | 0 | bRTL = (nUIMirroring == 1); |
2670 | 0 |
|
2671 | 0 | return bRTL; |
2672 | 0 | } |
2673 | | } |
2674 | | |
2675 | | bool AllSettings::GetLayoutRTL() |
2676 | 1.90M | { |
2677 | 1.90M | if (comphelper::IsFuzzing()) |
2678 | 1.90M | return false; |
2679 | 0 | return GetConfigLayoutRTL(false); |
2680 | 1.90M | } |
2681 | | |
2682 | | bool AllSettings::GetMathLayoutRTL() |
2683 | 0 | { |
2684 | 0 | if (comphelper::IsFuzzing()) |
2685 | 0 | return false; |
2686 | 0 | return GetConfigLayoutRTL(true); |
2687 | 0 | } |
2688 | | |
2689 | | const LanguageTag& AllSettings::GetLanguageTag() const |
2690 | 5.55M | { |
2691 | 5.55M | if (comphelper::IsFuzzing()) |
2692 | 5.55M | { |
2693 | 5.55M | static LanguageTag aRet(u"en-US"_ustr); |
2694 | 5.55M | return aRet; |
2695 | 5.55M | } |
2696 | | |
2697 | 0 | if (comphelper::LibreOfficeKit::isActive()) |
2698 | 0 | return comphelper::LibreOfficeKit::getLanguageTag(); |
2699 | | |
2700 | 0 | assert(!mxData->maLocale.isSystemLocale()); |
2701 | |
|
2702 | 0 | return mxData->maLocale; |
2703 | 0 | } |
2704 | | |
2705 | | const LanguageTag& AllSettings::GetUILanguageTag() const |
2706 | 144k | { |
2707 | 144k | if (comphelper::IsFuzzing()) |
2708 | 144k | { |
2709 | 144k | static LanguageTag aRet(u"en-US"_ustr); |
2710 | 144k | return aRet; |
2711 | 144k | } |
2712 | | |
2713 | 0 | if (comphelper::LibreOfficeKit::isActive()) |
2714 | 0 | return comphelper::LibreOfficeKit::getLanguageTag(); |
2715 | | |
2716 | 0 | assert(!mxData->maUILocale.isSystemLocale()); |
2717 | |
|
2718 | 0 | return mxData->maUILocale; |
2719 | 0 | } |
2720 | | |
2721 | | OUString AllSettings::GetUIRootDir() |
2722 | 0 | { |
2723 | 0 | OUString sShareLayer(u"$BRAND_BASE_DIR/$BRAND_SHARE_SUBDIR/config/soffice.cfg/"_ustr); |
2724 | 0 | rtl::Bootstrap::expandMacros(sShareLayer); |
2725 | 0 | return sShareLayer; |
2726 | 0 | } |
2727 | | |
2728 | | const LocaleDataWrapper& AllSettings::GetLocaleDataWrapper() const |
2729 | 0 | { |
2730 | 0 | if ( !mxData->mpLocaleDataWrapper ) |
2731 | 0 | mxData->mpLocaleDataWrapper = LocaleDataWrapper::get( GetLanguageTag() ); |
2732 | 0 | return *mxData->mpLocaleDataWrapper; |
2733 | 0 | } |
2734 | | |
2735 | | const LocaleDataWrapper& AllSettings::GetUILocaleDataWrapper() const |
2736 | 0 | { |
2737 | 0 | if ( !mxData->mpUILocaleDataWrapper ) |
2738 | 0 | mxData->mpUILocaleDataWrapper = LocaleDataWrapper::get( GetUILanguageTag() ); |
2739 | 0 | return *mxData->mpUILocaleDataWrapper; |
2740 | 0 | } |
2741 | | |
2742 | | const LocaleDataWrapper& AllSettings::GetNeutralLocaleDataWrapper() const |
2743 | 0 | { |
2744 | 0 | if ( !mxData->mpNeutralLocaleDataWrapper ) |
2745 | 0 | mxData->mpNeutralLocaleDataWrapper = LocaleDataWrapper::get( LanguageTag(u"en-US"_ustr) ); |
2746 | 0 | return *mxData->mpNeutralLocaleDataWrapper; |
2747 | 0 | } |
2748 | | |
2749 | | const vcl::I18nHelper& AllSettings::GetLocaleI18nHelper() const |
2750 | 0 | { |
2751 | 0 | if ( !mxData->mpI18nHelper ) { |
2752 | 0 | mxData->mpI18nHelper.reset( new vcl::I18nHelper( |
2753 | 0 | comphelper::getProcessComponentContext(), GetLanguageTag() ) ); |
2754 | 0 | } |
2755 | 0 | return *mxData->mpI18nHelper; |
2756 | 0 | } |
2757 | | |
2758 | | const vcl::I18nHelper& AllSettings::GetUILocaleI18nHelper() const |
2759 | 0 | { |
2760 | 0 | if ( !mxData->mpUII18nHelper ) { |
2761 | 0 | mxData->mpUII18nHelper.reset( new vcl::I18nHelper( |
2762 | 0 | comphelper::getProcessComponentContext(), GetUILanguageTag() ) ); |
2763 | 0 | } |
2764 | 0 | return *mxData->mpUII18nHelper; |
2765 | 0 | } |
2766 | | |
2767 | | void AllSettings::LocaleSettingsChanged( ConfigurationHints nHint ) |
2768 | 0 | { |
2769 | 0 | AllSettings aAllSettings( Application::GetSettings() ); |
2770 | 0 | if ( nHint & ConfigurationHints::DecSep ) |
2771 | 0 | { |
2772 | 0 | MiscSettings aMiscSettings = aAllSettings.GetMiscSettings(); |
2773 | 0 | bool bIsDecSepAsLocale = aAllSettings.GetSysLocale().GetOptions().IsDecimalSeparatorAsLocale(); |
2774 | 0 | if ( aMiscSettings.GetEnableLocalizedDecimalSep() != bIsDecSepAsLocale ) |
2775 | 0 | { |
2776 | 0 | aMiscSettings.SetEnableLocalizedDecimalSep( bIsDecSepAsLocale ); |
2777 | 0 | aAllSettings.SetMiscSettings( aMiscSettings ); |
2778 | 0 | } |
2779 | 0 | } |
2780 | |
|
2781 | 0 | if ( nHint & ConfigurationHints::Locale ) |
2782 | 0 | aAllSettings.SetLanguageTag(aAllSettings.GetSysLocale().GetOptions().GetLanguageTag()); |
2783 | |
|
2784 | 0 | Application::SetSettings( aAllSettings ); |
2785 | 0 | } |
2786 | | |
2787 | | const StyleSettings& |
2788 | | AllSettings::GetStyleSettings() const |
2789 | 19.5M | { |
2790 | 19.5M | return mxData->maStyleSettings; |
2791 | 19.5M | } |
2792 | | |
2793 | | StyleSettingsOptions |
2794 | | StyleSettings::GetOptions() const |
2795 | 8.63k | { |
2796 | 8.63k | return mxData->mnOptions; |
2797 | 8.63k | } |
2798 | | |
2799 | | std::vector<vcl::IconThemeInfo> const & |
2800 | | StyleSettings::GetInstalledIconThemes() const |
2801 | 585 | { |
2802 | 585 | if (!mxData->mpIconThemeScanner) |
2803 | 2 | { |
2804 | 2 | mxData->mpIconThemeScanner.reset(new vcl::IconThemeScanner); |
2805 | 2 | mxData->mpIconThemeScanner->addPaths(vcl::IconThemeScanner::GetStandardIconThemePath()); |
2806 | 2 | } |
2807 | 585 | return mxData->mpIconThemeScanner->GetFoundIconThemes(); |
2808 | 585 | } |
2809 | | |
2810 | | OUString |
2811 | | StyleSettings::GetAutomaticallyChosenIconTheme() const |
2812 | 0 | { |
2813 | 0 | return mxData->mIconThemeSelector.SelectIconThemeForDesktopEnvironment( |
2814 | 0 | GetInstalledIconThemes(), |
2815 | 0 | Application::GetDesktopEnvironment()); |
2816 | 0 | } |
2817 | | |
2818 | | void |
2819 | | StyleSettings::SetIconTheme(const OUString& theme) |
2820 | 0 | { |
2821 | 0 | mxData->mIconTheme = theme; |
2822 | 0 | } |
2823 | | |
2824 | | OUString |
2825 | | StyleSettings::DetermineIconTheme() const |
2826 | 585 | { |
2827 | 585 | OUString sTheme(mxData->mIconTheme); |
2828 | 585 | if (sTheme.isEmpty()) |
2829 | 585 | { |
2830 | 585 | if (comphelper::IsFuzzing()) |
2831 | 585 | sTheme = "colibre"; |
2832 | 0 | else |
2833 | 0 | { |
2834 | | // read from the configuration, or fallback to what the desktop wants |
2835 | 0 | sTheme = officecfg::Office::Common::Misc::SymbolStyle::get(); |
2836 | |
|
2837 | 0 | if (sTheme.isEmpty() || sTheme == "auto") |
2838 | 0 | sTheme = GetAutomaticallyChosenIconTheme(); |
2839 | 0 | } |
2840 | 585 | } |
2841 | | |
2842 | 585 | return mxData->mIconThemeSelector.SelectIconTheme( |
2843 | 585 | GetInstalledIconThemes(), |
2844 | 585 | sTheme); |
2845 | 585 | } |
2846 | | |
2847 | | void |
2848 | | StyleSettings::SetHighContrastMode(bool bHighContrast ) |
2849 | 2 | { |
2850 | 2 | if (std::as_const(mxData)->mbHighContrast == bHighContrast) { |
2851 | 2 | return; |
2852 | 2 | } |
2853 | | |
2854 | 0 | auto* myData = mxData.get(); |
2855 | 0 | myData->mbHighContrast = bHighContrast; |
2856 | 0 | myData->mIconThemeSelector.SetUseHighContrastTheme(bHighContrast); |
2857 | 0 | } |
2858 | | |
2859 | | bool |
2860 | | StyleSettings::GetHighContrastMode() const |
2861 | 46.2k | { |
2862 | 46.2k | return mxData->mbHighContrast; |
2863 | 46.2k | } |
2864 | | |
2865 | | void |
2866 | | StyleSettings::SetPreferredIconTheme(const OUString& theme, bool bDarkIconTheme) |
2867 | 0 | { |
2868 | 0 | auto* myData = mxData.get(); |
2869 | 0 | const bool bChanged = myData->mIconThemeSelector.SetPreferredIconTheme(theme, bDarkIconTheme); |
2870 | 0 | if (bChanged) |
2871 | 0 | { |
2872 | | // clear this so it is recalculated if it was selected as the automatic theme |
2873 | 0 | myData->mIconTheme.clear(); |
2874 | 0 | } |
2875 | 0 | } |
2876 | | |
2877 | | void |
2878 | | AllSettings::SetMouseSettings( const MouseSettings& rSet ) |
2879 | 0 | { |
2880 | 0 | mxData->maMouseSettings = rSet; |
2881 | 0 | } |
2882 | | |
2883 | | const MouseSettings& |
2884 | | AllSettings::GetMouseSettings() const |
2885 | 4.14k | { |
2886 | 4.14k | return mxData->maMouseSettings; |
2887 | 4.14k | } |
2888 | | |
2889 | | void |
2890 | | AllSettings::SetStyleSettings( const StyleSettings& rSet ) |
2891 | 41.7k | { |
2892 | 41.7k | mxData->maStyleSettings = rSet; |
2893 | 41.7k | } |
2894 | | |
2895 | | void |
2896 | | AllSettings::SetMiscSettings( const MiscSettings& rSet ) |
2897 | 0 | { |
2898 | 0 | mxData->maMiscSettings = rSet; |
2899 | 0 | } |
2900 | | |
2901 | | const MiscSettings& |
2902 | | AllSettings::GetMiscSettings() const |
2903 | 0 | { |
2904 | 0 | return mxData->maMiscSettings; |
2905 | 0 | } |
2906 | | |
2907 | | void |
2908 | | AllSettings::SetHelpSettings( const HelpSettings& rSet ) |
2909 | 0 | { |
2910 | 0 | mxData->maHelpSettings = rSet; |
2911 | 0 | } |
2912 | | |
2913 | | const HelpSettings& |
2914 | | AllSettings::GetHelpSettings() const |
2915 | 0 | { |
2916 | 0 | return mxData->maHelpSettings; |
2917 | 0 | } |
2918 | | |
2919 | | const SvtSysLocale& |
2920 | | AllSettings::GetSysLocale() const |
2921 | 0 | { |
2922 | 0 | return mxData->maSysLocale; |
2923 | 0 | } |
2924 | | |
2925 | | |
2926 | | void StyleSettings::BatchSetBackgrounds( const Color &aBackColor, |
2927 | | bool bCheckedColorSpecialCase ) |
2928 | 2 | { |
2929 | 2 | Set3DColors( aBackColor ); |
2930 | 2 | SetFaceColor( aBackColor ); |
2931 | 2 | SetDialogColor( aBackColor ); |
2932 | 2 | SetWorkspaceColor( aBackColor ); |
2933 | | |
2934 | 2 | if (bCheckedColorSpecialCase) |
2935 | 0 | SetCheckedColorSpecialCase(); |
2936 | 2 | } |
2937 | | |
2938 | | void StyleSettings::BatchSetFonts( const vcl::Font& aAppFont, |
2939 | | const vcl::Font& aLabelFont ) |
2940 | 0 | { |
2941 | 0 | SetAppFont( aAppFont ); |
2942 | 0 | SetPushButtonFont( aAppFont ); |
2943 | 0 | SetToolFont( aAppFont ); |
2944 | 0 | SetHelpFont( aAppFont ); |
2945 | |
|
2946 | 0 | SetMenuFont( aLabelFont ); |
2947 | 0 | SetTabFont( aLabelFont ); |
2948 | 0 | SetLabelFont( aLabelFont ); |
2949 | 0 | SetRadioCheckFont( aLabelFont ); |
2950 | 0 | SetFieldFont( aLabelFont ); |
2951 | 0 | SetGroupFont( aLabelFont ); |
2952 | 0 | SetIconFont( aLabelFont ); |
2953 | 0 | } |
2954 | | |
2955 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |