-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
DiskUsageAppletConfigureDialog.cxx
38 lines (29 loc) · 1.33 KB
/
DiskUsageAppletConfigureDialog.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
37
38
/*
This file is part of liquidshell.
SPDX-FileCopyrightText: 2017 - 2024 Martin Koller <kollix@aon.at>
SPDX-License-Identifier: GPL-3.0-or-later
*/
#include <DiskUsageAppletConfigureDialog.hxx>
#include <DiskUsageApplet.hxx>
//--------------------------------------------------------------------------------
DiskUsageAppletConfigureDialog::DiskUsageAppletConfigureDialog(DiskUsageApplet *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.barTextColor->setColor(applet->palette().color(QPalette::HighlightedText));
ui.barBackgroundColor->setColor(applet->palette().color(QPalette::Highlight));
}
//--------------------------------------------------------------------------------
void DiskUsageAppletConfigureDialog::accept()
{
QPalette pal = applet->palette();
pal.setColor(applet->foregroundRole(), ui.textColor->color());
pal.setColor(applet->backgroundRole(), ui.backgroundColor->color());
pal.setColor(QPalette::HighlightedText, ui.barTextColor->color());
pal.setColor(QPalette::Highlight, ui.barBackgroundColor->color());
applet->setPalette(pal);
QDialog::accept();
}
//--------------------------------------------------------------------------------