Qt: switch about#wireshark label to QTextBrowser.

QTextEdit supports the scrollbar. The drawback of having a scrollbar
is that we need to remove the space (on the right, at least). This change
switches from QLabel to QTextBrowser and removes the empty spaces and the
horizontal layout (not needed anymore). The resulting look is a mix
from the Authors tab and original look.

While on it, the default height has been increased to make room for the full
message (not needing the scrollbar with the defualt message) and the link
to the wireshark site has been made clickable.

Bug: 15375
Change-Id: Id0a10f366c0797c98264d3a1cad58a4dc11467e3
Reviewed-on: https://code.wireshark.org/review/31153
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Dario Lombardo 2018-12-20 21:32:08 +01:00 committed by Anders Broman
parent 4f557ea164
commit 2d57a56fa6
2 changed files with 23 additions and 59 deletions

View File

@ -313,9 +313,13 @@ AboutDialog::AboutDialog(QWidget *parent) :
message += "<p>" + html_escape(comp_info_str) + "</p>\n\n";
message += "<p>" + html_escape(runtime_info_str) + "</p>\n\n";
message += "<p>Wireshark is Open Source Software released under the GNU General Public License.</p>\n\n";
message += "<p>Check the man page and http://www.wireshark.org for more information.</p>\n\n";
message += "<p>Check the man page and ";
message += "<a href=http://www.wireshark.org>http://www.wireshark.org</a> ";
message += "for more information.</p>\n\n";
ui->label_wireshark->setText(message);
ui->pte_wireshark->setFrameStyle(QFrame::NoFrame);
ui->pte_wireshark->viewport()->setAutoFillBackground(false);
ui->pte_wireshark->setHtml(message);
/* Check if it is a dev release... (VERSION_MINOR is odd in dev release) */
#if VERSION_MINOR & 1

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>740</width>
<height>610</height>
<height>650</height>
</rect>
</property>
<property name="windowTitle">
@ -35,7 +35,7 @@
<attribute name="title">
<string>Wireshark</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,1,0,1">
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,1,0">
<item>
<widget class="QLabel" name="label_logo">
<property name="text">
@ -54,6 +54,12 @@
</item>
<item>
<widget class="QLabel" name="label_title">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>&lt;span size=\&quot;x-large\&quot; weight=\&quot;bold\&quot;&gt;Network Protocol Analyzer&lt;/span&gt;</string>
</property>
@ -63,63 +69,17 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_wireshark">
<property name="text">
<string/>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
<widget class="QTextBrowser" name="pte_wireshark">
<property name="readOnly">
<bool>true</bool>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</spacer>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>