mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-29 16:53:31 -05:00
Changed statusbar hashing label to ElidedLabel
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7823 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
f9439f2bac
commit
7cf4ef4f8b
@ -260,7 +260,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags)
|
|||||||
statusBar()->addWidget(dhtstatus);
|
statusBar()->addWidget(dhtstatus);
|
||||||
|
|
||||||
hashingstatus = new HashingStatus();
|
hashingstatus = new HashingStatus();
|
||||||
statusBar()->addPermanentWidget(hashingstatus);
|
statusBar()->addPermanentWidget(hashingstatus, 1);
|
||||||
|
|
||||||
discstatus = new DiscStatus();
|
discstatus = new DiscStatus();
|
||||||
statusBar()->addPermanentWidget(discstatus);
|
statusBar()->addPermanentWidget(discstatus);
|
||||||
|
@ -24,31 +24,9 @@
|
|||||||
#include <QMovie>
|
#include <QMovie>
|
||||||
|
|
||||||
#include "hashingstatus.h"
|
#include "hashingstatus.h"
|
||||||
|
#include "gui/common/ElidedLabel.h"
|
||||||
#include "gui/notifyqt.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)
|
HashingStatus::HashingStatus(QWidget *parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
{
|
{
|
||||||
@ -63,12 +41,9 @@ HashingStatus::HashingStatus(QWidget *parent)
|
|||||||
hbox->addWidget(hashloader);
|
hbox->addWidget(hashloader);
|
||||||
|
|
||||||
movie->jumpToNextFrame(); // to calculate the real width
|
movie->jumpToNextFrame(); // to calculate the real width
|
||||||
statusHashing = new StatusLabel(hbox, movie->frameRect().width() + hbox->spacing(), this);
|
statusHashing = new ElidedLabel(this);
|
||||||
hbox->addWidget(statusHashing);
|
hbox->addWidget(statusHashing);
|
||||||
|
|
||||||
QSpacerItem *horizontalSpacer = new QSpacerItem(3000, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
|
||||||
hbox->addItem(horizontalSpacer);
|
|
||||||
|
|
||||||
_compactMode = false;
|
_compactMode = false;
|
||||||
|
|
||||||
setLayout(hbox);
|
setLayout(hbox);
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
class QLabel;
|
class QLabel;
|
||||||
|
class ElidedLabel;
|
||||||
|
|
||||||
class HashingStatus : public QWidget
|
class HashingStatus : public QWidget
|
||||||
{
|
{
|
||||||
@ -39,7 +40,8 @@ public slots:
|
|||||||
void updateHashingInfo(const QString&) ;
|
void updateHashingInfo(const QString&) ;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QLabel *statusHashing, *hashloader;
|
ElidedLabel *statusHashing;
|
||||||
|
QLabel *hashloader;
|
||||||
QMovie *movie;
|
QMovie *movie;
|
||||||
bool _compactMode;
|
bool _compactMode;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user