commit 7cbc0c16a841716fa8966e0f800ee2cdc0432e25
Author: Jean-Marc Lasgouttes <[email protected]>
Date: Fri Sep 23 11:17:20 2016 +0200
Simplify the code that sets the read-only emblem in status bar
Actually QIcon is able to handle transparently the svg icons.
Patch from Enrico.
---
src/frontends/qt4/GuiView.cpp | 12 +-----------
1 files changed, 1 insertions(+), 11 deletions(-)
diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp
index 10ec74e..fdc05a9 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -578,17 +578,7 @@ GuiView::GuiView(int id)
QFontMetrics const fm(statusBar()->fontMetrics());
int const roheight = max(int(d.normalIconSize), fm.height());
QSize const rosize(roheight, roheight);
- QPixmap readonly = QPixmap(rosize);
- QString imagedir = "images/";
- FileName fname = imageLibFileSearch(imagedir, "emblem-readonly",
"svgz");
- QSvgRenderer renderer(toqstr(fname.absFileName()));
- if (renderer.isValid()) {
-
readonly.fill(statusBar()->palette().color(QWidget::backgroundRole()));
- QPainter painter(&readonly);
- renderer.render(&painter);
- } else {
- readonly = getPixmap("images/", "emblem-readonly",
"png").scaled(rosize, Qt::KeepAspectRatio);
- }
+ QPixmap readonly = QIcon(getPixmap("images/", "emblem-readonly",
"svgz,png")).pixmap(rosize);
read_only_ = new QLabel(statusBar());
read_only_->setPixmap(readonly);
read_only_->setScaledContents(true);