Commit 888d0792 authored by Victor Yacovlev's avatar Victor Yacovlev

UI: save button looks like Eclipse for unsaved file

parent 778934ea
......@@ -22,6 +22,7 @@ TabWidgetElement::TabWidgetElement(QWidget * w
, kumirProgram_(kumir)
, courseManagerTab_(false)
, documentHasChanges_(false)
, actionSave_(nullptr)
{
kumirProgram_ = nullptr;
Q_CHECK_PTR(w);
......@@ -81,6 +82,11 @@ TabWidgetElement::TabWidgetElement(QWidget * w
}
l->addWidget(w);
foreach (QAction * a, gr_fileActions->actions()) {
if (a->property("role").toString() == QString("save")) {
actionSave_ = a;
}
}
}
......@@ -94,6 +100,14 @@ void TabWidgetElement::setDocumentChangesClean(bool clean)
{
emit titleChanged(title());
}
if (actionSave_) {
foreach (QWidget * w, actionSave_->associatedWidgets()) {
if (QString(w->metaObject()->className()) == "QToolButton") {
QToolButton * btn = qobject_cast<QToolButton*>(w);
btn->setAutoRaise(clean);
}
}
}
}
QString TabWidgetElement::title() 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