Indicate read-only status in tabs (#6783)

This commit is contained in:
Juergen Spitzmueller 2015-05-22 10:41:12 +02:00
parent 7dc123b790
commit 1d266c8cfa
4 changed files with 8 additions and 1 deletions

View File

@ -441,6 +441,7 @@ dist_images_DATA1X = \
images/dialog-toggle_toc.png \ images/dialog-toggle_toc.png \
images/down.png \ images/down.png \
images/editclear.png \ images/editclear.png \
images/emblem-readonly.png \
images/ert-insert.png \ images/ert-insert.png \
images/file-open.png \ images/file-open.png \
images/float-insert_figure.png \ images/float-insert_figure.png \

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

View File

@ -2011,8 +2011,14 @@ void TabWorkArea::updateTabTexts()
QString tab_text = it->displayString().replace("&", "&&"); QString tab_text = it->displayString().replace("&", "&&");
if (!buf.fileName().empty() && !buf.isClean()) if (!buf.fileName().empty() && !buf.isClean())
tab_text += "*"; tab_text += "*";
QString tab_tooltip = it->abs();
if (buf.isReadonly()) {
setTabIcon(tab_index, QIcon(getPixmap("images/", "emblem-readonly", "svgz,png")));
tab_tooltip = qt_("%1 (read only)").arg(it->abs());
} else
setTabIcon(tab_index, QIcon());
setTabText(tab_index, tab_text); setTabText(tab_index, tab_text);
setTabToolTip(tab_index, it->abs()); setTabToolTip(tab_index, tab_tooltip);
} }
} }