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 <gabriel.dedietrich@digia.com>
This commit is contained in:
Jens Bache-Wiig 2013-03-05 14:37:17 +01:00 committed by The Qt Project
parent 51216956b2
commit 99b032e132
6 changed files with 6 additions and 75 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 516 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 505 B

View File

@ -48,7 +48,6 @@
#include "qmacstyle_mac_p.h" #include "qmacstyle_mac_p.h"
#include "qmacstyle_mac_p_p.h" #include "qmacstyle_mac_p_p.h"
#include "qmacstylepixmaps_mac_p.h"
#define QMAC_QAQUASTYLE_SIZE_CONSTRAIN #define QMAC_QAQUASTYLE_SIZE_CONSTRAIN
//#define DEBUG_SIZE_CONSTRAINT //#define DEBUG_SIZE_CONSTRAINT
@ -2375,6 +2374,9 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW
case PM_MenuHMargin: case PM_MenuHMargin:
ret = 0; ret = 0;
break; break;
case PM_ToolBarExtensionExtent:
ret = 21;
break;
case PM_ToolBarFrameWidth: case PM_ToolBarFrameWidth:
ret = 1; ret = 1;
if (widget) { if (widget) {
@ -6362,7 +6364,7 @@ QIcon QMacStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption *o
return QCommonStyle::standardIcon(standardIcon, opt, widget); return QCommonStyle::standardIcon(standardIcon, opt, widget);
case SP_ToolBarHorizontalExtensionButton: case SP_ToolBarHorizontalExtensionButton:
case SP_ToolBarVerticalExtensionButton: { 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) { if (standardIcon == SP_ToolBarVerticalExtensionButton) {
QPixmap pix2(pixmap.height(), pixmap.width()); QPixmap pix2(pixmap.height(), pixmap.width());
pix2.fill(Qt::transparent); pix2.fill(Qt::transparent);

View File

@ -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

View File

@ -133,5 +133,7 @@
<file>images/closedock-down-16.png</file> <file>images/closedock-down-16.png</file>
<file>images/dockdock-16.png</file> <file>images/dockdock-16.png</file>
<file>images/dockdock-down-16.png</file> <file>images/dockdock-down-16.png</file>
<file>images/toolbar-ext.png</file>
<file>images/toolbar-ext@2x.png</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@ -52,7 +52,6 @@ contains(QT_CONFIG, gtkstyle) {
contains( styles, mac ) { contains( styles, mac ) {
HEADERS += \ HEADERS += \
styles/qmacstyle_mac_p.h \ styles/qmacstyle_mac_p.h \
styles/qmacstylepixmaps_mac_p.h \
styles/qmacstyle_mac_p_p.h styles/qmacstyle_mac_p_p.h
OBJECTIVE_SOURCES += styles/qmacstyle_mac.mm OBJECTIVE_SOURCES += styles/qmacstyle_mac.mm