Fix for HiDPI logo in About

Fix for #12322.
This commit is contained in:
Daniel Ramoeller 2023-03-11 17:58:35 +01:00 committed by Scott Kostyshak
parent 67ff56c63a
commit 7371a99256
2 changed files with 16 additions and 15 deletions

View File

@ -340,12 +340,14 @@ GuiAbout::GuiAbout(GuiView & lv)
d->ui.copyrightTB->append(disclaimer());
d->ui.versionLA->setText(version());
QPixmap icon = getPixmap("images/", "lyx", "svg,png");
int const iconsize = d->ui.versionLA->height() * 1.5;
d->ui.iconLA->setPixmap(icon.scaled(iconsize, iconsize,
Qt::IgnoreAspectRatio,
Qt::SmoothTransformation));
d->ui.iconLA->setFixedWidth(iconsize);
QString path = "images/";
QString name = "lyx";
QString ext = "svg";
FileName fname = imageLibFileSearch(path, name, ext, theGuiApp()->imageSearchMode());
QString fpath = toqstr(fname.absFileName());
d->ui.iconSW->load(fpath);
d->ui.iconSW->setFixedSize(iconsize, iconsize);
d->ui.dirLibraryLA->setText(dirLibrary());
d->ui.dirLibraryLA->adjustSize();
d->ui.dirUserLA->setText(dirUser());

View File

@ -33,22 +33,13 @@
<enum>QLayout::SetFixedSize</enum>
</property>
<item>
<widget class="QLabel" name="iconLA">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<widget class="QSvgWidget" name="iconSW" native="true">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="text">
<string notr="true">LyX Icon</string>
</property>
</widget>
</item>
<item>
@ -398,6 +389,14 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QSvgWidget</class>
<extends>QWidget</extends>
<header>QSvgWidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<includes>
<include location="local">qt_i18n.h</include>
</includes>