Gui: increase pre-select information display

The pre-select sub-element string maybe clipped depending on the main
window size. This patch increased sub-element display width by
increasing MainWindow::showMessage text width and shortening pre-select
coordinate information.
This commit is contained in:
Zheng, Lei
2017-03-17 17:42:43 +08:00
committed by wmayer
parent 8093a95f71
commit f852e6b789
2 changed files with 19 additions and 15 deletions

View File

@@ -277,10 +277,10 @@ MainWindow::MainWindow(QWidget * parent, Qt::WindowFlags f)
// labels and progressbar
d->status = new StatusBarObserver();
d->actionLabel = new QLabel(statusBar());
d->actionLabel->setMinimumWidth(120);
// d->actionLabel->setMinimumWidth(120);
d->sizeLabel = new QLabel(tr("Dimension"), statusBar());
d->sizeLabel->setMinimumWidth(120);
statusBar()->addWidget(d->actionLabel, 0);
statusBar()->addWidget(d->actionLabel, 1);
QProgressBar* progressBar = Gui::Sequencer::instance()->getProgressBar(statusBar());
statusBar()->addPermanentWidget(progressBar, 0);
statusBar()->addPermanentWidget(d->sizeLabel, 0);
@@ -1550,7 +1550,7 @@ void MainWindow::changeEvent(QEvent *e)
void MainWindow::showMessage (const QString& message, int timeout)
{
QFontMetrics fm(statusBar()->font());
QString msg = fm.elidedText(message, Qt::ElideMiddle, this->width()/2);
QString msg = fm.elidedText(message, Qt::ElideMiddle, this->d->actionLabel->width());
#if QT_VERSION <= 0x040600
this->statusBar()->showMessage(msg, timeout);
#else