1
/***************************************************************************
2
* Copyright (c) 2023 WandererFan <wandererfan@gmail.com> *
4
* This file is part of FreeCAD. *
6
* FreeCAD is free software: you can redistribute it and/or modify it *
7
* under the terms of the GNU Lesser General Public License as *
8
* published by the Free Software Foundation, either version 2.1 of the *
9
* License, or (at your option) any later version. *
11
* FreeCAD is distributed in the hope that it will be useful, but *
12
* WITHOUT ANY WARRANTY; without even the implied warranty of *
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14
* Lesser General Public License for more details. *
16
* You should have received a copy of the GNU Lesser General Public *
17
* License along with FreeCAD. If not, see *
18
* <https://www.gnu.org/licenses/>. *
20
**************************************************************************/
22
#include "PreCompiled.h"
27
#include <App/Application.h>
28
#include <App/Material.h>
29
#include <Base/Console.h>
30
#include <Base/Parameter.h>
32
#include "Preferences.h"
35
// getters for parameters used in multiple places.
36
// ensure this is in sync with parameter names and default values on preference pages
38
using namespace Measure;
40
//! Returns the Measure preference group
41
Base::Reference<ParameterGrp> Preferences::getPreferenceGroup(const char* Name)
43
return App::GetApplication()
45
.GetGroup("BaseApp/Preferences/Mod/Measure")
49
App::Color Preferences::defaultLineColor()
52
fcColor.setPackedValue(
53
getPreferenceGroup("Appearance")->GetUnsigned("DefaultLineColor", 0x3CF00000));
57
App::Color Preferences::defaultTextColor()
60
fcColor.setPackedValue(
61
getPreferenceGroup("Appearance")->GetUnsigned("DefaultTextColor", 0x00000000));
65
App::Color Preferences::defaultTextBackgroundColor()
68
fcColor.setPackedValue(
69
getPreferenceGroup("Appearance")->GetUnsigned("DefaultTextBackgroundColor", 0x3CF00000));
73
int Preferences::defaultFontSize()
75
return getPreferenceGroup("Appearance")->GetInt("DefaultFontSize", 18);