Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
SettingsDialog.cpp
1/*
2Copyright (C) 2014,2015,2018,2019,2022 Rodrigo Jose Hernandez Cordoba
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16#include "SettingsDialog.h"
17#include <QColorDialog>
18namespace AeonGames
19{
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
32
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}
SettingsDialog()
Default constructor.
void backgroundColor(QColor color)
Emitted when the background color changes.
void onChangeBackgroundColor()
Slot to open a color picker for the background color.
<- This is here just for the literals
Definition AABB.hpp:31