From 99b032e13203a22793431e61f38c73cbf02a66cb Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Tue, 5 Mar 2013 14:37:17 +0100 Subject: Improve the look and feel of Mac extension arrow This adds an improved extension arrow as well as a graphic for retina macs. Change-Id: Ie7395bbd87d6d354437bdbcc0cf258a27c09a360 Reviewed-by: Gabriel de Dietrich --- src/widgets/styles/images/toolbar-ext.png | Bin 0 -> 516 bytes src/widgets/styles/images/toolbar-ext@2x.png | Bin 0 -> 505 bytes src/widgets/styles/qmacstyle_mac.mm | 6 ++- src/widgets/styles/qmacstylepixmaps_mac_p.h | 72 --------------------------- src/widgets/styles/qstyle.qrc | 2 + src/widgets/styles/styles.pri | 1 - 6 files changed, 6 insertions(+), 75 deletions(-) create mode 100644 src/widgets/styles/images/toolbar-ext.png create mode 100644 src/widgets/styles/images/toolbar-ext@2x.png delete mode 100644 src/widgets/styles/qmacstylepixmaps_mac_p.h (limited to 'src') diff --git a/src/widgets/styles/images/toolbar-ext.png b/src/widgets/styles/images/toolbar-ext.png new file mode 100644 index 0000000000..37bd403ff8 Binary files /dev/null and b/src/widgets/styles/images/toolbar-ext.png differ diff --git a/src/widgets/styles/images/toolbar-ext@2x.png b/src/widgets/styles/images/toolbar-ext@2x.png new file mode 100644 index 0000000000..6fc729efb0 Binary files /dev/null and b/src/widgets/styles/images/toolbar-ext@2x.png differ diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index 203cf8c622..1eb78adeda 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -48,7 +48,6 @@ #include "qmacstyle_mac_p.h" #include "qmacstyle_mac_p_p.h" -#include "qmacstylepixmaps_mac_p.h" #define QMAC_QAQUASTYLE_SIZE_CONSTRAIN //#define DEBUG_SIZE_CONSTRAINT @@ -2375,6 +2374,9 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW case PM_MenuHMargin: ret = 0; break; + case PM_ToolBarExtensionExtent: + ret = 21; + break; case PM_ToolBarFrameWidth: ret = 1; if (widget) { @@ -6362,7 +6364,7 @@ QIcon QMacStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption *o return QCommonStyle::standardIcon(standardIcon, opt, widget); case SP_ToolBarHorizontalExtensionButton: case SP_ToolBarVerticalExtensionButton: { - QPixmap pixmap(qt_mac_toolbar_ext); + QPixmap pixmap(QLatin1String(":/qt-project.org/styles/macstyle/images/toolbar-ext.png")); if (standardIcon == SP_ToolBarVerticalExtensionButton) { QPixmap pix2(pixmap.height(), pixmap.width()); pix2.fill(Qt::transparent); diff --git a/src/widgets/styles/qmacstylepixmaps_mac_p.h b/src/widgets/styles/qmacstylepixmaps_mac_p.h deleted file mode 100644 index f76383a2d4..0000000000 --- a/src/widgets/styles/qmacstylepixmaps_mac_p.h +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMACSTYLEPIXMAPS_MAC_P_H -#define QMACSTYLEPIXMAPS_MAC_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -static const char * const qt_mac_toolbar_ext[]={ - "14 9 4 1", - "# c #858585", - "b c #d9d9d9", - ". c #dbdbdb", - "a c None", - ".###..###.aaaa", - "a.###..###.aaa", - "aab###bb###baa", - "aaab###bb###ba", - "aaaa.###..###.", - "aaa.###..###.a", - "aab###bb###baa", - "ab###bb###baaa", - ".###..###.aaaa"}; - -#endif // QMACSTYLEPIXMAPS_MAC_P_H diff --git a/src/widgets/styles/qstyle.qrc b/src/widgets/styles/qstyle.qrc index d835728928..28ad484032 100644 --- a/src/widgets/styles/qstyle.qrc +++ b/src/widgets/styles/qstyle.qrc @@ -133,5 +133,7 @@ images/closedock-down-16.png images/dockdock-16.png images/dockdock-down-16.png + images/toolbar-ext.png + images/toolbar-ext@2x.png diff --git a/src/widgets/styles/styles.pri b/src/widgets/styles/styles.pri index 109621988e..b39b17fd86 100644 --- a/src/widgets/styles/styles.pri +++ b/src/widgets/styles/styles.pri @@ -52,7 +52,6 @@ contains(QT_CONFIG, gtkstyle) { contains( styles, mac ) { HEADERS += \ styles/qmacstyle_mac_p.h \ - styles/qmacstylepixmaps_mac_p.h \ styles/qmacstyle_mac_p_p.h OBJECTIVE_SOURCES += styles/qmacstyle_mac.mm -- cgit v1.2.3