refacto ring button
the button triggering the file selection now stays in a
correct shape when canceling the selection
Change-Id: I4384f3f815ec6ded857cf1e2d2b8901ae1f7f27d
Reviewed-by: Anthony Léonard <anthony.leonard@savoirfairelinux.com>
diff --git a/ringbutton.cpp b/ringbutton.cpp
index 7d7b56c..6de7a40 100644
--- a/ringbutton.cpp
+++ b/ringbutton.cpp
@@ -36,11 +36,20 @@
void
RingButton::setText(const QString& text)
{
- ui->button->setText(text);
- ui->button->resize(ui->button->sizeHint().width(),
- ui->button->sizeHint().height());
+ if (! text.isEmpty() && ! text.isNull()) {
+ ui->button->setText(text);
+ ui->button->resize(ui->button->sizeHint().width(),
+ ui->button->sizeHint().height());
+ path_ = text;
+ }
}
+QString RingButton::text()
+{
+ return path_;
+}
+
+
void
RingButton::mousePressEvent(QMouseEvent* event)
{