diff --git a/src/app/puzzle/vpmainwindow.cpp b/src/app/puzzle/vpmainwindow.cpp index 27fb1ded2..c9be83a3c 100644 --- a/src/app/puzzle/vpmainwindow.cpp +++ b/src/app/puzzle/vpmainwindow.cpp @@ -59,7 +59,8 @@ QT_WARNING_POP VPMainWindow::VPMainWindow(const VPCommandLinePtr &cmd, QWidget *parent) : VAbstractMainWindow(parent), ui(new Ui::VPMainWindow), - m_cmd(cmd) + m_cmd(cmd), + m_statusLabel(new QLabel(this)) { // create a standard sheet auto *sheet = new VPSheet(m_layout); @@ -90,6 +91,9 @@ VPMainWindow::VPMainWindow(const VPCommandLinePtr &cmd, QWidget *parent) : m_tileFactory = new VPTileFactory(m_layout, VPApplication::VApp()->Settings()); m_tileFactory->refreshTileInfos(); + // init status bar + statusBar()->addPermanentWidget(m_statusLabel, 1); + SetupMenu(); InitProperties(); InitCarrousel(); @@ -948,6 +952,12 @@ void VPMainWindow::on_actionNew_triggered() VPApplication::VApp()->NewMainWindow(); } +//--------------------------------------------------------------------------------------------------------------------- +void VPMainWindow::ShowToolTip(const QString &toolTip) +{ + m_statusLabel->setText(toolTip); +} + //--------------------------------------------------------------------------------------------------------------------- void VPMainWindow::closeEvent(QCloseEvent *event) { diff --git a/src/app/puzzle/vpmainwindow.h b/src/app/puzzle/vpmainwindow.h index 10bc7ece3..b2f68435e 100644 --- a/src/app/puzzle/vpmainwindow.h +++ b/src/app/puzzle/vpmainwindow.h @@ -90,6 +90,8 @@ public slots: */ void on_actionNew_triggered(); + virtual void ShowToolTip(const QString &toolTip) override; + protected: virtual void closeEvent(QCloseEvent *event) override; virtual void changeEvent(QEvent* event) override; @@ -415,6 +417,8 @@ private: */ QLabel* m_mouseCoordinate{nullptr}; + QLabel* m_statusLabel{nullptr}; + QString curFile{}; bool isInitialized{false};