Skip to content
Snippets Groups Projects
Commit aee2f88a authored by Olivier SOLDANO's avatar Olivier SOLDANO Committed by Anthony Léonard
Browse files

refacto ring button


the button triggering the file selection now stays in a
correct shape when canceling the selection

Change-Id: I4384f3f815ec6ded857cf1e2d2b8901ae1f7f27d
Reviewed-by: default avatarAnthony Léonard <anthony.leonard@savoirfairelinux.com>
parent 1404f96e
No related branches found
No related tags found
No related merge requests found
...@@ -36,10 +36,19 @@ RingButton::~RingButton() ...@@ -36,10 +36,19 @@ RingButton::~RingButton()
void void
RingButton::setText(const QString& text) RingButton::setText(const QString& text)
{ {
if (! text.isEmpty() && ! text.isNull()) {
ui->button->setText(text); ui->button->setText(text);
ui->button->resize(ui->button->sizeHint().width(), ui->button->resize(ui->button->sizeHint().width(),
ui->button->sizeHint().height()); ui->button->sizeHint().height());
path_ = text;
} }
}
QString RingButton::text()
{
return path_;
}
void void
RingButton::mousePressEvent(QMouseEvent* event) RingButton::mousePressEvent(QMouseEvent* event)
......
...@@ -31,12 +31,12 @@ public: ...@@ -31,12 +31,12 @@ public:
explicit RingButton(QWidget* parent = 0); explicit RingButton(QWidget* parent = 0);
~RingButton(); ~RingButton();
void setText(const QString& text); void setText(const QString& text);
QString text();
protected:
void mousePressEvent(QMouseEvent* event);
private: private:
Ui::RingButton* ui; Ui::RingButton* ui;
QString path_ {};
void mousePressEvent(QMouseEvent* event);
signals: signals:
void clicked() const; void clicked() const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment