Aeon Engine
c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
SettingsDialog.cpp
1
/*
2
Copyright (C) 2014,2015,2018,2019,2022 Rodrigo Jose Hernandez Cordoba
3
4
Licensed under the Apache License, Version 2.0 (the "License");
5
you may not use this file except in compliance with the License.
6
You may obtain a copy of the License at
7
8
http://www.apache.org/licenses/LICENSE-2.0
9
10
Unless required by applicable law or agreed to in writing, software
11
distributed under the License is distributed on an "AS IS" BASIS,
12
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
See the License for the specific language governing permissions and
14
limitations under the License.
15
*/
16
#include "SettingsDialog.h"
17
#include <QColorDialog>
18
namespace
AeonGames
19
{
20
SettingsDialog::SettingsDialog
()
21
{
22
mUi.setupUi (
this
);
23
settings.beginGroup (
"MainWindow"
);
24
mUi.backgroundColorPushButton->setPalette ( QPalette ( settings.value (
"background color"
, QColor ( 57, 57, 57 ) ).value<QColor>() ) );
25
settings.endGroup();
26
}
27
28
29
SettingsDialog::~SettingsDialog
()
30
{
31
}
32
33
void
SettingsDialog::onChangeBackgroundColor
()
34
{
35
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
36
QColor color = QColorDialog::getColor ( mUi.backgroundColorPushButton->palette().background().color() );
37
#else
38
QColor color = QColorDialog::getColor ( mUi.backgroundColorPushButton->palette().window().color() );
39
#endif
40
settings.beginGroup (
"MainWindow"
);
41
settings.setValue (
"background color"
, color );
42
settings.endGroup();
43
mUi.backgroundColorPushButton->setPalette ( QPalette ( color ) );
44
emit
backgroundColor
( color );
45
}
46
}
AeonGames::SettingsDialog::SettingsDialog
SettingsDialog()
Default constructor.
Definition
SettingsDialog.cpp:20
AeonGames::SettingsDialog::backgroundColor
void backgroundColor(QColor color)
Emitted when the background color changes.
AeonGames::SettingsDialog::onChangeBackgroundColor
void onChangeBackgroundColor()
Slot to open a color picker for the background color.
Definition
SettingsDialog.cpp:33
AeonGames::SettingsDialog::~SettingsDialog
~SettingsDialog()
Destructor.
Definition
SettingsDialog.cpp:29
AeonGames
<- This is here just for the literals
Definition
AABB.hpp:31
tools
worldeditor
SettingsDialog.cpp
Generated by
1.16.1