Commit d4f6287d authored by Victor Yacovlev's avatar Victor Yacovlev

Compare values change to prevent extra repaint

parent 27541e75
...@@ -75,56 +75,64 @@ QSize StatusBar::minimumSizeHint() const ...@@ -75,56 +75,64 @@ QSize StatusBar::minimumSizeHint() const
void StatusBar::setState(ExtensionSystem::GlobalState state) void StatusBar::setState(ExtensionSystem::GlobalState state)
{ {
bool upd = state_ != state;
state_ = state; state_ = state;
update(); if (upd) update();
} }
void StatusBar::setMessage(const QString &message, MessageRole role) void StatusBar::setMessage(const QString &message, MessageRole role)
{ {
bool upd = message_ != message || messageRole_ != role;
message_ = message; message_ = message;
messageRole_ = role; messageRole_ = role;
update(); if (upd) update();
} }
void StatusBar::unsetMessage() void StatusBar::unsetMessage()
{ {
bool upd = message_.length() > 0;
message_.clear(); message_.clear();
messageRole_ = Normal; messageRole_ = Normal;
update(); if (upd) update();
} }
void StatusBar::setRecordIndicator(bool on) void StatusBar::setRecordIndicator(bool on)
{ {
bool upd = editorRecord_ != on;
editorRecord_ = on; editorRecord_ = on;
update(); if (upd) update();
} }
void StatusBar::setStepsDoneCounter(uint value) void StatusBar::setStepsDoneCounter(uint value)
{ {
bool upd = stepsDone_ != value;
stepsDone_ = value; stepsDone_ = value;
repaint(); if (upd) repaint();
} }
void StatusBar::setErrorsCounter(uint value) void StatusBar::setErrorsCounter(uint value)
{ {
bool upd = errorsCount_ != value;
errorsCount_ = value; errorsCount_ = value;
repaint(); if (upd) repaint();
} }
void StatusBar::setEditorCursorPosition(uint row, uint column) void StatusBar::setEditorCursorPosition(uint row, uint column)
{ {
bool upd = editorRow_ != row || editorColumn_ != column;
editorRow_ = row; editorRow_ = row;
editorColumn_ = column; editorColumn_ = column;
update(); if (upd) update();
} }
void StatusBar::setEditorKeyboardLayout(QLocale::Language lang, bool capslock, bool shift, bool alt) void StatusBar::setEditorKeyboardLayout(QLocale::Language lang, bool capslock, bool shift, bool alt)
{ {
bool upd = keyboardLayout_ != lang || keyboardCaps_ != capslock || keyboardShift_ != shift || keyboardAlt_ != alt;
keyboardLayout_ = lang; keyboardLayout_ = lang;
keyboardCaps_ = capslock; keyboardCaps_ = capslock;
keyboardShift_ = shift; keyboardShift_ = shift;
keyboardAlt_ = alt; keyboardAlt_ = alt;
update(); if (upd) update();
} }
QSize StatusBar::keyboardLayoutItemSize() const QSize StatusBar::keyboardLayoutItemSize() const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment