diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index 4d8eefc63..27b95136c 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -260,7 +260,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags) statusBar()->addWidget(dhtstatus); hashingstatus = new HashingStatus(); - statusBar()->addPermanentWidget(hashingstatus); + statusBar()->addPermanentWidget(hashingstatus, 1); discstatus = new DiscStatus(); statusBar()->addPermanentWidget(discstatus); diff --git a/retroshare-gui/src/gui/statusbar/hashingstatus.cpp b/retroshare-gui/src/gui/statusbar/hashingstatus.cpp index 536be0460..d24a264ff 100644 --- a/retroshare-gui/src/gui/statusbar/hashingstatus.cpp +++ b/retroshare-gui/src/gui/statusbar/hashingstatus.cpp @@ -24,31 +24,9 @@ #include #include "hashingstatus.h" - +#include "gui/common/ElidedLabel.h" #include "gui/notifyqt.h" -class StatusLabel : public QLabel -{ -public: - StatusLabel(QLayout *layout, int diffWidth, QWidget *parent = NULL, Qt::WindowFlags f = 0) : QLabel(parent, f) - { - m_layout = layout; - m_diffWidth = diffWidth; - } - - virtual QSize minimumSizeHint() const - { - const QSize sizeHint = QLabel::minimumSizeHint(); - - // do not resize the layout - return QSize(qMin(sizeHint.width(), m_layout->geometry().width() - m_diffWidth), sizeHint.height()); - } - -private: - QLayout *m_layout; - int m_diffWidth; -}; - HashingStatus::HashingStatus(QWidget *parent) : QWidget(parent) { @@ -63,12 +41,9 @@ HashingStatus::HashingStatus(QWidget *parent) hbox->addWidget(hashloader); movie->jumpToNextFrame(); // to calculate the real width - statusHashing = new StatusLabel(hbox, movie->frameRect().width() + hbox->spacing(), this); + statusHashing = new ElidedLabel(this); hbox->addWidget(statusHashing); - QSpacerItem *horizontalSpacer = new QSpacerItem(3000, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); - hbox->addItem(horizontalSpacer); - _compactMode = false; setLayout(hbox); diff --git a/retroshare-gui/src/gui/statusbar/hashingstatus.h b/retroshare-gui/src/gui/statusbar/hashingstatus.h index e21c1dafe..c26cbfc9a 100644 --- a/retroshare-gui/src/gui/statusbar/hashingstatus.h +++ b/retroshare-gui/src/gui/statusbar/hashingstatus.h @@ -24,6 +24,7 @@ #include class QLabel; +class ElidedLabel; class HashingStatus : public QWidget { @@ -39,7 +40,8 @@ public slots: void updateHashingInfo(const QString&) ; private: - QLabel *statusHashing, *hashloader; + ElidedLabel *statusHashing; + QLabel *hashloader; QMovie *movie; bool _compactMode; };