2017-05-30 23:08:14 -07:00
|
|
|
// Copyright 2017 Dolphin Emulator Project
|
2021-07-05 03:22:19 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2017-05-30 23:08:14 -07:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QPushButton>
|
|
|
|
|
|
|
|
class ElidedButton : public QPushButton
|
|
|
|
{
|
2018-05-13 16:16:20 -04:00
|
|
|
Q_OBJECT
|
2017-05-30 23:08:14 -07:00
|
|
|
public:
|
2019-07-30 07:57:06 -04:00
|
|
|
explicit ElidedButton(const QString& text = {}, Qt::TextElideMode elide_mode = Qt::ElideRight);
|
2019-03-03 08:05:59 -06:00
|
|
|
|
2017-05-30 23:08:14 -07:00
|
|
|
Qt::TextElideMode elideMode() const;
|
|
|
|
void setElideMode(Qt::TextElideMode elide_mode);
|
|
|
|
|
2019-03-03 08:05:59 -06:00
|
|
|
QSize sizeHint() const final override;
|
|
|
|
|
2017-05-30 23:08:14 -07:00
|
|
|
private:
|
2019-03-03 08:05:59 -06:00
|
|
|
void paintEvent(QPaintEvent* event) final override;
|
2017-05-30 23:08:14 -07:00
|
|
|
Qt::TextElideMode m_elide_mode;
|
|
|
|
};
|