diff --git a/src/blackgui/labelandicon.cpp b/src/blackgui/labelandicon.cpp new file mode 100644 index 000000000..da4700031 --- /dev/null +++ b/src/blackgui/labelandicon.cpp @@ -0,0 +1,37 @@ +/* Copyright (C) 2015 + * swift project Community / Contributors + * + * This file is part of swift Project. It is subject to the license terms in the LICENSE file found in the top-level + * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, + * including this file, may be copied, modified, propagated, or distributed except according to the terms + * contained in the LICENSE file. + */ + +#include "labelandicon.h" +#include "ui_labelandicon.h" + +namespace BlackGui +{ + CLabelAndIcon::CLabelAndIcon(QWidget *parent) : + QFrame(parent), + ui(new Ui::CLabelAndIcon) + { + ui->setupUi(this); + } + + CLabelAndIcon::~CLabelAndIcon() + { } + + void CLabelAndIcon::set(const QPixmap &pixmap, const QString &text) + { + ui->lbl_Left->setPixmap(pixmap); + ui->lbl_Right->setText(text); + } + + void CLabelAndIcon::set(const QString &text, const QPixmap &pixmap) + { + ui->lbl_Right->setPixmap(pixmap); + ui->lbl_Left->setText(text); + } + +} // ns diff --git a/src/blackgui/labelandicon.h b/src/blackgui/labelandicon.h new file mode 100644 index 000000000..685d60221 --- /dev/null +++ b/src/blackgui/labelandicon.h @@ -0,0 +1,46 @@ +/* Copyright (C) 2015 + * swift project Community / Contributors + * + * This file is part of swift Project. It is subject to the license terms in the LICENSE file found in the top-level + * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, + * including this file, may be copied, modified, propagated, or distributed except according to the terms + * contained in the LICENSE file. + */ + +#ifndef BLACKGUI_LABELANDICON_H +#define BLACKGUI_LABELANDICON_H + +#include +#include + +namespace Ui { class CLabelAndIcon; } + +namespace BlackGui +{ + /*! + * Label and icon frame + */ + class CLabelAndIcon : public QFrame + { + Q_OBJECT + + public: + //! Constructor + explicit CLabelAndIcon(QWidget *parent = nullptr); + + //! Destructor + ~CLabelAndIcon(); + + //! Set values (left to right) + void set(const QPixmap &pixmap, const QString &text); + + //! Set values (left to right) + void set(const QString &text, const QPixmap &pixmap); + + private: + QScopedPointer ui; + }; + +} // ns + +#endif // guard diff --git a/src/blackgui/labelandicon.ui b/src/blackgui/labelandicon.ui new file mode 100644 index 000000000..79a212def --- /dev/null +++ b/src/blackgui/labelandicon.ui @@ -0,0 +1,59 @@ + + + CLabelAndIcon + + + + 0 + 0 + 50 + 15 + + + + Frame + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 4 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Left + + + + + + + + + + ../blackmisc/icons/own/swift/swift16Database.png + + + + + + + +