feather/src/components.h

84 lines
1.7 KiB
C
Raw Normal View History

// SPDX-License-Identifier: BSD-3-Clause
2023-01-02 19:30:11 +00:00
// SPDX-FileCopyrightText: 2020-2023 The Monero Project
2021-06-27 12:51:15 +00:00
#ifndef FEATHER_COMPONENTS_H
#define FEATHER_COMPONENTS_H
#include <QPushButton>
#include <QHBoxLayout>
#include <QDialog>
#include <QLabel>
#include <QPlainTextEdit>
#include <QLineEdit>
2023-02-11 17:11:21 +00:00
#include <QListWidget>
class DoublePixmapLabel : public QLabel
{
Q_OBJECT
public:
explicit DoublePixmapLabel(QWidget *parent = nullptr);
public slots:
void setAssets(const QString &firstAsset, const QString &secondAsset);
void setMode(bool mode);
private:
bool m_mode = false;
QPixmap m_first;
QPixmap m_second;
};
class StatusBarButton : public QPushButton
{
Q_OBJECT
public:
explicit StatusBarButton(const QIcon &icon, const QString &tooltip, QWidget *parent = nullptr);
};
class HelpLabel : public QLabel
{
Q_OBJECT
public:
QFont font;
void setHelpText(const QString &text, const QString &informativeText, const QString &doc = "");
explicit HelpLabel(QWidget * parent);
protected:
void mouseReleaseEvent(QMouseEvent *event) override;
2022-05-24 15:32:42 +00:00
void enterEvent(QEnterEvent *event) override;
void leaveEvent(QEvent *event) override;
private:
QString m_text;
QString m_informativeText;
QString m_doc;
};
class ClickableLabel : public QLabel {
Q_OBJECT
public:
explicit ClickableLabel(QWidget* parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags());
~ClickableLabel() override;
signals:
void clicked();
protected:
void mousePressEvent(QMouseEvent* event) override;
};
2021-06-27 12:51:15 +00:00
2021-10-22 17:19:56 +00:00
class WindowModalDialog : public QDialog {
Q_OBJECT
public:
explicit WindowModalDialog(QWidget *parent);
};
2021-06-27 12:51:15 +00:00
#endif //FEATHER_COMPONENTS_H