Krita Source Code Documentation
Loading...
Searching...
No Matches
KisWarningWidget.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2020 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#include "KisWarningWidget.h"
8
9#include "klocalizedstring.h"
10#include "kis_icon_utils.h"
11#include <QHBoxLayout>
12#include <QLabel>
13
14
16 : QWidget(parent)
17{
18 QHBoxLayout *hLayout = new QHBoxLayout(this);
19
20 m_warningIcon = new QLabel(this);
21 m_warningIcon->setPixmap(KisIconUtils::loadIcon("warning").pixmap(32, 32));
22 m_warningIcon->setAlignment(Qt::AlignTop);
23 hLayout->addWidget(m_warningIcon);
24
25 m_warningText = new QLabel(this);
26 m_warningText->setWordWrap(true);
27 m_warningText->setOpenExternalLinks(true);
28 hLayout->addWidget(m_warningText, 1);
29
30 setLayout(hLayout);
31}
32
33void KisWarningWidget::setText(const QString &text)
34{
35 m_warningText->setText(text);
36}
37
39{
40 return i18nc("warning message when changing image color space",
41 "<html><body>"
42 "<p><b>WARNING:</b> the image will look different after changing the color profile because it contains either:"
43 "<ul>"
44 "<li>more than one layer</li>"
45 "<li>one or more layers with transparent pixels</li>"
46 "<li>layers with blending modes other than \"Normal\"</li>"
47 "</ul></p>"
48 "<p>"
49 "<a href=\"https://docs.krita.org/en/general_concepts/colors/color_managed_workflow.html\">More information</a>"
50 "</p></body></html>");
51}
KisWarningWidget(QWidget *parent)
void setText(const QString &text)
static QString changeImageProfileWarningText()
QIcon loadIcon(const QString &name)