]> git.lyx.org Git - lyx.git/commitdiff
Indicate read-only status in tabs (#6783)
authorJuergen Spitzmueller <spitz@lyx.org>
Fri, 22 May 2015 08:41:12 +0000 (10:41 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Fri, 22 May 2015 08:41:12 +0000 (10:41 +0200)
lib/Makefile.am
lib/images/emblem-readonly.png [new file with mode: 0644]
lib/images/emblem-readonly.svgz [new file with mode: 0644]
src/frontends/qt4/GuiWorkArea.cpp

index 26cb880049d9f71d41ca46c8ad23bbe6ab9024b6..e5d45579e65f786f7300ce5cead63bb7935303ad 100644 (file)
@@ -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 (file)
index 0000000..516742e
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 (file)
index 0000000..5bff13b
Binary files /dev/null and b/lib/images/emblem-readonly.svgz differ
index fc1b1bd0946766b265551aea2b61f880938e5556..9f1f4a531609b105dc90ea17a2273e2b783da7c7 100644 (file)
@@ -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);
        }
 }