From: Juergen Spitzmueller Date: Fri, 22 May 2015 08:41:12 +0000 (+0200) Subject: Indicate read-only status in tabs (#6783) X-Git-Tag: 2.2.0alpha1~694 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=1d266c8cfa06d15967dbbe4b186eb72d323cb1d4;p=lyx.git Indicate read-only status in tabs (#6783) --- diff --git a/lib/Makefile.am b/lib/Makefile.am index 26cb880049..e5d45579e6 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -441,6 +441,7 @@ dist_images_DATA1X = \ images/dialog-toggle_toc.png \ images/down.png \ images/editclear.png \ + images/emblem-readonly.png \ images/ert-insert.png \ images/file-open.png \ images/float-insert_figure.png \ diff --git a/lib/images/emblem-readonly.png b/lib/images/emblem-readonly.png new file mode 100644 index 0000000000..516742e395 Binary files /dev/null and b/lib/images/emblem-readonly.png differ diff --git a/lib/images/emblem-readonly.svgz b/lib/images/emblem-readonly.svgz new file mode 100644 index 0000000000..5bff13b8d9 Binary files /dev/null and b/lib/images/emblem-readonly.svgz differ diff --git a/src/frontends/qt4/GuiWorkArea.cpp b/src/frontends/qt4/GuiWorkArea.cpp index fc1b1bd094..9f1f4a5316 100644 --- a/src/frontends/qt4/GuiWorkArea.cpp +++ b/src/frontends/qt4/GuiWorkArea.cpp @@ -2011,8 +2011,14 @@ void TabWorkArea::updateTabTexts() QString tab_text = it->displayString().replace("&", "&&"); if (!buf.fileName().empty() && !buf.isClean()) 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); - setTabToolTip(tab_index, it->abs()); + setTabToolTip(tab_index, tab_tooltip); } }