From: Jean-Marc Lasgouttes Date: Fri, 23 Sep 2016 09:17:20 +0000 (+0200) Subject: Simplify the code that sets the read-only emblem in status bar X-Git-Tag: 2.3.0alpha1~966 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=7cbc0c16a841716fa8966e0f800ee2cdc0432e25;p=features.git 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. --- 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);