-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
PictureFrameAppletConfigureDialog.cxx
36 lines (27 loc) · 1.18 KB
/
PictureFrameAppletConfigureDialog.cxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
This file is part of liquidshell.
SPDX-FileCopyrightText: 2017 - 2024 Martin Koller <kollix@aon.at>
SPDX-License-Identifier: GPL-3.0-or-later
*/
#include <PictureFrameAppletConfigureDialog.hxx>
#include <PictureFrameApplet.hxx>
//--------------------------------------------------------------------------------
PictureFrameAppletConfigureDialog::PictureFrameAppletConfigureDialog(PictureFrameApplet *parent)
: QDialog(parent), applet(parent)
{
ui.setupUi(this);
ui.textColor->setColor(applet->palette().color(applet->foregroundRole()));
ui.backgroundColor->setColor(applet->palette().color(applet->backgroundRole()));
ui.imagePath->setUrl(QUrl::fromLocalFile(applet->getImagePath()));
}
//--------------------------------------------------------------------------------
void PictureFrameAppletConfigureDialog::accept()
{
QPalette pal = applet->palette();
pal.setColor(applet->foregroundRole(), ui.textColor->color());
pal.setColor(applet->backgroundRole(), ui.backgroundColor->color());
applet->setPalette(pal);
applet->setImagePath(ui.imagePath->url().toLocalFile());
QDialog::accept();
}
//--------------------------------------------------------------------------------