mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-23 06:50:58 -04:00
Add custom light and dark UI themes
This commit is contained in:
parent
6d2ca74878
commit
557736ea5e
39 changed files with 6452 additions and 401 deletions
|
@ -102,12 +102,6 @@ void KMessageWidgetPrivate::init(KMessageWidget *q_ptr)
|
|||
closeButton->setAutoRaise(true);
|
||||
closeButton->setDefaultAction(closeAction);
|
||||
closeButtonPixmap = QPixmap(closeButton->icon().pixmap(closeButton->icon().actualSize(QSize(16, 16))));
|
||||
#ifdef Q_OS_MACOS
|
||||
closeButton->setStyleSheet("QToolButton { background: transparent;"
|
||||
"border-radius: 2px; padding: 3px; }"
|
||||
"QToolButton::hover, QToolButton::focus {"
|
||||
"border: 1px solid rgb(90, 200, 250); }");
|
||||
#endif
|
||||
|
||||
q->setMessageType(KMessageWidget::Information);
|
||||
}
|
||||
|
@ -263,7 +257,7 @@ void KMessageWidget::setMessageType(KMessageWidget::MessageType type)
|
|||
{
|
||||
d->messageType = type;
|
||||
QColor bg0, bg1, bg2, border;
|
||||
QColor fg = palette().light().color();
|
||||
QColor fg = QColor(238, 238, 238);
|
||||
switch (type) {
|
||||
case Positive:
|
||||
bg1.setRgb(37, 163, 83);
|
||||
|
@ -273,7 +267,7 @@ void KMessageWidget::setMessageType(KMessageWidget::MessageType type)
|
|||
break;
|
||||
case Warning:
|
||||
bg1.setRgb(252, 193, 57);
|
||||
fg = palette().windowText().color();
|
||||
fg = QColor(48, 48, 48);
|
||||
break;
|
||||
case Error:
|
||||
bg1.setRgb(198, 69, 21);
|
||||
|
@ -294,9 +288,15 @@ void KMessageWidget::setMessageType(KMessageWidget::MessageType type)
|
|||
painter.fillRect(QRect(0, 0, 16, 16), fg);
|
||||
painter.end();
|
||||
d->closeButton->setIcon(closeButtonPixmap);
|
||||
d->closeButton->setStyleSheet(QStringLiteral("QToolButton {"
|
||||
" background: transparent;"
|
||||
" border-radius: 2px;"
|
||||
" border: none; }"
|
||||
"QToolButton:hover, QToolButton:focus {"
|
||||
" border: 1px solid %1; }").arg(fg.name()));
|
||||
|
||||
d->content->setStyleSheet(
|
||||
QString(QLatin1String(".QFrame {"
|
||||
QStringLiteral(".QFrame {"
|
||||
"background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,"
|
||||
" stop: 0 %1,"
|
||||
" stop: 0.1 %2,"
|
||||
|
@ -307,7 +307,7 @@ void KMessageWidget::setMessageType(KMessageWidget::MessageType type)
|
|||
" padding: 5px;"
|
||||
"}"
|
||||
".QLabel { color: %6; }"
|
||||
))
|
||||
)
|
||||
.arg(bg0.name(),
|
||||
bg1.name(),
|
||||
bg2.name(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue