]> git.lyx.org Git - lyx.git/commitdiff
Polish About dialog
authorJuergen Spitzmueller <spitz@lyx.org>
Sat, 15 Aug 2020 14:07:12 +0000 (16:07 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Sat, 15 Aug 2020 14:07:12 +0000 (16:07 +0200)
(this might need adaptation with HiDPI)

src/frontends/qt/GuiAbout.cpp
src/frontends/qt/ui/AboutUi.ui

index 8e720df6b33836ecfdeea12157194eb61ac4732c..d4790295834b9df25a161598c2f330e0e9d8b750 100644 (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());
 }
 
 
index 4db3359ff4d26df7f658d6fef431a43455b87fc2..9ae795d1fcfe226e2430ba7171f8e4c3dc54c449 100644 (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">
   <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">
       <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>
          </property>
         </spacer>
        </item>
-       <item>
+       <item row="2" column="0">
         <widget class="QGroupBox" name="gridGroupBox">
          <property name="title">
           <string>Library directory</string>
          </layout>
         </widget>
        </item>
-       <item>
+       <item row="3" column="0">
         <widget class="QGroupBox" name="gridGroupBox1">
          <property name="title">
           <string>User directory</string>