Polish About dialog

(this might need adaptation with HiDPI)
This commit is contained in:
Juergen Spitzmueller 2020-08-15 16:07:12 +02:00
parent cba24bb642
commit 5490e7545b
2 changed files with 82 additions and 60 deletions

View File

@ -258,14 +258,16 @@ static QString version()
from_ascii(lyx_version),
qstring_to_ucs4(loc_release_date))+"\n";
if (std::string(lyx_git_commit_hash) != "none")
version_date += _("Built from git commit hash ")
version_date += from_ascii("</p><p>") + _("Built from git commit hash ")
+ from_utf8(lyx_git_commit_hash).substr(0,8);
QString res;
QTextStream out(&res);
out << toqstr(version_date) << "\n";
out << toqstr(bformat(_("Qt Version (run-time): %1$s"), from_ascii(qVersion()))) << "\n";
out << toqstr("<html><head/><body><p><span style=\" font-weight:600;\">");
out << toqstr(version_date) << "</span></p><p>";
out << toqstr(bformat(_("Qt Version (run-time): %1$s"), from_ascii(qVersion()))) << "</p><p>";
out << toqstr(bformat(_("Qt Version (compile-time): %1$s"), from_ascii(QT_VERSION_STR)));
out << toqstr("</p></body></html>");
return res;
}
@ -299,9 +301,6 @@ GuiAbout::GuiAbout(GuiView & lv)
{
d->ui.setupUi(this);
// fix height to minimum
setFixedHeight(sizeHint().height());
d->ui.copyrightTB->setPlainText(copyright());
d->ui.copyrightTB->append(QString());
d->ui.copyrightTB->append(license());
@ -309,6 +308,11 @@ 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.dirLibraryLA->setText(dirLibrary());
d->ui.dirUserLA->setText(dirUser());
d->ui.buildinfoTB->setText(buildinfo());
@ -317,6 +321,9 @@ GuiAbout::GuiAbout(GuiView & lv)
d->ui.creditsTB->setHtml(credits());
d->ui.tab->setUsesScrollButtons(false);
// fix height to minimum
setFixedHeight(sizeHint().height());
}

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>424</width>
<height>376</height>
<height>409</height>
</rect>
</property>
<property name="windowTitle">
@ -16,22 +16,7 @@
<property name="sizeGripEnabled">
<bool>true</bool>
</property>
<layout class="QGridLayout">
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QTabWidget" name="tab">
<property name="currentIndex">
@ -41,42 +26,72 @@
<attribute name="title">
<string>Version</string>
</attribute>
<layout class="QVBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<item>
<widget class="QLabel" name="versionLA">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="text">
<string notr="true">&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;LyX version info goes here.&lt;/p&gt;&lt;p&gt;Qt version (run-time) goes here.&lt;/p&gt;&lt;p&gt;Qt version (compile-time) goes here.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="iconLA">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<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>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="versionLA">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="text">
<string notr="true">&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;LyX version info goes here.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Qt version (run-time) goes here.&lt;/p&gt;&lt;p&gt;Qt version (compile-time) goes here.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<item row="1" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -89,7 +104,7 @@
</property>
</spacer>
</item>
<item>
<item row="2" column="0">
<widget class="QGroupBox" name="gridGroupBox">
<property name="title">
<string>Library directory</string>
@ -136,7 +151,7 @@
</layout>
</widget>
</item>
<item>
<item row="3" column="0">
<widget class="QGroupBox" name="gridGroupBox1">
<property name="title">
<string>User directory</string>