Qt: Replace the toolbar extension icon.

The QToolBar extension button icon is ugly, particularly on HiDPI
displays.  Replace it with a RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK.

Change-Id: I8822252ff5c328acd23aad345313e7cfafdffa47
Reviewed-on: https://code.wireshark.org/review/25821
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Gerald Combs 2018-02-16 11:47:35 -08:00 committed by Anders Broman
parent d0b9db8cd8
commit a9823dddf3
3 changed files with 19 additions and 2 deletions

View File

@ -6,6 +6,8 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later*/
#include <wsutil/utf8_entities.h>
#include <ui/qt/widgets/drag_drop_toolbar.h>
#include <ui/qt/widgets/drag_label.h>
#include <ui/qt/utils/wireshark_mime_data.h>
@ -27,15 +29,28 @@
DragDropToolBar::DragDropToolBar(const QString &title, QWidget *parent) :
QToolBar(title, parent)
{
childCounter = 0;
setAcceptDrops(true);
setupToolbar();
}
DragDropToolBar::DragDropToolBar(QWidget *parent) :
QToolBar(parent)
{
setupToolbar();
}
void DragDropToolBar::setupToolbar()
{
childCounter = 0;
setAcceptDrops(true);
// Each QToolBar has a QToolBarExtension button. Its icon looks
// terrible. We might want to create our own icon, but the double
// angle quote is a similar, nice-looking shape.
QToolButton *ext_button = findChild<QToolButton*>();
if (ext_button) {
ext_button->setIcon(QIcon());
ext_button->setText(UTF8_RIGHT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK);
}
}
DragDropToolBar::~DragDropToolBar()

View File

@ -41,6 +41,7 @@ private:
QPoint dragStartPosition;
int childCounter;
void setupToolbar();
void moveToolbarItems(int fromPos, int toPos);
};

View File

@ -36,6 +36,7 @@
#define UTF8_SUPERSCRIPT_TWO "\xc2\xb2" /* 178 / 0xb2 */
#define UTF8_MICRO_SIGN "\xc2\xb5" /* 181 / 0xb5 */
#define UTF8_MIDDLE_DOT "\xc2\xb7" /* 183 / 0xb7 */
#define UTF8_RIGHT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK "\xc2\xbb" /* 187 / 0xbb */
#define UTF8_BULLET "\xe2\x80\xa2" /* 8226 / 0x2024 */
#define UTF8_EM_DASH "\xe2\x80\x94" /* 8212 / 0x2014 */