ui: Fixed status messages influence window resizing (issue #372)
bug id = 372
This commit is contained in:
@@ -27,11 +27,14 @@ QtStatusBar::QtStatusBar()
|
||||
|
||||
m_text.setFlat(true);
|
||||
m_text.setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
|
||||
m_text.setSizePolicy(QSizePolicy::Ignored, m_text.sizePolicy().verticalPolicy());
|
||||
addWidget(&m_text, 1);
|
||||
setText("", false, false);
|
||||
|
||||
connect(&m_text, SIGNAL(clicked()), this, SLOT(showStatus()));
|
||||
|
||||
addPermanentWidget(&m_ideStatusText);
|
||||
|
||||
m_errorButton.hide();
|
||||
m_errorButton.setFlat(true);
|
||||
m_errorButton.setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
|
||||
@@ -43,9 +46,6 @@ QtStatusBar::QtStatusBar()
|
||||
addPermanentWidget(&m_errorButton);
|
||||
|
||||
connect(&m_errorButton, SIGNAL(clicked()), this, SLOT(showErrors()));
|
||||
|
||||
// m_ideStatusText.setText("No IDE connected"); // don't display this until all plugins support ping
|
||||
addWidget(&m_ideStatusText);
|
||||
}
|
||||
|
||||
QtStatusBar::~QtStatusBar()
|
||||
@@ -72,7 +72,8 @@ void QtStatusBar::setText(const std::string& text, bool isError, bool showLoader
|
||||
m_loader.hide();
|
||||
}
|
||||
|
||||
m_text.setText(m_text.fontMetrics().elidedText(QString::fromStdString(text), Qt::ElideRight, m_text.width()));
|
||||
m_textString = text;
|
||||
m_text.setText(m_text.fontMetrics().elidedText(QString::fromStdString(m_textString), Qt::ElideRight, m_text.width()));
|
||||
}
|
||||
|
||||
void QtStatusBar::setErrorCount(ErrorCountInfo errorCount)
|
||||
@@ -95,6 +96,11 @@ void QtStatusBar::setIdeStatus(const std::string& text)
|
||||
m_ideStatusText.setText(text.c_str());
|
||||
}
|
||||
|
||||
void QtStatusBar::resizeEvent(QResizeEvent* event)
|
||||
{
|
||||
m_text.setText(m_text.fontMetrics().elidedText(QString::fromStdString(m_textString), Qt::ElideRight, m_text.width()));
|
||||
}
|
||||
|
||||
void QtStatusBar::showStatus()
|
||||
{
|
||||
MessageShowStatus().dispatch();
|
||||
|
||||
@@ -23,11 +23,16 @@ public:
|
||||
|
||||
void setIdeStatus(const std::string& text);
|
||||
|
||||
protected:
|
||||
virtual void resizeEvent(QResizeEvent* event);
|
||||
|
||||
private slots:
|
||||
void showStatus();
|
||||
void showErrors();
|
||||
|
||||
private:
|
||||
std::string m_textString;
|
||||
|
||||
QPushButton m_text;
|
||||
QLabel m_loader;
|
||||
QPushButton m_errorButton;
|
||||
|
||||
Reference in New Issue
Block a user