From 7cbc0c16a841716fa8966e0f800ee2cdc0432e25 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Fri, 23 Sep 2016 11:17:20 +0200 Subject: [PATCH] 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 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 10ec74e684..fdc05a940d 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);