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