summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2018-10-05 13:52:57 +0200
committerEike Ziller <eike.ziller@qt.io>2019-01-15 14:33:56 +0000
commit3c5650e514d6d8bad86a54a037e550db7cc19a71 (patch)
tree6499046b274c1b6db57cba2505a208be29d35056
parent62c8aecb5fd950a56b17483bccd176f4f77245e4 (diff)
downloadqt-creator-3c5650e514d6d8bad86a54a037e550db7cc19a71.tar.gz
Add macOS touch bar support
Introduce a generic Utils::TouchBar that implements a touch bar for macOS based on QAction. Touch bars can be nested, and one is set to be the application's top level touch bar. Also add an ActionContainer for the touch bar. That allows us to manage the layout of the touch bar the same way we do with menus. Since the touch bar is an input device with very limited space, a command in the touch bar needs to be specifically styled for the touch bar by setting either touchBarText or touchBarIcon (or both). Touch bars can be nested by nesting the ActionContainers. A nested touch bar ActionContainer needs to specify an icon and/or text to show in the touch bar button that opens that sub-bar. Commands are only shown in the touch bar if they are valid within the current context. Implementation-wise we cannot use the standard NSPopoverTouchBarItem for nesting touch bar levels. We cannot hide items in the touch bar, because hidden items still take up space in the touch bar. So we need to rebuild the touch bar regularly. Since the items we show are very dynamic, every time the items in the toplevel bar change because of a context change, any opened sub-level touch bar closes. That is why we maintain a stack of touch bar levels ourselves, replacing the main touch bar with the current level, and managing opening and closing the levels manually. This patch adds buttons for Help, Bookmarks, Header/Source, Follow (Symbol), Decl/Def, and a sub-bar for the debugger actions. Fixes: QTCREATORBUG-21263 Change-Id: Ib63e610f21a993f1d324fe23c83a7f2224f434ac Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
-rw-r--r--src/libs/utils/images/macos_touchbar_bookmark.pngbin0 -> 192 bytes
-rw-r--r--src/libs/utils/images/macos_touchbar_bookmark@2x.pngbin0 -> 315 bytes
-rw-r--r--src/libs/utils/images/macos_touchbar_clear.pngbin0 -> 338 bytes
-rw-r--r--src/libs/utils/images/macos_touchbar_clear@2x.pngbin0 -> 692 bytes
-rw-r--r--src/libs/utils/proxyaction.cpp1
-rw-r--r--src/libs/utils/proxyaction.h3
-rw-r--r--src/libs/utils/touchbar/touchbar.cpp102
-rw-r--r--src/libs/utils/touchbar/touchbar.h68
-rw-r--r--src/libs/utils/touchbar/touchbar.pri17
-rw-r--r--src/libs/utils/touchbar/touchbar_appdelegate_mac.mm151
-rw-r--r--src/libs/utils/touchbar/touchbar_appdelegate_mac_p.h61
-rw-r--r--src/libs/utils/touchbar/touchbar_mac.mm317
-rw-r--r--src/libs/utils/touchbar/touchbar_mac_p.h73
-rw-r--r--src/libs/utils/utils-lib.pri3
-rw-r--r--src/libs/utils/utils.qrc4
-rw-r--r--src/libs/utils/utilsicons.cpp4
-rw-r--r--src/libs/utils/utilsicons.h2
-rw-r--r--src/plugins/bookmarks/bookmarksplugin.cpp3
-rw-r--r--src/plugins/coreplugin/actionmanager/actioncontainer.cpp185
-rw-r--r--src/plugins/coreplugin/actionmanager/actioncontainer.h3
-rw-r--r--src/plugins/coreplugin/actionmanager/actioncontainer_p.h70
-rw-r--r--src/plugins/coreplugin/actionmanager/actionmanager.cpp21
-rw-r--r--src/plugins/coreplugin/actionmanager/actionmanager.h3
-rw-r--r--src/plugins/coreplugin/actionmanager/command.cpp38
-rw-r--r--src/plugins/coreplugin/actionmanager/command.h6
-rw-r--r--src/plugins/coreplugin/actionmanager/command_p.h11
-rw-r--r--src/plugins/coreplugin/coreconstants.h9
-rw-r--r--src/plugins/coreplugin/coreplugin.h1
-rw-r--r--src/plugins/coreplugin/mainwindow.cpp11
-rw-r--r--src/plugins/cppeditor/cppeditorplugin.cpp7
-rw-r--r--src/plugins/debugger/debugger.qrc14
-rw-r--r--src/plugins/debugger/debuggericons.cpp14
-rw-r--r--src/plugins/debugger/debuggericons.h8
-rw-r--r--src/plugins/debugger/debuggerplugin.cpp17
-rw-r--r--src/plugins/debugger/images/macos_touchbar_debug.pngbin0 -> 359 bytes
-rw-r--r--src/plugins/debugger/images/macos_touchbar_debug@2x.pngbin0 -> 696 bytes
-rw-r--r--src/plugins/debugger/images/macos_touchbar_debug_continue.pngbin0 -> 348 bytes
-rw-r--r--src/plugins/debugger/images/macos_touchbar_debug_continue@2x.pngbin0 -> 666 bytes
-rw-r--r--src/plugins/debugger/images/macos_touchbar_debug_exit.pngbin0 -> 309 bytes
-rw-r--r--src/plugins/debugger/images/macos_touchbar_debug_exit@2x.pngbin0 -> 599 bytes
-rw-r--r--src/plugins/debugger/images/macos_touchbar_debug_interrupt.pngbin0 -> 312 bytes
-rw-r--r--src/plugins/debugger/images/macos_touchbar_debug_interrupt@2x.pngbin0 -> 604 bytes
-rw-r--r--src/plugins/debugger/images/macos_touchbar_debug_step_into.pngbin0 -> 245 bytes
-rw-r--r--src/plugins/debugger/images/macos_touchbar_debug_step_into@2x.pngbin0 -> 467 bytes
-rw-r--r--src/plugins/debugger/images/macos_touchbar_debug_step_out.pngbin0 -> 237 bytes
-rw-r--r--src/plugins/debugger/images/macos_touchbar_debug_step_out@2x.pngbin0 -> 412 bytes
-rw-r--r--src/plugins/debugger/images/macos_touchbar_debug_step_over.pngbin0 -> 287 bytes
-rw-r--r--src/plugins/debugger/images/macos_touchbar_debug_step_over@2x.pngbin0 -> 527 bytes
-rw-r--r--src/plugins/help/help.qrc2
-rw-r--r--src/plugins/help/helpplugin.cpp4
-rw-r--r--src/plugins/help/images/macos_touchbar_help.pngbin0 -> 411 bytes
-rw-r--r--src/plugins/help/images/macos_touchbar_help@2x.pngbin0 -> 832 bytes
-rw-r--r--src/shared/help/helpicons.h2
-rw-r--r--src/tools/icons/qtcreatoricons.svg340
54 files changed, 1506 insertions, 69 deletions
diff --git a/src/libs/utils/images/macos_touchbar_bookmark.png b/src/libs/utils/images/macos_touchbar_bookmark.png
new file mode 100644
index 0000000000..0960816040
--- /dev/null
+++ b/src/libs/utils/images/macos_touchbar_bookmark.png
Binary files differ
diff --git a/src/libs/utils/images/macos_touchbar_bookmark@2x.png b/src/libs/utils/images/macos_touchbar_bookmark@2x.png
new file mode 100644
index 0000000000..6b2e5a4179
--- /dev/null
+++ b/src/libs/utils/images/macos_touchbar_bookmark@2x.png
Binary files differ
diff --git a/src/libs/utils/images/macos_touchbar_clear.png b/src/libs/utils/images/macos_touchbar_clear.png
new file mode 100644
index 0000000000..496d71e775
--- /dev/null
+++ b/src/libs/utils/images/macos_touchbar_clear.png
Binary files differ
diff --git a/src/libs/utils/images/macos_touchbar_clear@2x.png b/src/libs/utils/images/macos_touchbar_clear@2x.png
new file mode 100644
index 0000000000..ee1b4c4004
--- /dev/null
+++ b/src/libs/utils/images/macos_touchbar_clear@2x.png
Binary files differ
diff --git a/src/libs/utils/proxyaction.cpp b/src/libs/utils/proxyaction.cpp
index 67917e71b1..bc17dea580 100644
--- a/src/libs/utils/proxyaction.cpp
+++ b/src/libs/utils/proxyaction.cpp
@@ -42,6 +42,7 @@ void ProxyAction::setAction(QAction *action)
m_action = action;
connectAction();
updateState();
+ emit currentActionChanged(action);
}
void ProxyAction::updateState()
diff --git a/src/libs/utils/proxyaction.h b/src/libs/utils/proxyaction.h
index 900376cf1f..99554f87f8 100644
--- a/src/libs/utils/proxyaction.h
+++ b/src/libs/utils/proxyaction.h
@@ -60,6 +60,9 @@ public:
static QString stringWithAppendedShortcut(const QString &str, const QKeySequence &shortcut);
static ProxyAction *proxyActionWithIcon(QAction *original, const QIcon &newIcon);
+signals:
+ void currentActionChanged(QAction *action);
+
private:
void actionChanged();
void updateState();
diff --git a/src/libs/utils/touchbar/touchbar.cpp b/src/libs/utils/touchbar/touchbar.cpp
new file mode 100644
index 0000000000..191fae385f
--- /dev/null
+++ b/src/libs/utils/touchbar/touchbar.cpp
@@ -0,0 +1,102 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt Creator.
+**
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+****************************************************************************/
+
+#include "touchbar.h"
+
+namespace Utils {
+namespace Internal {
+
+class TouchBarPrivate
+{
+public:
+ QByteArray m_id;
+ QAction m_action;
+};
+
+} // namespace Internal
+
+TouchBar::TouchBar(const QByteArray &id, const QIcon &icon, const QString &title)
+ : d(new Internal::TouchBarPrivate)
+{
+ d->m_id = id;
+ d->m_action.setIcon(icon);
+ d->m_action.setText(title);
+}
+
+TouchBar::TouchBar(const QByteArray &id, const QIcon &icon)
+ : TouchBar(id, icon, {})
+{
+}
+
+TouchBar::TouchBar(const QByteArray &id, const QString &title)
+ : TouchBar(id, {}, title)
+{
+}
+
+TouchBar::TouchBar(const QByteArray &id)
+ : TouchBar(id, {}, {})
+{
+}
+
+TouchBar::~TouchBar()
+{
+ delete d;
+}
+
+QByteArray TouchBar::id() const
+{
+ return d->m_id;
+}
+
+QAction *TouchBar::touchBarAction() const
+{
+ return &d->m_action;
+}
+
+void TouchBar::insertAction(QAction *, const QByteArray &, QAction *)
+{
+}
+
+void TouchBar::insertTouchBar(QAction *, TouchBar *)
+{
+}
+
+void TouchBar::removeAction(QAction *)
+{
+}
+
+void TouchBar::removeTouchBar(TouchBar *)
+{
+}
+
+void TouchBar::clear()
+{
+}
+
+void TouchBar::setApplicationTouchBar()
+{
+}
+
+} // namespace Utils
diff --git a/src/libs/utils/touchbar/touchbar.h b/src/libs/utils/touchbar/touchbar.h
new file mode 100644
index 0000000000..d00a33c4c9
--- /dev/null
+++ b/src/libs/utils/touchbar/touchbar.h
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt Creator.
+**
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+****************************************************************************/
+
+#pragma once
+
+#include <utils/utils_global.h>
+
+#include <QAction>
+#include <QByteArray>
+#include <QIcon>
+#include <QString>
+
+namespace Utils {
+
+namespace Internal {
+class TouchBarPrivate;
+}
+
+class QTCREATOR_UTILS_EXPORT TouchBar
+{
+public:
+ TouchBar(const QByteArray &id, const QIcon &icon, const QString &title);
+ TouchBar(const QByteArray &id, const QIcon &icon);
+ TouchBar(const QByteArray &id, const QString &title);
+ TouchBar(const QByteArray &id);
+
+ ~TouchBar();
+
+ QByteArray id() const;
+
+ QAction *touchBarAction() const;
+
+ void insertAction(QAction *before, const QByteArray &id, QAction *action);
+ void insertTouchBar(QAction *before, TouchBar *touchBar);
+
+ void removeAction(QAction *action);
+ void removeTouchBar(TouchBar *touchBar);
+ void clear();
+
+ void setApplicationTouchBar();
+
+private:
+ Internal::TouchBarPrivate *d;
+};
+
+} // namespace Utils
diff --git a/src/libs/utils/touchbar/touchbar.pri b/src/libs/utils/touchbar/touchbar.pri
new file mode 100644
index 0000000000..8d60ee423b
--- /dev/null
+++ b/src/libs/utils/touchbar/touchbar.pri
@@ -0,0 +1,17 @@
+HEADERS += $$PWD/touchbar.h
+
+macos {
+ HEADERS += \
+ $$PWD/touchbar_mac_p.h \
+ $$PWD/touchbar_appdelegate_mac_p.h
+
+ OBJECTIVE_SOURCES += \
+ $$PWD/touchbar_mac.mm \
+ $$PWD/touchbar_appdelegate_mac.mm
+
+ QT += macextras
+ LIBS += -framework Foundation -framework AppKit
+} else {
+ SOURCES += $$PWD/touchbar.cpp
+}
+
diff --git a/src/libs/utils/touchbar/touchbar_appdelegate_mac.mm b/src/libs/utils/touchbar/touchbar_appdelegate_mac.mm
new file mode 100644
index 0000000000..e921695fdc
--- /dev/null
+++ b/src/libs/utils/touchbar/touchbar_appdelegate_mac.mm
@@ -0,0 +1,151 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt Creator.
+**
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+****************************************************************************/
+
+#include "touchbar_appdelegate_mac_p.h"
+#include "touchbar_mac_p.h"
+
+#include <stack>
+
+#import <AppKit/NSTouchBar.h>
+
+Q_GLOBAL_STATIC(Utils::Internal::ApplicationDelegate, staticApplicationDelegate);
+
+namespace Utils {
+namespace Internal {
+
+ApplicationDelegate *ApplicationDelegate::instance()
+{
+ return staticApplicationDelegate;
+}
+
+ApplicationDelegate::ApplicationDelegate()
+{
+ applicationDelegate = [[ApplicationDelegateImpl alloc] init];
+ [applicationDelegate installAsDelegateForApplication:[NSApplication sharedApplication]];
+}
+
+ApplicationDelegate::~ApplicationDelegate()
+{
+ [applicationDelegate release];
+}
+
+void ApplicationDelegate::setApplicationTouchBar(TouchBarPrivate *touchBar)
+{
+ [applicationDelegate setApplicationTouchBar: touchBar];
+}
+
+void ApplicationDelegate::pushTouchBar(TouchBarPrivate *touchBar)
+{
+ [applicationDelegate pushTouchBar: touchBar];
+}
+
+void ApplicationDelegate::popTouchBar()
+{
+ [applicationDelegate popTouchBar];
+}
+
+} // Internal
+} // Utils
+
+using namespace Utils::Internal;
+
+@implementation ApplicationDelegateImpl {
+ std::stack<TouchBarPrivate *> touchBarStack;
+}
+@synthesize qtDelegate;
+
+- (id)init
+{
+ self = [super init];
+ return self;
+}
+
+- (void)setApplicationTouchBar:(TouchBarPrivate *)bar
+{
+ while (!touchBarStack.empty())
+ [self popTouchBar];
+ [self pushTouchBar:bar];
+}
+
+- (void)pushTouchBar:(TouchBarPrivate *)bar
+{
+ if (!touchBarStack.empty())
+ touchBarStack.top()->m_invalidate = [](){}; // do nothing
+ touchBarStack.push(bar);
+ if (bar)
+ bar->m_invalidate = []() { staticApplicationDelegate->applicationDelegate.touchBar = nil; };
+ self.touchBar = nil; // force re-build
+}
+
+- (void)popTouchBar
+{
+ if (!touchBarStack.empty()) {
+ touchBarStack.top()->m_invalidate = [](){}; // do nothing
+ touchBarStack.pop();
+ if (!touchBarStack.empty()) {
+ touchBarStack.top()->m_invalidate = [](){
+ staticApplicationDelegate->applicationDelegate.touchBar = nil;
+ };
+ }
+ self.touchBar = nil; // force re-build
+ }
+}
+
+- (NSTouchBar *)makeTouchBar
+{
+ if (!touchBarStack.empty())
+ return [touchBarStack.top()->m_delegate makeTouchBar];
+ return nil;
+}
+
+- (void)installAsDelegateForApplication:(NSApplication *)application
+{
+ self.qtDelegate = application.delegate;
+ application.delegate = self;
+}
+
+- (BOOL)respondsToSelector:(SEL)aSelector
+{
+ // We want to forward to the Qt delegate. Respond to selectors it
+ // responds to in addition to selectors this instance resonds to.
+ return [self.qtDelegate respondsToSelector:aSelector] || [super respondsToSelector:aSelector];
+}
+
+- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector
+{
+ if ([super respondsToSelector:aSelector])
+ return [super methodSignatureForSelector:aSelector];
+ return [self.qtDelegate methodSignatureForSelector:aSelector];
+}
+
+- (void)forwardInvocation:(NSInvocation *)anInvocation
+{
+ // Forward to the existing delegate. This function is only called for selectors
+ // this instance does not responds to, which means that the Qt delegate
+ // must respond to it (due to the respondsToSelector implementation above).
+ [anInvocation invokeWithTarget:self.qtDelegate];
+}
+
+@end
diff --git a/src/libs/utils/touchbar/touchbar_appdelegate_mac_p.h b/src/libs/utils/touchbar/touchbar_appdelegate_mac_p.h
new file mode 100644
index 0000000000..da2f8e4e07
--- /dev/null
+++ b/src/libs/utils/touchbar/touchbar_appdelegate_mac_p.h
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt Creator.
+**
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+****************************************************************************/
+
+#pragma once
+
+#include "touchbar.h"
+
+#import <AppKit/NSApplication.h>
+
+@interface ApplicationDelegateImpl : NSResponder <NSApplicationDelegate>
+@property (strong, atomic) NSObject *qtDelegate;
+
+- (id)init;
+- (void)installAsDelegateForApplication:(NSApplication *)application;
+- (void)setApplicationTouchBar:(Utils::Internal::TouchBarPrivate *)bar;
+- (void)pushTouchBar:(Utils::Internal::TouchBarPrivate *)bar;
+- (void)popTouchBar;
+
+@end
+
+namespace Utils {
+namespace Internal {
+
+class ApplicationDelegate
+{
+public:
+ static ApplicationDelegate *instance();
+
+ ApplicationDelegate();
+ ~ApplicationDelegate();
+ void setApplicationTouchBar(TouchBarPrivate *touchBar);
+ void pushTouchBar(TouchBarPrivate *touchBar);
+ void popTouchBar();
+
+ ApplicationDelegateImpl *applicationDelegate;
+};
+
+} // Internal
+} // Utils
diff --git a/src/libs/utils/touchbar/touchbar_mac.mm b/src/libs/utils/touchbar/touchbar_mac.mm
new file mode 100644
index 0000000000..67c83aec0c
--- /dev/null
+++ b/src/libs/utils/touchbar/touchbar_mac.mm
@@ -0,0 +1,317 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt Creator.
+**
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+****************************************************************************/
+
+#include "touchbar.h"
+#include "touchbar_mac_p.h"
+#include "touchbar_appdelegate_mac_p.h"
+
+#include <utils/utilsicons.h>
+
+#include <QtMac>
+
+#import <AppKit/NSButton.h>
+#import <AppKit/NSCustomTouchBarItem.h>
+#import <AppKit/NSImage.h>
+#import <AppKit/NSPopoverTouchBarItem.h>
+
+namespace Utils {
+
+TouchBar::TouchBar(const QByteArray &id, const QIcon &icon, const QString &title)
+ : d(new Internal::TouchBarPrivate)
+{
+ d->m_id = id;
+ d->m_action.setIcon(icon);
+ d->m_action.setText(title);
+ d->m_invalidate = []() {}; // safe-guard, do nothing by default
+ d->m_delegate = [[TouchBarDelegate alloc] initWithParent:d];
+}
+
+TouchBar::~TouchBar()
+{
+ // clean up connections to the QActions
+ clear();
+ delete d;
+}
+
+TouchBar::TouchBar(const QByteArray &id, const QIcon &icon)
+ : TouchBar(id, icon, {})
+{
+}
+
+TouchBar::TouchBar(const QByteArray &id, const QString &title)
+ : TouchBar(id, {}, title)
+{
+}
+
+TouchBar::TouchBar(const QByteArray &id)
+ : TouchBar(id, {}, {})
+{
+}
+
+QByteArray TouchBar::id() const
+{
+ return d->m_id;
+}
+
+QAction *TouchBar::touchBarAction() const
+{
+ return &d->m_action;
+}
+
+void TouchBar::insertAction(QAction *before, const QByteArray &id, QAction *action)
+{
+ const QMetaObject::Connection connection = QObject::connect(action,
+ &QAction::changed,
+ [this]() { d->m_invalidate(); });
+ const auto item = std::find_if(d->m_items.begin(), d->m_items.end(),
+ [before](const Internal::TouchBarItem &item) {
+ return item.action == before;
+ });
+ d->m_items.insert(item, {id, connection, action, nullptr});
+ d->m_invalidate();
+}
+
+void TouchBar::insertTouchBar(QAction *before, TouchBar *touchBar)
+{
+ const QMetaObject::Connection connection = QObject::connect(touchBar->touchBarAction(),
+ &QAction::changed,
+ [this]() { d->m_invalidate(); });
+ const auto item = std::find_if(d->m_items.begin(), d->m_items.end(),
+ [before](const Internal::TouchBarItem &item) {
+ return item.action == before;
+ });
+ d->m_items.insert(item, {touchBar->id(), connection, touchBar->touchBarAction(), touchBar->d});
+ d->m_invalidate();
+}
+
+void TouchBar::removeAction(QAction *action)
+{
+ const auto item = std::find_if(d->m_items.begin(), d->m_items.end(),
+ [action](const Internal::TouchBarItem &item) {
+ return item.action == action;
+ });
+ if (item != d->m_items.end()) {
+ QObject::disconnect(item->updateConnection);
+ d->m_items.erase(item);
+ }
+ d->m_invalidate();
+}
+
+void TouchBar::removeTouchBar(TouchBar *touchBar)
+{
+ removeAction(touchBar->touchBarAction());
+}
+
+void TouchBar::clear()
+{
+ for (const Internal::TouchBarItem &item : d->m_items)
+ QObject::disconnect(item.updateConnection);
+ d->m_items.clear();
+ d->m_invalidate();
+}
+
+void TouchBar::setApplicationTouchBar()
+{
+ Internal::ApplicationDelegate::instance()->setApplicationTouchBar(d);
+}
+
+} // namespace Utils
+
+using namespace Utils::Internal;
+
+static NSImage *iconToTemplateNSImage(const QIcon &icon)
+{
+ // touch bar icons are max 18-22 pts big. our are always 22 pts big.
+ const QPixmap pixmap = icon.pixmap(22);
+ NSImage *image = QtMac::toNSImage(pixmap);
+ // toNSImage ignores devicePixelRatio, so fixup after the fact
+ const CGFloat userWidth = pixmap.width() / pixmap.devicePixelRatio();
+ const CGFloat userHeight = pixmap.height() / pixmap.devicePixelRatio();
+ image.size = CGSizeMake(userWidth, userHeight); // scales the image
+ [image setTemplate:YES];
+ return image;
+}
+
+// NSButton that delegates trigger to QAction's trigger.
+// State (enabled/visible) is not synced since that triggers a touch bar rebuild anyhow.
+
+@interface QActionNSButton : NSButton
+@property (readonly, atomic) QAction *qaction;
++ (QActionNSButton *)buttonWithQAction:(QAction *)qaction;
+@end
+
+@implementation QActionNSButton
+@synthesize qaction = _qaction;
+
+- (void)trigger:(id)sender
+{
+ Q_UNUSED(sender)
+ self.qaction->trigger();
+}
+
+- (id)initWithQAction:(QAction *)qaction
+{
+ self = [super init];
+ [self setButtonType:NSButtonTypeMomentaryPushIn];
+ self.bezelStyle = NSRoundedBezelStyle;
+ self.target = self;
+ self.action = @selector(trigger:);
+ _qaction = qaction;
+ if (!self.qaction->text().isEmpty())
+ self.title = self.qaction->text().toNSString();
+ if (!self.qaction->icon().isNull())
+ self.image = iconToTemplateNSImage(self.qaction->icon());
+ self.enabled = self.qaction->isEnabled();
+ return self;
+}
+
++ (QActionNSButton *)buttonWithQAction:(QAction *)qaction
+{
+ return [[[QActionNSButton alloc] initWithQAction:qaction] autorelease];
+}
+
+@end
+
+@interface PopoverButton : NSButton
+@property (readonly, atomic) TouchBarPrivate *parent;
++ (PopoverButton *)buttonWithTouchBar:(TouchBarPrivate *)parent;
+@end
+
+@implementation PopoverButton
+@synthesize parent = _parent;
+
+- (PopoverButton *)initWithTouchBar:(TouchBarPrivate *)parent
+{
+ self = [super init];
+ [self setButtonType:NSButtonTypeMomentaryPushIn];
+ self.bezelStyle = NSRoundedBezelStyle;
+ self.target = self;
+ self.action = @selector(trigger:);
+ _parent = parent;
+ if (!self.parent->m_action.text().isEmpty())
+ self.title = self.parent->m_action.text().toNSString();
+ if (!self.parent->m_action.icon().isNull())
+ self.image = iconToTemplateNSImage(self.parent->m_action.icon());
+ return self;
+}
+
+- (void)trigger:(id)sender
+{
+ Q_UNUSED(sender)
+ ApplicationDelegate::instance()->pushTouchBar(self.parent);
+}
+
++ (PopoverButton *)buttonWithTouchBar:(TouchBarPrivate *)parent
+{
+ return [[[PopoverButton alloc] initWithTouchBar:parent] autorelease];
+}
+
+@end
+
+@implementation TouchBarDelegate
+@synthesize parent = _parent;
+@synthesize closeButtonIdentifier;
+
+- (id)initWithParent:(TouchBarPrivate *)parent
+{
+ self = [super init];
+ _parent = parent;
+ const QByteArray closeIdentifier = parent->m_id + ".close";
+ self.closeButtonIdentifier = QString::fromUtf8(closeIdentifier).toNSString();
+ return self;
+}
+
+- (NSTouchBar *)makeTouchBar
+{
+ NSTouchBar *touchBar = [[NSTouchBar alloc] init];
+ touchBar.delegate = self;
+ NSMutableArray<NSTouchBarItemIdentifier> *items
+ = [[[NSMutableArray<NSTouchBarItemIdentifier> alloc] init] autorelease];
+ if (self.parent->m_isSubBar) {
+ // add a close button
+ [items addObject:self.closeButtonIdentifier];
+ }
+ for (const TouchBarItem &item : self.parent->m_items) {
+ // Touch bar items that are hidden still take up space in the touch bar, so
+ // only include actions that are visible
+ if (item.action && item.action->isVisible()) {
+ [items addObject:QString::fromUtf8(item.id).toNSString()];
+ }
+ }
+ touchBar.defaultItemIdentifiers = items;
+ return touchBar;
+}
+
+- (void)popTouchBar:(id)sender
+{
+ Q_UNUSED(sender)
+ ApplicationDelegate::instance()->popTouchBar();
+}
+
+- (NSTouchBarItem *)touchBar:(NSTouchBar *)touchBar
+ makeItemForIdentifier:(NSTouchBarItemIdentifier)identifier
+{
+ Q_UNUSED(touchBar)
+ if ([identifier isEqualToString:self.closeButtonIdentifier]) {
+ NSCustomTouchBarItem *item = [[[NSCustomTouchBarItem alloc] initWithIdentifier:identifier]
+ autorelease];
+ NSButton *button = [NSButton buttonWithImage:iconToTemplateNSImage(Utils::Icons::MACOS_TOUCHBAR_CLEAR.icon())
+ target:self
+ action:@selector(popTouchBar:)];
+ button.bordered = NO;
+ item.view = button;
+ return item;
+ }
+ const auto itemId = QString::fromNSString(identifier).toUtf8();
+ const std::vector<TouchBarItem> &items = self.parent->m_items;
+ const auto actionPos = std::find_if(items.begin(), items.end(),
+ [itemId](const TouchBarItem &item) {
+ return item.id == itemId;
+ });
+ Q_ASSERT(actionPos != items.end());
+ if (actionPos->touchBar) {
+ // The default popover item does not work for us, because it closes when the touch bar
+ // is rebuilt on context changes.
+ // Create a custom popover item that actually replaces the application touch bar with the
+ // sub bar when activated
+ actionPos->touchBar->m_isSubBar = true;
+ NSCustomTouchBarItem *item = [[[NSCustomTouchBarItem alloc] initWithIdentifier:identifier]
+ autorelease];
+ PopoverButton *button = [PopoverButton buttonWithTouchBar:actionPos->touchBar];
+ item.view = button;
+ // keep buttons for subcontainers visible
+ item.visibilityPriority = NSTouchBarItemPriorityHigh;
+ return item;
+ } else if (actionPos->action) {
+ NSCustomTouchBarItem *item = [[[NSCustomTouchBarItem alloc] initWithIdentifier:identifier]
+ autorelease];
+ QActionNSButton *button = [QActionNSButton buttonWithQAction:actionPos->action];
+ item.view = button;
+ return item;
+ }
+ return nil;
+}
+
+@end
diff --git a/src/libs/utils/touchbar/touchbar_mac_p.h b/src/libs/utils/touchbar/touchbar_mac_p.h
new file mode 100644
index 0000000000..c86132fd59
--- /dev/null
+++ b/src/libs/utils/touchbar/touchbar_mac_p.h
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt Creator.
+**
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+****************************************************************************/
+
+#pragma once
+
+#include <QAction>
+#include <QByteArray>
+
+#include <functional>
+#include <vector>
+
+namespace Utils {
+namespace Internal {
+class TouchBarPrivate;
+} // Internal
+} // Utils
+
+#import <AppKit/NSTouchBar.h>
+
+@interface TouchBarDelegate : NSObject <NSTouchBarDelegate>
+@property (atomic) Utils::Internal::TouchBarPrivate *parent;
+@property (retain, atomic) NSString *closeButtonIdentifier;
+
+- (id)initWithParent:(Utils::Internal::TouchBarPrivate *)parent;
+
+@end
+
+namespace Utils {
+namespace Internal {
+
+struct TouchBarItem
+{
+ QByteArray id;
+ QMetaObject::Connection updateConnection;
+ QAction *action = nullptr;
+ TouchBarPrivate *touchBar = nullptr;
+};
+
+class TouchBarPrivate
+{
+public:
+ QByteArray m_id;
+ QAction m_action;
+ std::vector<TouchBarItem> m_items;
+ std::function<void()> m_invalidate;
+ TouchBarDelegate *m_delegate;
+ bool m_isSubBar = false;
+};
+
+} // Internal
+} // Utils
diff --git a/src/libs/utils/utils-lib.pri b/src/libs/utils/utils-lib.pri
index 0960ab82c7..7de3faefc9 100644
--- a/src/libs/utils/utils-lib.pri
+++ b/src/libs/utils/utils-lib.pri
@@ -277,11 +277,14 @@ osx {
HEADERS += \
$$PWD/theme/theme_mac.h \
$$PWD/fileutils_mac.h
+
OBJECTIVE_SOURCES += \
$$PWD/theme/theme_mac.mm \
$$PWD/fileutils_mac.mm \
$$PWD/processhandle_mac.mm
+
LIBS += -framework Foundation -framework AppKit
}
+include(touchbar/touchbar.pri)
include(mimetypes/mimetypes.pri)
diff --git a/src/libs/utils/utils.qrc b/src/libs/utils/utils.qrc
index a19903f09b..6ad7dd3196 100644
--- a/src/libs/utils/utils.qrc
+++ b/src/libs/utils/utils.qrc
@@ -209,6 +209,10 @@
<file>images/lightbulbcap@2x.png</file>
<file>images/toolbuttonexpandarrow.png</file>
<file>images/toolbuttonexpandarrow@2x.png</file>
+ <file>images/macos_touchbar_bookmark.png</file>
+ <file>images/macos_touchbar_bookmark@2x.png</file>
+ <file>images/macos_touchbar_clear.png</file>
+ <file>images/macos_touchbar_clear@2x.png</file>
</qresource>
<qresource prefix="/codemodel">
<file>images/enum.png</file>
diff --git a/src/libs/utils/utilsicons.cpp b/src/libs/utils/utilsicons.cpp
index a441ff3e81..9855165c3e 100644
--- a/src/libs/utils/utilsicons.cpp
+++ b/src/libs/utils/utilsicons.cpp
@@ -255,6 +255,10 @@ const Icon CODEMODEL_FIXIT({
{":/utils/images/lightbulbcap.png", Theme::PanelTextColorMid},
{":/utils/images/lightbulb.png", Theme::IconsWarningColor}}, Icon::Tint);
+const Icon MACOS_TOUCHBAR_BOOKMARK(
+ ":/utils/images/macos_touchbar_bookmark.png");
+const Icon MACOS_TOUCHBAR_CLEAR(
+ ":/utils/images/macos_touchbar_clear.png");
} // namespace Icons
QIcon CodeModelIcon::iconForType(CodeModelIcon::Type type)
diff --git a/src/libs/utils/utilsicons.h b/src/libs/utils/utilsicons.h
index b5cf0801ef..b229523911 100644
--- a/src/libs/utils/utilsicons.h
+++ b/src/libs/utils/utilsicons.h
@@ -144,6 +144,8 @@ QTCREATOR_UTILS_EXPORT extern const Icon CODEMODEL_DISABLED_ERROR;
QTCREATOR_UTILS_EXPORT extern const Icon CODEMODEL_DISABLED_WARNING;
QTCREATOR_UTILS_EXPORT extern const Icon CODEMODEL_FIXIT;
+QTCREATOR_UTILS_EXPORT extern const Icon MACOS_TOUCHBAR_BOOKMARK;
+QTCREATOR_UTILS_EXPORT extern const Icon MACOS_TOUCHBAR_CLEAR;
} // namespace Icons
namespace CodeModelIcon {
diff --git a/src/plugins/bookmarks/bookmarksplugin.cpp b/src/plugins/bookmarks/bookmarksplugin.cpp
index cdc1cd30d1..344313d8f0 100644
--- a/src/plugins/bookmarks/bookmarksplugin.cpp
+++ b/src/plugins/bookmarks/bookmarksplugin.cpp
@@ -98,6 +98,7 @@ BookmarksPluginRunData::BookmarksPluginRunData()
, m_bookmarkViewFactory(&m_bookmarkManager)
{
ActionContainer *mtools = ActionManager::actionContainer(Core::Constants::M_TOOLS);
+ ActionContainer *touchBar = ActionManager::actionContainer(Core::Constants::TOUCH_BAR);
ActionContainer *mbm = ActionManager::createMenu(Id(BOOKMARKS_MENU));
mbm->menu()->setTitle(BookmarksPlugin::tr("&Bookmarks"));
mtools->addMenu(mbm);
@@ -109,7 +110,9 @@ BookmarksPluginRunData::BookmarksPluginRunData()
editorManagerContext);
cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? BookmarksPlugin::tr("Meta+M")
: BookmarksPlugin::tr("Ctrl+M")));
+ cmd->setTouchBarIcon(Utils::Icons::MACOS_TOUCHBAR_BOOKMARK.icon());
mbm->addAction(cmd);
+ touchBar->addAction(cmd, Core::Constants::G_TOUCHBAR_EDITOR);
mbm->addSeparator();
diff --git a/src/plugins/coreplugin/actionmanager/actioncontainer.cpp b/src/plugins/coreplugin/actionmanager/actioncontainer.cpp
index 9ec6b20ea2..d604adf4e6 100644
--- a/src/plugins/coreplugin/actionmanager/actioncontainer.cpp
+++ b/src/plugins/coreplugin/actionmanager/actioncontainer.cpp
@@ -30,7 +30,6 @@
#include <coreplugin/icontext.h>
#include <coreplugin/id.h>
-#include <utils/hostosinfo.h>
#include <utils/qtcassert.h>
#include <QDebug>
@@ -40,6 +39,8 @@
Q_DECLARE_METATYPE(Core::Internal::MenuActionContainer*)
+using namespace Utils;
+
namespace Core {
namespace Internal {
@@ -50,8 +51,8 @@ namespace Internal {
\brief The ActionContainer class represents a menu or menu bar in Qt Creator.
You don't create instances of this class directly, but instead use the
- \l{ActionManager::createMenu()}
- and \l{ActionManager::createMenuBar()} functions.
+ \l{ActionManager::createMenu()}, \l{ActionManager::createMenuBar()} and
+ \l{ActionManager::createTouchBar()} functions.
Retrieve existing action containers for an ID with
\l{ActionManager::actionContainer()}.
@@ -206,6 +207,17 @@ QAction *ActionContainerPrivate::insertLocation(Id groupId) const
return insertLocation(it);
}
+QAction *ActionContainerPrivate::actionForItem(QObject *item) const
+{
+ if (auto cmd = qobject_cast<Command *>(item)) {
+ return cmd->action();
+ } else if (auto container = qobject_cast<ActionContainerPrivate *>(item)) {
+ if (container->containerAction())
+ return container->containerAction();
+ }
+ QTC_ASSERT(false, return nullptr);
+}
+
QAction *ActionContainerPrivate::insertLocation(QList<Group>::const_iterator group) const
{
if (group == m_groups.constEnd())
@@ -214,13 +226,9 @@ QAction *ActionContainerPrivate::insertLocation(QList<Group>::const_iterator gro
while (group != m_groups.constEnd()) {
if (!group->items.isEmpty()) {
QObject *item = group->items.first();
- if (auto cmd = qobject_cast<Command *>(item)) {
- return cmd->action();
- } else if (auto container = qobject_cast<ActionContainer *>(item)) {
- if (container->menu())
- return container->menu()->menuAction();
- }
- QTC_ASSERT(false, return nullptr);
+ QAction *action = actionForItem(item);
+ if (action)
+ return action;
}
++group;
}
@@ -236,38 +244,37 @@ void ActionContainerPrivate::addAction(Command *command, Id groupId)
QList<Group>::const_iterator groupIt = findGroup(actualGroupId);
QTC_ASSERT(groupIt != m_groups.constEnd(), qDebug() << "Can't find group"
<< groupId.name() << "in container" << id().name(); return);
- QAction *beforeAction = insertLocation(groupIt);
- m_groups[groupIt-m_groups.constBegin()].items.append(command);
-
+ m_groups[groupIt - m_groups.constBegin()].items.append(command);
connect(command, &Command::activeStateChanged, this, &ActionContainerPrivate::scheduleUpdate);
connect(command, &QObject::destroyed, this, &ActionContainerPrivate::itemDestroyed);
- insertAction(beforeAction, command->action());
+
+ QAction *beforeAction = insertLocation(groupIt);
+ insertAction(beforeAction, command);
+
scheduleUpdate();
}
void ActionContainerPrivate::addMenu(ActionContainer *menu, Id groupId)
{
auto containerPrivate = static_cast<ActionContainerPrivate *>(menu);
- if (!containerPrivate->canBeAddedToMenu())
- return;
+ QTC_ASSERT(containerPrivate->canBeAddedToContainer(this), return);
- auto container = static_cast<MenuActionContainer *>(containerPrivate);
const Id actualGroupId = groupId.isValid() ? groupId : Id(Constants::G_DEFAULT_TWO);
QList<Group>::const_iterator groupIt = findGroup(actualGroupId);
QTC_ASSERT(groupIt != m_groups.constEnd(), return);
+ m_groups[groupIt - m_groups.constBegin()].items.append(menu);
+ connect(menu, &QObject::destroyed, this, &ActionContainerPrivate::itemDestroyed);
+
QAction *beforeAction = insertLocation(groupIt);
- m_groups[groupIt-m_groups.constBegin()].items.append(menu);
+ insertMenu(beforeAction, menu);
- connect(menu, &QObject::destroyed, this, &ActionContainerPrivate::itemDestroyed);
- insertMenu(beforeAction, container->menu());
scheduleUpdate();
}
void ActionContainerPrivate::addMenu(ActionContainer *before, ActionContainer *menu)
{
auto containerPrivate = static_cast<ActionContainerPrivate *>(menu);
- if (!containerPrivate->canBeAddedToMenu())
- return;
+ QTC_ASSERT(containerPrivate->canBeAddedToContainer(this), return);
QMutableListIterator<Group> it(m_groups);
while (it.hasNext()) {
@@ -278,11 +285,13 @@ void ActionContainerPrivate::addMenu(ActionContainer *before, ActionContainer *m
break;
}
}
-
connect(menu, &QObject::destroyed, this, &ActionContainerPrivate::itemDestroyed);
- auto container = static_cast<MenuActionContainer *>(containerPrivate);
- QAction *beforeAction = before->menu()->menuAction();
- insertMenu(beforeAction, container->menu());
+
+ auto beforePrivate = static_cast<ActionContainerPrivate *>(before);
+ QAction *beforeAction = beforePrivate->containerAction();
+ if (beforeAction)
+ insertMenu(beforeAction, menu);
+
scheduleUpdate();
}
@@ -315,7 +324,7 @@ void ActionContainerPrivate::clear()
Group &group = it.next();
foreach (QObject *item, group.items) {
if (auto command = qobject_cast<Command *>(item)) {
- removeAction(command->action());
+ removeAction(command);
disconnect(command, &Command::activeStateChanged,
this, &ActionContainerPrivate::scheduleUpdate);
disconnect(command, &QObject::destroyed, this, &ActionContainerPrivate::itemDestroyed);
@@ -323,7 +332,7 @@ void ActionContainerPrivate::clear()
container->clear();
disconnect(container, &QObject::destroyed,
this, &ActionContainerPrivate::itemDestroyed);
- removeMenu(container->menu());
+ removeMenu(container);
}
}
group.items.clear();
@@ -357,6 +366,11 @@ QMenuBar *ActionContainerPrivate::menuBar() const
return nullptr;
}
+TouchBar *ActionContainerPrivate::touchBar() const
+{
+ return nullptr;
+}
+
bool ActionContainerPrivate::canAddAction(Command *action) const
{
return action && action->action();
@@ -402,24 +416,33 @@ QMenu *MenuActionContainer::menu() const
return m_menu;
}
-void MenuActionContainer::insertAction(QAction *before, QAction *action)
+QAction *MenuActionContainer::containerAction() const
{
- m_menu->insertAction(before, action);
+ return m_menu->menuAction();
}
-void MenuActionContainer::insertMenu(QAction *before, QMenu *menu)
+void MenuActionContainer::insertAction(QAction *before, Command *command)
{
+ m_menu->insertAction(before, command->action());
+}
+
+void MenuActionContainer::insertMenu(QAction *before, ActionContainer *container)
+{
+ QMenu *menu = container->menu();
+ QTC_ASSERT(menu, return);
menu->setParent(m_menu, menu->windowFlags()); // work around issues with Qt Wayland (QTBUG-68636)
m_menu->insertMenu(before, menu);
}
-void MenuActionContainer::removeAction(QAction *action)
+void MenuActionContainer::removeAction(Command *command)
{
- m_menu->removeAction(action);
+ m_menu->removeAction(command->action());
}
-void MenuActionContainer::removeMenu(QMenu *menu)
+void MenuActionContainer::removeMenu(ActionContainer *container)
{
+ QMenu *menu = container->menu();
+ QTC_ASSERT(menu, return);
m_menu->removeAction(menu->menuAction());
}
@@ -480,12 +503,12 @@ bool MenuActionContainer::updateInternal()
return hasitems;
}
-bool MenuActionContainer::canBeAddedToMenu() const
+bool MenuActionContainer::canBeAddedToContainer(ActionContainerPrivate *container) const
{
- return true;
+ return qobject_cast<MenuActionContainer *>(container)
+ || qobject_cast<MenuBarActionContainer *>(container);
}
-
// ---------- MenuBarActionContainer ------------
/*!
@@ -509,24 +532,33 @@ QMenuBar *MenuBarActionContainer::menuBar() const
return m_menuBar;
}
-void MenuBarActionContainer::insertAction(QAction *before, QAction *action)
+QAction *MenuBarActionContainer::containerAction() const
+{
+ return nullptr;
+}
+
+void MenuBarActionContainer::insertAction(QAction *before, Command *command)
{
- m_menuBar->insertAction(before, action);
+ m_menuBar->insertAction(before, command->action());
}
-void MenuBarActionContainer::insertMenu(QAction *before, QMenu *menu)
+void MenuBarActionContainer::insertMenu(QAction *before, ActionContainer *container)
{
+ QMenu *menu = container->menu();
+ QTC_ASSERT(menu, return);
menu->setParent(m_menuBar, menu->windowFlags()); // work around issues with Qt Wayland (QTBUG-68636)
m_menuBar->insertMenu(before, menu);
}
-void MenuBarActionContainer::removeAction(QAction *action)
+void MenuBarActionContainer::removeAction(Command *command)
{
- m_menuBar->removeAction(action);
+ m_menuBar->removeAction(command->action());
}
-void MenuBarActionContainer::removeMenu(QMenu *menu)
+void MenuBarActionContainer::removeMenu(ActionContainer *container)
{
+ QMenu *menu = container->menu();
+ QTC_ASSERT(menu, return);
m_menuBar->removeAction(menu->menuAction());
}
@@ -552,7 +584,72 @@ bool MenuBarActionContainer::updateInternal()
return hasitems;
}
-bool MenuBarActionContainer::canBeAddedToMenu() const
+bool MenuBarActionContainer::canBeAddedToContainer(ActionContainerPrivate *) const
+{
+ return false;
+}
+
+// ---------- TouchBarActionContainer ------------
+
+const char ID_PREFIX[] = "io.qt.qtcreator.";
+
+TouchBarActionContainer::TouchBarActionContainer(Id id, const QIcon &icon, const QString &text)
+ : ActionContainerPrivate(id),
+ m_touchBar(std::make_unique<TouchBar>(id.withPrefix(ID_PREFIX).name(), icon, text))
+{
+}
+
+TouchBarActionContainer::~TouchBarActionContainer() = default;
+
+TouchBar *TouchBarActionContainer::touchBar() const
+{
+ return m_touchBar.get();
+}
+
+QAction *TouchBarActionContainer::containerAction() const
+{
+ return m_touchBar->touchBarAction();
+}
+
+QAction *TouchBarActionContainer::actionForItem(QObject *item) const
+{
+ if (Command *command = qobject_cast<Command *>(item))
+ return command->touchBarAction();
+ return ActionContainerPrivate::actionForItem(item);
+}
+
+void TouchBarActionContainer::insertAction(QAction *before, Command *command)
+{
+ m_touchBar->insertAction(before,
+ command->id().withPrefix(ID_PREFIX).name(),
+ command->touchBarAction());
+}
+
+void TouchBarActionContainer::insertMenu(QAction *before, ActionContainer *container)
+{
+ TouchBar *touchBar = container->touchBar();
+ QTC_ASSERT(touchBar, return);
+ m_touchBar->insertTouchBar(before, touchBar);
+}
+
+void TouchBarActionContainer::removeAction(Command *command)
+{
+ m_touchBar->removeAction(command->touchBarAction());
+}
+
+void TouchBarActionContainer::removeMenu(ActionContainer *container)
+{
+ TouchBar *touchBar = container->touchBar();
+ QTC_ASSERT(touchBar, return);
+ m_touchBar->removeTouchBar(touchBar);
+}
+
+bool TouchBarActionContainer::canBeAddedToContainer(ActionContainerPrivate *container) const
+{
+ return qobject_cast<TouchBarActionContainer *>(container);
+}
+
+bool TouchBarActionContainer::updateInternal()
{
return false;
}
diff --git a/src/plugins/coreplugin/actionmanager/actioncontainer.h b/src/plugins/coreplugin/actionmanager/actioncontainer.h
index 1cd13c42c2..d86e6e63e4 100644
--- a/src/plugins/coreplugin/actionmanager/actioncontainer.h
+++ b/src/plugins/coreplugin/actionmanager/actioncontainer.h
@@ -36,6 +36,8 @@ class QMenuBar;
class QAction;
QT_END_NAMESPACE
+namespace Utils { class TouchBar; }
+
namespace Core {
class Command;
@@ -58,6 +60,7 @@ public:
virtual QMenu *menu() const = 0;
virtual QMenuBar *menuBar() const = 0;
+ virtual Utils::TouchBar *touchBar() const = 0;
virtual QAction *insertLocation(Id group) const = 0;
virtual void appendGroup(Id group) = 0;
diff --git a/src/plugins/coreplugin/actionmanager/actioncontainer_p.h b/src/plugins/coreplugin/actionmanager/actioncontainer_p.h
index c78310b7b2..124f21259b 100644
--- a/src/plugins/coreplugin/actionmanager/actioncontainer_p.h
+++ b/src/plugins/coreplugin/actionmanager/actioncontainer_p.h
@@ -30,6 +30,8 @@
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/command.h>
+#include <utils/touchbar/touchbar.h>
+
namespace Core {
namespace Internal {
@@ -64,19 +66,23 @@ public:
QMenu *menu() const override;
QMenuBar *menuBar() const override;
+ Utils::TouchBar *touchBar() const override;
+
+ virtual QAction *containerAction() const = 0;
+ virtual QAction *actionForItem(QObject *item) const;
- virtual void insertAction(QAction *before, QAction *action) = 0;
- virtual void insertMenu(QAction *before, QMenu *menu) = 0;
+ virtual void insertAction(QAction *before, Command *command) = 0;
+ virtual void insertMenu(QAction *before, ActionContainer *container) = 0;
- virtual void removeAction(QAction *action) = 0;
- virtual void removeMenu(QMenu *menu) = 0;
+ virtual void removeAction(Command *command) = 0;
+ virtual void removeMenu(ActionContainer *container) = 0;
virtual bool updateInternal() = 0;
protected:
bool canAddAction(Command *action) const;
bool canAddMenu(ActionContainer *menu) const;
- virtual bool canBeAddedToMenu() const = 0;
+ virtual bool canBeAddedToContainer(ActionContainerPrivate *container) const = 0;
// groupId --> list of Command* and ActionContainer*
QList<Group> m_groups;
@@ -96,20 +102,24 @@ private:
class MenuActionContainer : public ActionContainerPrivate
{
+ Q_OBJECT
+
public:
explicit MenuActionContainer(Id id);
~MenuActionContainer() override;
QMenu *menu() const override;
- void insertAction(QAction *before, QAction *action) override;
- void insertMenu(QAction *before, QMenu *menu) override;
+ QAction *containerAction() const override;
+
+ void insertAction(QAction *before, Command *command) override;
+ void insertMenu(QAction *before, ActionContainer *container) override;
- void removeAction(QAction *action) override;
- void removeMenu(QMenu *menu) override;
+ void removeAction(Command *command) override;
+ void removeMenu(ActionContainer *container) override;
protected:
- bool canBeAddedToMenu() const override;
+ bool canBeAddedToContainer(ActionContainerPrivate *container) const override;
bool updateInternal() override;
private:
@@ -118,25 +128,55 @@ private:
class MenuBarActionContainer : public ActionContainerPrivate
{
+ Q_OBJECT
+
public:
explicit MenuBarActionContainer(Id id);
void setMenuBar(QMenuBar *menuBar);
QMenuBar *menuBar() const override;
- void insertAction(QAction *before, QAction *action) override;
- void insertMenu(QAction *before, QMenu *menu) override;
+ QAction *containerAction() const override;
+
+ void insertAction(QAction *before, Command *command) override;
+ void insertMenu(QAction *before, ActionContainer *container) override;
- void removeAction(QAction *action) override;
- void removeMenu(QMenu *menu) override;
+ void removeAction(Command *command) override;
+ void removeMenu(ActionContainer *container) override;
protected:
- bool canBeAddedToMenu() const override;
+ bool canBeAddedToContainer(ActionContainerPrivate *container) const override;
bool updateInternal() override;
private:
QMenuBar *m_menuBar;
};
+class TouchBarActionContainer : public ActionContainerPrivate
+{
+ Q_OBJECT
+
+public:
+ TouchBarActionContainer(Id id, const QIcon &icon, const QString &text);
+ ~TouchBarActionContainer() override;
+
+ Utils::TouchBar *touchBar() const override;
+
+ QAction *containerAction() const override;
+ QAction *actionForItem(QObject *item) const override;
+
+ void insertAction(QAction *before, Command *command) override;
+ void insertMenu(QAction *before, ActionContainer *container) override;
+
+ void removeAction(Command *command) override;
+ void removeMenu(ActionContainer *container) override;
+
+ bool canBeAddedToContainer(ActionContainerPrivate *container) const override;
+ bool updateInternal() override;
+
+private:
+ std::unique_ptr<Utils::TouchBar> m_touchBar;
+};
+
} // namespace Internal
} // namespace Core
diff --git a/src/plugins/coreplugin/actionmanager/actionmanager.cpp b/src/plugins/coreplugin/actionmanager/actionmanager.cpp
index 9b2bec82dc..ca0d39ca78 100644
--- a/src/plugins/coreplugin/actionmanager/actionmanager.cpp
+++ b/src/plugins/coreplugin/actionmanager/actionmanager.cpp
@@ -232,6 +232,27 @@ ActionContainer *ActionManager::createMenuBar(Id id)
}
/*!
+ Creates a touch bar with the given \a id.
+
+ Returns a new ActionContainer that you can use to add items to a (sub) touch bar.
+ Note that it is only possible to create a single level of sub touch bars.
+ The sub touch bar will be represented as a button with \a icon and \a text (one can be left
+ empty), which opens the sub touch bar when touched.
+ The ActionManager owns the returned ActionContainer.
+*/
+ActionContainer *ActionManager::createTouchBar(Id id, const QIcon &icon, const QString &text)
+{
+ QTC_CHECK(!icon.isNull() || !text.isEmpty());
+ ActionContainer * const c = d->m_idContainerMap.value(id);
+ if (c)
+ return c;
+ auto ac = new TouchBarActionContainer(id, icon, text);
+ d->m_idContainerMap.insert(id, ac);
+ connect(ac, &QObject::destroyed, d, &ActionManagerPrivate::containerDestroyed);
+ return ac;
+}
+
+/*!
Makes an \a action known to the system under the specified \a id.
Returns a command object that represents the action in the application and is
diff --git a/src/plugins/coreplugin/actionmanager/actionmanager.h b/src/plugins/coreplugin/actionmanager/actionmanager.h
index 2b692a206e..20d56bfb21 100644
--- a/src/plugins/coreplugin/actionmanager/actionmanager.h
+++ b/src/plugins/coreplugin/actionmanager/actionmanager.h
@@ -57,6 +57,9 @@ public:
static ActionContainer *createMenu(Id id);
static ActionContainer *createMenuBar(Id id);
+ static ActionContainer *createTouchBar(Id id,
+ const QIcon &icon,
+ const QString &text = QString());
static Command *registerAction(QAction *action, Id id,
const Context &context = Context(Constants::C_GLOBAL),
diff --git a/src/plugins/coreplugin/actionmanager/command.cpp b/src/plugins/coreplugin/actionmanager/command.cpp
index c74dbedb10..25ed98ae96 100644
--- a/src/plugins/coreplugin/actionmanager/command.cpp
+++ b/src/plugins/coreplugin/actionmanager/command.cpp
@@ -414,6 +414,44 @@ bool Action::hasAttribute(Command::CommandAttribute attr) const
return (m_attributes & attr);
}
+void Action::setTouchBarText(const QString &text)
+{
+ m_touchBarText = text;
+}
+
+QString Action::touchBarText() const
+{
+ return m_touchBarText;
+}
+
+void Action::setTouchBarIcon(const QIcon &icon)
+{
+ m_touchBarIcon = icon;
+}
+
+QIcon Action::touchBarIcon() const
+{
+ return m_touchBarIcon;
+}
+
+QAction *Action::touchBarAction() const
+{
+ if (!m_touchBarAction) {
+ m_touchBarAction = std::make_unique<Utils::ProxyAction>();
+ m_touchBarAction->initialize(m_action);
+ m_touchBarAction->setIcon(m_touchBarIcon);
+ m_touchBarAction->setText(m_touchBarText);
+ // the touch bar action should be hidden if the command is not valid for the context
+ m_touchBarAction->setAttribute(Utils::ProxyAction::Hide);
+ m_touchBarAction->setAction(m_action->action());
+ connect(m_action,
+ &Utils::ProxyAction::currentActionChanged,
+ m_touchBarAction.get(),
+ &Utils::ProxyAction::setAction);
+ }
+ return m_touchBarAction.get();
+}
+
} // namespace Internal
void Command::augmentActionWithShortcutToolTip(QAction *a) const
diff --git a/src/plugins/coreplugin/actionmanager/command.h b/src/plugins/coreplugin/actionmanager/command.h
index 123b673346..355507de12 100644
--- a/src/plugins/coreplugin/actionmanager/command.h
+++ b/src/plugins/coreplugin/actionmanager/command.h
@@ -86,6 +86,12 @@ public:
virtual bool isScriptable() const = 0;
virtual bool isScriptable(const Context &) const = 0;
+ virtual void setTouchBarText(const QString &text) = 0;
+ virtual QString touchBarText() const = 0;
+ virtual void setTouchBarIcon(const QIcon &icon) = 0;
+ virtual QIcon touchBarIcon() const = 0;
+ virtual QAction *touchBarAction() const = 0;
+
signals:
void keySequenceChanged();
void activeStateChanged();
diff --git a/src/plugins/coreplugin/actionmanager/command_p.h b/src/plugins/coreplugin/actionmanager/command_p.h
index 6b8734ad14..9811c88fb6 100644
--- a/src/plugins/coreplugin/actionmanager/command_p.h
+++ b/src/plugins/coreplugin/actionmanager/command_p.h
@@ -38,6 +38,8 @@
#include <QMap>
#include <QKeySequence>
+#include <memory>
+
namespace Core {
namespace Internal {
@@ -77,6 +79,12 @@ public:
void removeAttribute(CommandAttribute attr) override;
bool hasAttribute(CommandAttribute attr) const override;
+ void setTouchBarText(const QString &text) override;
+ QString touchBarText() const override;
+ void setTouchBarIcon(const QIcon &icon) override;
+ QIcon touchBarIcon() const override;
+ QAction *touchBarAction() const override;
+
private:
void updateActiveState();
void setActive(bool state);
@@ -86,9 +94,12 @@ private:
Id m_id;
QKeySequence m_defaultKey;
QString m_defaultText;
+ QString m_touchBarText;
+ QIcon m_touchBarIcon;
bool m_isKeyInitialized = false;
Utils::ProxyAction *m_action = nullptr;
+ mutable std::unique_ptr<Utils::ProxyAction> m_touchBarAction;
QString m_toolTip;
QMap<Id, QPointer<QAction> > m_contextActionMap;
diff --git a/src/plugins/coreplugin/coreconstants.h b/src/plugins/coreplugin/coreconstants.h
index 35b8372b38..8d2e66d915 100644
--- a/src/plugins/coreplugin/coreconstants.h
+++ b/src/plugins/coreplugin/coreconstants.h
@@ -38,6 +38,9 @@ const int P_MODE_WELCOME = 100;
const int P_MODE_EDIT = 90;
const int P_MODE_DESIGN = 89;
+// TouchBar
+const char TOUCH_BAR[] = "QtCreator.TouchBar";
+
// Menubar
const char MENU_BAR[] = "QtCreator.MenuBar";
@@ -189,6 +192,12 @@ const char G_HELP_SUPPORT[] = "QtCreator.Group.Help.Supprt";
const char G_HELP_ABOUT[] = "QtCreator.Group.Help.About";
const char G_HELP_UPDATES[] = "QtCreator.Group.Help.Updates";
+// Touchbar groups
+const char G_TOUCHBAR_HELP[] = "QtCreator.Group.TouchBar.Help";
+const char G_TOUCHBAR_EDITOR[] = "QtCreator.Group.TouchBar.Editor";
+const char G_TOUCHBAR_NAVIGATION[] = "QtCreator.Group.TouchBar.Navigation";
+const char G_TOUCHBAR_OTHER[] = "QtCreator.Group.TouchBar.Other";
+
const char WIZARD_CATEGORY_QT[] = "R.Qt";
const char WIZARD_TR_CATEGORY_QT[] = QT_TRANSLATE_NOOP("Core", "Qt");
const char WIZARD_KIND_UNKNOWN[] = "unknown";
diff --git a/src/plugins/coreplugin/coreplugin.h b/src/plugins/coreplugin/coreplugin.h
index cc0d8c75d2..23494cbabd 100644
--- a/src/plugins/coreplugin/coreplugin.h
+++ b/src/plugins/coreplugin/coreplugin.h
@@ -25,6 +25,7 @@
#pragma once
+#include <qglobal.h>
#include "reaper_p.h"
#include <extensionsystem/iplugin.h>
diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp
index 94bc49a7e9..2e8b5f2ad1 100644
--- a/src/plugins/coreplugin/mainwindow.cpp
+++ b/src/plugins/coreplugin/mainwindow.cpp
@@ -24,6 +24,7 @@
****************************************************************************/
#include "mainwindow.h"
+
#include "icore.h"
#include "jsexpander.h"
#include "toolsettings.h"
@@ -427,6 +428,16 @@ void MainWindow::registerDefaultContainers()
ac->appendGroup(Constants::G_HELP_SUPPORT);
ac->appendGroup(Constants::G_HELP_ABOUT);
ac->appendGroup(Constants::G_HELP_UPDATES);
+
+ // macOS touch bar
+ ac = ActionManager::createTouchBar(Constants::TOUCH_BAR,
+ QIcon(),
+ "Main TouchBar" /*never visible*/);
+ ac->appendGroup(Constants::G_TOUCHBAR_HELP);
+ ac->appendGroup(Constants::G_TOUCHBAR_EDITOR);
+ ac->appendGroup(Constants::G_TOUCHBAR_NAVIGATION);
+ ac->appendGroup(Constants::G_TOUCHBAR_OTHER);
+ ac->touchBar()->setApplicationTouchBar();
}
void MainWindow::registerDefaultActions()
diff --git a/src/plugins/cppeditor/cppeditorplugin.cpp b/src/plugins/cppeditor/cppeditorplugin.cpp
index 3ad268ca34..bf533f038f 100644
--- a/src/plugins/cppeditor/cppeditorplugin.cpp
+++ b/src/plugins/cppeditor/cppeditorplugin.cpp
@@ -176,13 +176,18 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
Command *cmd;
ActionContainer *cppToolsMenu = ActionManager::actionContainer(CppTools::Constants::M_TOOLS_CPP);
+ ActionContainer *touchBar = ActionManager::actionContainer(Core::Constants::TOUCH_BAR);
cmd = ActionManager::command(CppTools::Constants::SWITCH_HEADER_SOURCE);
+ cmd->setTouchBarText(tr("Header/Source", "text on macOS touch bar"));
contextMenu->addAction(cmd);
+ touchBar->addAction(cmd, Core::Constants::G_TOUCHBAR_NAVIGATION);
cmd = ActionManager::command(TextEditor::Constants::FOLLOW_SYMBOL_UNDER_CURSOR);
+ cmd->setTouchBarText(tr("Follow", "text on macOS touch bar"));
contextMenu->addAction(cmd);
cppToolsMenu->addAction(cmd);
+ touchBar->addAction(cmd, Core::Constants::G_TOUCHBAR_NAVIGATION);
QAction *openPreprocessorDialog = new QAction(tr("Additional Preprocessor Directives..."), this);
cmd = ActionManager::registerAction(openPreprocessorDialog,
@@ -195,10 +200,12 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
cmd = ActionManager::registerAction(switchDeclarationDefinition,
Constants::SWITCH_DECLARATION_DEFINITION, context, true);
cmd->setDefaultKeySequence(QKeySequence(tr("Shift+F2")));
+ cmd->setTouchBarText(tr("Decl/Def", "text on macOS touch bar"));
connect(switchDeclarationDefinition, &QAction::triggered,
this, &CppEditorPlugin::switchDeclarationDefinition);
contextMenu->addAction(cmd);
cppToolsMenu->addAction(cmd);
+ touchBar->addAction(cmd, Core::Constants::G_TOUCHBAR_NAVIGATION);
cmd = ActionManager::command(TextEditor::Constants::FOLLOW_SYMBOL_UNDER_CURSOR_IN_NEXT_SPLIT);
cppToolsMenu->addAction(cmd);
diff --git a/src/plugins/debugger/debugger.qrc b/src/plugins/debugger/debugger.qrc
index 2e457b74e1..bf8095b338 100644
--- a/src/plugins/debugger/debugger.qrc
+++ b/src/plugins/debugger/debugger.qrc
@@ -49,5 +49,19 @@
<file>images/recordoutline@2x.png</file>
<file>images/tracepointoverlay.png</file>
<file>images/tracepointoverlay@2x.png</file>
+ <file>images/macos_touchbar_debug.png</file>
+ <file>images/macos_touchbar_debug@2x.png</file>
+ <file>images/macos_touchbar_debug_continue.png</file>
+ <file>images/macos_touchbar_debug_continue@2x.png</file>
+ <file>images/macos_touchbar_debug_interrupt.png</file>
+ <file>images/macos_touchbar_debug_interrupt@2x.png</file>
+ <file>images/macos_touchbar_debug_exit.png</file>
+ <file>images/macos_touchbar_debug_exit@2x.png</file>
+ <file>images/macos_touchbar_debug_step_into.png</file>
+ <file>images/macos_touchbar_debug_step_into@2x.png</file>
+ <file>images/macos_touchbar_debug_step_out.png</file>
+ <file>images/macos_touchbar_debug_step_out@2x.png</file>
+ <file>images/macos_touchbar_debug_step_over.png</file>
+ <file>images/macos_touchbar_debug_step_over@2x.png</file>
</qresource>
</RCC>
diff --git a/src/plugins/debugger/debuggericons.cpp b/src/plugins/debugger/debuggericons.cpp
index 96107377df..1c047acc2d 100644
--- a/src/plugins/debugger/debuggericons.cpp
+++ b/src/plugins/debugger/debuggericons.cpp
@@ -139,5 +139,19 @@ const Icon MODE_DEBUGGER_FLAT({
const Icon MODE_DEBUGGER_FLAT_ACTIVE({
{":/debugger/images/mode_debug_mask.png", Theme::IconsModeDebugActiveColor}});
+const Icon MACOS_TOUCHBAR_DEBUG(
+ ":/debugger/images/macos_touchbar_debug.png");
+const Icon MACOS_TOUCHBAR_DEBUG_EXIT(
+ ":/debugger/images/macos_touchbar_debug_exit.png");
+const Icon MACOS_TOUCHBAR_DEBUG_INTERRUPT(
+ ":/debugger/images/macos_touchbar_debug_interrupt.png");
+const Icon MACOS_TOUCHBAR_DEBUG_CONTINUE(
+ ":/debugger/images/macos_touchbar_debug_continue.png");
+const Icon MACOS_TOUCHBAR_DEBUG_STEP_OVER(
+ ":/debugger/images/macos_touchbar_debug_step_over.png");
+const Icon MACOS_TOUCHBAR_DEBUG_STEP_INTO(
+ ":/debugger/images/macos_touchbar_debug_step_into.png");
+const Icon MACOS_TOUCHBAR_DEBUG_STEP_OUT(
+ ":/debugger/images/macos_touchbar_debug_step_out.png");
} // namespace Icons
} // namespace Debugger
diff --git a/src/plugins/debugger/debuggericons.h b/src/plugins/debugger/debuggericons.h
index 3785a2191e..778fb4a33f 100644
--- a/src/plugins/debugger/debuggericons.h
+++ b/src/plugins/debugger/debuggericons.h
@@ -80,5 +80,13 @@ extern const Utils::Icon MODE_DEBUGGER_CLASSIC;
extern const Utils::Icon MODE_DEBUGGER_FLAT;
extern const Utils::Icon MODE_DEBUGGER_FLAT_ACTIVE;
+extern const Utils::Icon MACOS_TOUCHBAR_DEBUG;
+extern const Utils::Icon MACOS_TOUCHBAR_DEBUG_EXIT;
+extern const Utils::Icon MACOS_TOUCHBAR_DEBUG_INTERRUPT;
+extern const Utils::Icon MACOS_TOUCHBAR_DEBUG_CONTINUE;
+extern const Utils::Icon MACOS_TOUCHBAR_DEBUG_STEP_OVER;
+extern const Utils::Icon MACOS_TOUCHBAR_DEBUG_STEP_INTO;
+extern const Utils::Icon MACOS_TOUCHBAR_DEBUG_STEP_OUT;
+
} // namespace Icons
} // namespace Debugger
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index 12e609bc2f..b0e8187e03 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -991,6 +991,11 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
m_menu->appendGroup(G_ANALYZER_REMOTE_TOOLS);
m_menu->appendGroup(G_ANALYZER_OPTIONS);
+ ActionContainer *touchBar = ActionManager::createTouchBar("Debugger.TouchBar",
+ Icons::MACOS_TOUCHBAR_DEBUG.icon());
+ ActionManager::actionContainer(Core::Constants::TOUCH_BAR)
+ ->addMenu(touchBar, Core::Constants::G_TOUCHBAR_OTHER);
+
ActionContainer *menubar = ActionManager::actionContainer(MENU_BAR);
ActionContainer *mtools = ActionManager::actionContainer(M_TOOLS);
menubar->addMenu(mtools, m_menu);
@@ -1181,6 +1186,8 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
cmd->setDescription(tr("Interrupt Debugger"));
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDefaultKeySequence(startShortcut);
+ cmd->setTouchBarIcon(Icons::MACOS_TOUCHBAR_DEBUG_INTERRUPT.icon());
+ touchBar->addAction(cmd);
debugMenu->addAction(cmd, CC::G_DEFAULT_ONE);
act = new QAction(continueIcon(false), tr("Continue"), this);
@@ -1188,11 +1195,15 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
cmd = ActionManager::registerAction(act, Constants::CONTINUE);
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDefaultKeySequence(startShortcut);
+ cmd->setTouchBarIcon(Icons::MACOS_TOUCHBAR_DEBUG_CONTINUE.icon());
+ touchBar->addAction(cmd);
debugMenu->addAction(cmd, CC::G_DEFAULT_ONE);
act = new QAction(Icons::DEBUG_EXIT_SMALL.icon(), tr("Stop Debugger"), this);
act->setEnabled(false);
cmd = ActionManager::registerAction(act, Constants::STOP);
+ cmd->setTouchBarIcon(Icons::MACOS_TOUCHBAR_DEBUG_EXIT.icon());
+ touchBar->addAction(cmd);
debugMenu->addAction(cmd, CC::G_DEFAULT_ONE);
m_hiddenStopAction.initialize(cmd->action());
m_hiddenStopAction.setAttribute(ProxyAction::UpdateText);
@@ -1231,18 +1242,24 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
act->setEnabled(false);
cmd = ActionManager::registerAction(act, Constants::NEXT);
cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Ctrl+Shift+O") : tr("F10")));
+ cmd->setTouchBarIcon(Icons::MACOS_TOUCHBAR_DEBUG_STEP_OVER.icon());
+ touchBar->addAction(cmd);
debugMenu->addAction(cmd);
act = new QAction(Icons::STEP_INTO.icon(), tr("Step Into"), this);
act->setEnabled(false);
cmd = ActionManager::registerAction(act, Constants::STEP);
cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Ctrl+Shift+I") : tr("F11")));
+ cmd->setTouchBarIcon(Icons::MACOS_TOUCHBAR_DEBUG_STEP_INTO.icon());
+ touchBar->addAction(cmd);
debugMenu->addAction(cmd);
act = new QAction(Icons::STEP_OUT.icon(), tr("Step Out"), this);
act->setEnabled(false);
cmd = ActionManager::registerAction(act, Constants::STEPOUT);
cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Ctrl+Shift+T") : tr("Shift+F11")));
+ cmd->setTouchBarIcon(Icons::MACOS_TOUCHBAR_DEBUG_STEP_OUT.icon());
+ touchBar->addAction(cmd);
debugMenu->addAction(cmd);
act = new QAction(tr("Run to Line"), this);
diff --git a/src/plugins/debugger/images/macos_touchbar_debug.png b/src/plugins/debugger/images/macos_touchbar_debug.png
new file mode 100644
index 0000000000..2b8086c5d6
--- /dev/null
+++ b/src/plugins/debugger/images/macos_touchbar_debug.png
Binary files differ
diff --git a/src/plugins/debugger/images/macos_touchbar_debug@2x.png b/src/plugins/debugger/images/macos_touchbar_debug@2x.png
new file mode 100644
index 0000000000..cf7a381c3f
--- /dev/null
+++ b/src/plugins/debugger/images/macos_touchbar_debug@2x.png
Binary files differ
diff --git a/src/plugins/debugger/images/macos_touchbar_debug_continue.png b/src/plugins/debugger/images/macos_touchbar_debug_continue.png
new file mode 100644
index 0000000000..a4182f2a0a
--- /dev/null
+++ b/src/plugins/debugger/images/macos_touchbar_debug_continue.png
Binary files differ
diff --git a/src/plugins/debugger/images/macos_touchbar_debug_continue@2x.png b/src/plugins/debugger/images/macos_touchbar_debug_continue@2x.png
new file mode 100644
index 0000000000..3bc8beca80
--- /dev/null
+++ b/src/plugins/debugger/images/macos_touchbar_debug_continue@2x.png
Binary files differ
diff --git a/src/plugins/debugger/images/macos_touchbar_debug_exit.png b/src/plugins/debugger/images/macos_touchbar_debug_exit.png
new file mode 100644
index 0000000000..543886199c
--- /dev/null
+++ b/src/plugins/debugger/images/macos_touchbar_debug_exit.png
Binary files differ
diff --git a/src/plugins/debugger/images/macos_touchbar_debug_exit@2x.png b/src/plugins/debugger/images/macos_touchbar_debug_exit@2x.png
new file mode 100644
index 0000000000..f3e4b88b80
--- /dev/null
+++ b/src/plugins/debugger/images/macos_touchbar_debug_exit@2x.png
Binary files differ
diff --git a/src/plugins/debugger/images/macos_touchbar_debug_interrupt.png b/src/plugins/debugger/images/macos_touchbar_debug_interrupt.png
new file mode 100644
index 0000000000..46acc412f9
--- /dev/null
+++ b/src/plugins/debugger/images/macos_touchbar_debug_interrupt.png
Binary files differ
diff --git a/src/plugins/debugger/images/macos_touchbar_debug_interrupt@2x.png b/src/plugins/debugger/images/macos_touchbar_debug_interrupt@2x.png
new file mode 100644
index 0000000000..23c2061517
--- /dev/null
+++ b/src/plugins/debugger/images/macos_touchbar_debug_interrupt@2x.png
Binary files differ
diff --git a/src/plugins/debugger/images/macos_touchbar_debug_step_into.png b/src/plugins/debugger/images/macos_touchbar_debug_step_into.png
new file mode 100644
index 0000000000..ac068cf7a3
--- /dev/null
+++ b/src/plugins/debugger/images/macos_touchbar_debug_step_into.png
Binary files differ
diff --git a/src/plugins/debugger/images/macos_touchbar_debug_step_into@2x.png b/src/plugins/debugger/images/macos_touchbar_debug_step_into@2x.png
new file mode 100644
index 0000000000..04629f57ef
--- /dev/null
+++ b/src/plugins/debugger/images/macos_touchbar_debug_step_into@2x.png
Binary files differ
diff --git a/src/plugins/debugger/images/macos_touchbar_debug_step_out.png b/src/plugins/debugger/images/macos_touchbar_debug_step_out.png
new file mode 100644
index 0000000000..20815f7e00
--- /dev/null
+++ b/src/plugins/debugger/images/macos_touchbar_debug_step_out.png
Binary files differ
diff --git a/src/plugins/debugger/images/macos_touchbar_debug_step_out@2x.png b/src/plugins/debugger/images/macos_touchbar_debug_step_out@2x.png
new file mode 100644
index 0000000000..7c1103c246
--- /dev/null
+++ b/src/plugins/debugger/images/macos_touchbar_debug_step_out@2x.png
Binary files differ
diff --git a/src/plugins/debugger/images/macos_touchbar_debug_step_over.png b/src/plugins/debugger/images/macos_touchbar_debug_step_over.png
new file mode 100644
index 0000000000..df6e5b0bab
--- /dev/null
+++ b/src/plugins/debugger/images/macos_touchbar_debug_step_over.png
Binary files differ
diff --git a/src/plugins/debugger/images/macos_touchbar_debug_step_over@2x.png b/src/plugins/debugger/images/macos_touchbar_debug_step_over@2x.png
new file mode 100644
index 0000000000..1013145b47
--- /dev/null
+++ b/src/plugins/debugger/images/macos_touchbar_debug_step_over@2x.png
Binary files differ
diff --git a/src/plugins/help/help.qrc b/src/plugins/help/help.qrc
index 78909bb8b3..b00e06409b 100644
--- a/src/plugins/help/help.qrc
+++ b/src/plugins/help/help.qrc
@@ -6,5 +6,7 @@
<file>images/mode_help@2x.png</file>
<file>images/mode_help_mask.png</file>
<file>images/mode_help_mask@2x.png</file>
+ <file>images/macos_touchbar_help.png</file>
+ <file>images/macos_touchbar_help@2x.png</file>
</qresource>
</RCC>
diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp
index 679f04d9a6..6f2454da90 100644
--- a/src/plugins/help/helpplugin.cpp
+++ b/src/plugins/help/helpplugin.cpp
@@ -32,6 +32,7 @@
#include "generalsettingspage.h"
#include "helpconstants.h"
#include "helpfindsupport.h"
+#include "helpicons.h"
#include "helpindexfilter.h"
#include "helpmanager.h"
#include "helpmode.h"
@@ -262,7 +263,10 @@ HelpPluginPrivate::HelpPluginPrivate()
action = new QAction(HelpPlugin::tr("Context Help"), this);
cmd = ActionManager::registerAction(action, Help::Constants::CONTEXT_HELP,
Context(kToolTipHelpContext, Core::Constants::C_GLOBAL));
+ cmd->setTouchBarIcon(Icons::MACOS_TOUCHBAR_HELP.icon());
ActionManager::actionContainer(Core::Constants::M_HELP)->addAction(cmd, Core::Constants::G_HELP_HELP);
+ ActionManager::actionContainer(Core::Constants::TOUCH_BAR)
+ ->addAction(cmd, Core::Constants::G_TOUCHBAR_HELP);
cmd->setDefaultKeySequence(QKeySequence(Qt::Key_F1));
connect(action, &QAction::triggered, this, &HelpPluginPrivate::requestContextHelp);
ActionContainer *textEditorContextMenu = ActionManager::actionContainer(
diff --git a/src/plugins/help/images/macos_touchbar_help.png b/src/plugins/help/images/macos_touchbar_help.png
new file mode 100644
index 0000000000..8faf7fe647
--- /dev/null
+++ b/src/plugins/help/images/macos_touchbar_help.png
Binary files differ
diff --git a/src/plugins/help/images/macos_touchbar_help@2x.png b/src/plugins/help/images/macos_touchbar_help@2x.png
new file mode 100644
index 0000000000..ba1ffe7c8a
--- /dev/null
+++ b/src/plugins/help/images/macos_touchbar_help@2x.png
Binary files differ
diff --git a/src/shared/help/helpicons.h b/src/shared/help/helpicons.h
index dd4ebce26a..0dfae1f093 100644
--- a/src/shared/help/helpicons.h
+++ b/src/shared/help/helpicons.h
@@ -36,6 +36,8 @@ const Utils::Icon MODE_HELP_FLAT({
{QLatin1String(":/help/images/mode_help_mask.png"), Utils::Theme::IconsBaseColor}});
const Utils::Icon MODE_HELP_FLAT_ACTIVE({
{QLatin1String(":/help/images/mode_help_mask.png"), Utils::Theme::IconsModeHelpActiveColor}});
+const Utils::Icon MACOS_TOUCHBAR_HELP(
+ ":/help/images/macos_touchbar_help.png");
} // namespace Icons
} // namespace Help
diff --git a/src/tools/icons/qtcreatoricons.svg b/src/tools/icons/qtcreatoricons.svg
index ab26dd5fed..24f73e097e 100644
--- a/src/tools/icons/qtcreatoricons.svg
+++ b/src/tools/icons/qtcreatoricons.svg
@@ -695,6 +695,14 @@
width="16"
id="transparentBackgroundRect"
style="display:inline;fill:none" />
+ <use
+ x="0"
+ y="0"
+ xlink:href="#transparentBackgroundRect"
+ id="transparentBackgroundRect_22"
+ width="100%"
+ height="100%"
+ transform="matrix(1.375,0,0,1.375,-16,-175.5)" />
<g
inkscape:groupmode="layer"
id="layer7"
@@ -3299,6 +3307,320 @@
</g>
<g
inkscape:groupmode="layer"
+ id="layer8"
+ inkscape:label="macOS touch bar">
+ <g
+ id="src/plugins/debugger/images/macos_touchbar_debug"
+ transform="translate(-40)">
+ <use
+ transform="translate(596,-132)"
+ height="100%"
+ width="100%"
+ id="use2428"
+ xlink:href="#transparentBackgroundRect_22"
+ y="0"
+ x="0" />
+ <use
+ height="100%"
+ width="100%"
+ id="use2393"
+ xlink:href="#big_beetle"
+ y="0"
+ x="0"
+ style="display:inline"
+ transform="translate(361,271)" />
+ </g>
+ <g
+ id="src/plugins/debugger/images/macos_touchbar_debug_step_over"
+ transform="translate(-17)">
+ <use
+ transform="translate(596,-132)"
+ height="100%"
+ width="100%"
+ id="use2428-8"
+ xlink:href="#transparentBackgroundRect_22"
+ y="0"
+ x="0" />
+ <path
+ style="fill:none;stroke:#000000"
+ d="m 568,316.5 c -4,0 -7,3.5 -7,7.5 0,4 3,7 6,9"
+ id="path4741-1"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="czc" />
+ <path
+ style="fill:#000000"
+ d="m 568,334 v -5 l -5,5 z"
+ id="path4743-3"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cccc" />
+ <path
+ id="big_debugger_function"
+ style="fill:#000000"
+ d="m 573,323 h 5 v 1 h -5 z m 0,-3 h 5 v 1 h -5 z m -2,12 h 7 v 2 h -7 c -0.5,0 -1,-0.45404 -1,-0.97702 C 570,332.5 570.5,332 571,332 Z m 0,-16 h 7 v 2 h -7 c -0.5,0 -1,-0.5 -1,-1 0,-0.5 0.5,-1 1,-1 z m 2,10 h 5 v 1 h -5 z m 0,3 h 5 v 1 h -5 z"
+ inkscape:connector-curvature="0" />
+ </g>
+ <g
+ id="src/plugins/debugger/images/macos_touchbar_debug_step_into"
+ transform="translate(6)">
+ <use
+ transform="translate(596,-132)"
+ height="100%"
+ width="100%"
+ id="use2428-8-1"
+ xlink:href="#transparentBackgroundRect_22"
+ y="0"
+ x="0" />
+ <path
+ style="fill:none;stroke:#000000"
+ d="m 560.5,316 c 0,5.5 1,9.5 8.5,9.5"
+ id="path4741-1-1"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:#000000"
+ d="m 571,325.5 -4,-3.5 v 7 z"
+ id="path4743-3-6"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cccc" />
+ <use
+ x="0"
+ y="0"
+ xlink:href="#big_debugger_function"
+ id="use2612"
+ width="100%"
+ height="100%" />
+ </g>
+ <g
+ transform="translate(29)"
+ id="src/plugins/debugger/images/macos_touchbar_debug_step_out">
+ <use
+ transform="translate(596,-132)"
+ height="100%"
+ width="100%"
+ id="use2428-8-6"
+ xlink:href="#transparentBackgroundRect_22"
+ y="0"
+ x="0" />
+ <path
+ sodipodi:nodetypes="cc"
+ inkscape:connector-curvature="0"
+ id="path2631"
+ d="m 571,324.5 c -5,0 -7.5,0 -7.5,7.5"
+ style="fill:none;stroke:#000000" />
+ <path
+ sodipodi:nodetypes="cccc"
+ inkscape:connector-curvature="0"
+ id="path2633"
+ d="m 563.5,334 3.5,-4 h -7 z"
+ style="fill:#000000" />
+ <use
+ height="100%"
+ width="100%"
+ id="use2635"
+ xlink:href="#big_debugger_function"
+ y="0"
+ x="0" />
+ </g>
+ <g
+ transform="translate(52)"
+ id="src/plugins/projectexplorer/images/macos_touchbar_debug_start">
+ <use
+ transform="translate(596,-132)"
+ height="100%"
+ width="100%"
+ id="use2428-8-9"
+ xlink:href="#transparentBackgroundRect_22"
+ y="0"
+ x="0" />
+ <use
+ transform="translate(307,-254.5)"
+ style="display:inline;fill:#4d4d4d"
+ x="0"
+ y="0"
+ xlink:href="#play_small"
+ id="use4017"
+ width="100%"
+ height="100%" />
+ <use
+ transform="translate(-192,266)"
+ style="display:inline"
+ x="0"
+ y="0"
+ xlink:href="#big_bug"
+ id="use4013"
+ width="100%"
+ height="100%" />
+ </g>
+ <g
+ transform="translate(75,2.38e-4)"
+ id="src/plugins/debugger/images/macos_touchbar_debug_exit">
+ <use
+ transform="translate(596,-132.00024)"
+ height="100%"
+ width="100%"
+ id="use2428-8-3"
+ xlink:href="#transparentBackgroundRect_22"
+ y="0"
+ x="0" />
+ <use
+ transform="translate(291,-255.00024)"
+ style="display:inline;fill:#4d4d4d"
+ x="0"
+ y="0"
+ xlink:href="#stop_small"
+ id="use4034"
+ width="100%"
+ height="100%" />
+ <use
+ transform="translate(-192,266)"
+ style="display:inline"
+ x="0"
+ y="0"
+ xlink:href="#big_bug"
+ id="use4013-4"
+ width="100%"
+ height="100%" />
+ </g>
+ <g
+ transform="translate(98,2.38e-4)"
+ id="src/plugins/debugger/images/macos_touchbar_debug_interrupt">
+ <use
+ transform="translate(596,-132.00024)"
+ height="100%"
+ width="100%"
+ id="use2428-8-5"
+ xlink:href="#transparentBackgroundRect_22"
+ y="0"
+ x="0" />
+ <use
+ style="display:inline;fill:#4d4d4d"
+ x="0"
+ y="0"
+ xlink:href="#smallinterruptbar"
+ id="use4930-6"
+ transform="translate(291,-255.00024)"
+ width="100%"
+ height="100%" />
+ <use
+ style="display:inline;fill:#4d4d4d"
+ x="0"
+ y="0"
+ xlink:href="#smallinterruptbar"
+ id="use4930-0"
+ transform="translate(298,-255.00024)"
+ width="100%"
+ height="100%" />
+ <use
+ transform="translate(-192,266)"
+ style="display:inline"
+ x="0"
+ y="0"
+ xlink:href="#big_bug"
+ id="use4013-4-1"
+ width="100%"
+ height="100%" />
+ </g>
+ <g
+ transform="translate(121,2.4414063e-4)"
+ id="src/plugins/debugger/images/macos_touchbar_debug_continue">
+ <use
+ transform="translate(596,-132.00024)"
+ height="100%"
+ width="100%"
+ id="use2428-8-7"
+ xlink:href="#transparentBackgroundRect_22"
+ y="0"
+ x="0" />
+ <use
+ style="display:inline;fill:#4d4d4d"
+ x="0"
+ y="0"
+ xlink:href="#smallinterruptbar"
+ id="use4930-0-6"
+ transform="translate(291,-255.00024)"
+ width="100%"
+ height="100%" />
+ <use
+ transform="translate(291,-255.00024)"
+ style="display:inline;fill:#4d4d4d"
+ x="0"
+ y="0"
+ xlink:href="#smallinterruptcontinuebar"
+ id="use4087"
+ width="100%"
+ height="100%" />
+ <use
+ transform="translate(-192,266)"
+ style="display:inline"
+ x="0"
+ y="0"
+ xlink:href="#big_bug"
+ id="use4013-4-1-0"
+ width="100%"
+ height="100%" />
+ </g>
+ <g
+ id="src/libs/utils/images/macos_touchbar_bookmark"
+ transform="translate(158)">
+ <use
+ x="0"
+ y="0"
+ xlink:href="#transparentBackgroundRect_22"
+ id="use2428-6"
+ width="100%"
+ height="100%"
+ transform="translate(582,-132)" />
+ <use
+ transform="matrix(2.0000107,0,0,1.6666667,-1365.0103,-635)"
+ height="100%"
+ width="100%"
+ id="use2449"
+ xlink:href="#bookmarkribbon"
+ y="0"
+ x="0"
+ style="display:inline;stroke-width:0.54772115" />
+ </g>
+ <g
+ id="src/plugins/help/images/macos_touchbar_help"
+ transform="translate(181)">
+ <use
+ x="0"
+ y="0"
+ xlink:href="#transparentBackgroundRect_22"
+ id="use2428-6-7"
+ width="100%"
+ height="100%"
+ transform="translate(582,-132)" />
+ <use
+ transform="translate(196,270)"
+ style="display:inline"
+ x="0"
+ y="0"
+ xlink:href="#big_helpquestionmark"
+ id="use2506"
+ width="100%"
+ height="100%" />
+ </g>
+ <g
+ id="src/libs/utils/images/macos_touchbar_clear"
+ transform="translate(69)">
+ <use
+ x="0"
+ y="0"
+ xlink:href="#transparentBackgroundRect_22"
+ id="use2428-6-7-8"
+ width="100%"
+ height="100%"
+ transform="translate(717,-132)" />
+ <path
+ style="fill:#000000"
+ d="m 690,315 a 10,10 0 0 0 -10,10 10,10 0 0 0 10,10 10,10 0 0 0 10.00001,-10 A 10,10 0 0 0 690,315 Z m -3.42633,4.85491 3.42633,3.42635 3.42635,-3.42635 1.71874,1.71874 -3.42634,3.42634 3.42634,3.42634 -1.71874,1.71875 -3.42635,-3.42634 -3.42633,3.42634 -1.71874,-1.71875 3.42634,-3.42634 -3.42634,-3.42634 z"
+ id="path4480-4"
+ inkscape:connector-curvature="0" />
+ </g>
+ </g>
+ <g
+ inkscape:groupmode="layer"
id="layer2"
inkscape:label="Editor tool bar icons"
style="display:inline">
@@ -3811,9 +4133,9 @@
style="fill:#ffffff;fill-opacity:1;stroke:none" />
<polygon
transform="translate(-201,318)"
- id="polygon4899-2"
- points="464,258 453,251 453,265 "
- style="fill:#000000;fill-opacity:1;stroke:none" />
+ id="play_small"
+ points="453,251 453,265 464,258 "
+ style="fill-opacity:1;stroke:none" />
</g>
<g
id="src/libs/utils/images/stop_small"
@@ -3826,12 +4148,12 @@
x="265"
style="fill:#ffffff;fill-opacity:1;stroke:none" />
<rect
- id="rect4905-9"
+ id="stop_small"
height="12"
width="12"
y="570"
x="267"
- style="fill:#000000;fill-opacity:1;stroke:none" />
+ style="fill-opacity:1;stroke:none" />
</g>
<g
transform="translate(128,0)"
@@ -3844,7 +4166,6 @@
height="16"
id="rect4810" />
<rect
- style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="smallinterruptbar"
width="5"
height="12"
@@ -4673,9 +4994,8 @@
height="16"
id="rect4810-1" />
<path
- style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 274,570 6,6 -6,6 z"
- id="rect4817-6"
+ id="smallinterruptcontinuebar"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccc" />
</g>
@@ -7815,7 +8135,7 @@
height="100%" />
<g
transform="translate(-4.5,-7)"
- id="g5397-4">
+ id="big_beetle">
<path
d="m 212,52 c -1.275,0 -3.30877,1.17695 -3.88477,2.75195 L 212,56.9375 215.88477,54.75195 C 215.30877,53.17595 213.275,52 212,52 Z m -4.67578,3.68359 -1.98633,1.76563 -1.39648,-1.39453 c -0.194,-0.194 -0.51304,-0.194 -0.70703,0 -0.194,0.194 -0.194,0.51303 0,0.70703 l 1.6875,1.6875 L 204.03516,62 H 202.5 c -0.275,0 -0.5,0.225 -0.5,0.5 0,0.275 0.225,0.5 0.5,0.5 h 1.48828 l 1.19141,3.8125 -1.62696,1.62695 c -0.194,0.194 -0.194,0.51303 0,0.70703 0.194,0.194 0.51304,0.194 0.70704,0 l 1.375,-1.375 3.55273,2.36719 2.3125,0.58594 V 58 Z m 9.35156,0 L 212.5,58 v 12.72461 l 2.3125,-0.58594 3.55078,-2.36719 1.375,1.375 c 0.194,0.194 0.51303,0.194 0.70703,0 0.194,-0.194 0.194,-0.51303 0,-0.70703 l -1.625,-1.625 L 220.01172,63 H 221.5 c 0.275,0 0.5,-0.225 0.5,-0.5 0,-0.275 -0.225,-0.5 -0.5,-0.5 h -1.53516 l -0.88672,-3.55078 1.6875,-1.6875 c 0.19401,-0.194 0.194,-0.51303 0,-0.70703 -0.19399,-0.194 -0.51303,-0.194 -0.70703,0 l -1.39648,1.39453 z"
id="path5403-3"
@@ -7854,7 +8174,7 @@
width="100%"
height="100%" />
<path
- id="path5457-0"
+ id="big_helpquestionmark"
d="m 359,45 c -5.522,0 -10,4.478 -10,10 0,5.522 4.478,10 10,10 5.522,0 10,-4.478 10,-10 0,-5.522 -4.478,-10 -10,-10 z m 1.136,16.182 c -0.274,0.269 -0.604,0.402 -0.989,0.402 -0.187,0 -0.364,-0.035 -0.533,-0.105 -0.169,-0.07 -0.318,-0.163 -0.446,-0.28 -0.129,-0.117 -0.23,-0.257 -0.307,-0.42 -0.076,-0.163 -0.113,-0.338 -0.113,-0.525 0,-0.373 0.137,-0.694 0.411,-0.962 0.273,-0.268 0.603,-0.402 0.988,-0.402 0.374,0 0.7,0.128 0.98,0.385 0.28,0.257 0.42,0.572 0.42,0.945 0,0.372 -0.138,0.693 -0.411,0.962 z m 2.738,-7.98 c -0.104,0.292 -0.245,0.56 -0.42,0.805 -0.175,0.245 -0.376,0.479 -0.604,0.7 -0.228,0.222 -0.47,0.455 -0.727,0.7 -0.163,0.151 -0.303,0.286 -0.42,0.402 -0.116,0.117 -0.213,0.236 -0.288,0.359 -0.076,0.122 -0.132,0.262 -0.167,0.42 -0.034,0.157 -0.052,0.347 -0.052,0.569 v 0.665 h -2.101 V 56.86 c 0,-0.256 0.015,-0.475 0.044,-0.656 0.029,-0.181 0.081,-0.344 0.157,-0.49 0.076,-0.146 0.175,-0.286 0.298,-0.42 0.122,-0.134 0.271,-0.295 0.446,-0.481 l 1.348,-1.365 c 0.291,-0.292 0.438,-0.67 0.438,-1.137 0,-0.455 -0.149,-0.825 -0.446,-1.111 -0.298,-0.286 -0.674,-0.429 -1.129,-0.429 -0.49,0 -0.893,0.166 -1.208,0.499 -0.314,0.333 -0.495,0.738 -0.542,1.216 l -2.24,-0.175 c 0.07,-0.56 0.216,-1.059 0.438,-1.496 0.222,-0.438 0.511,-0.808 0.866,-1.111 0.355,-0.303 0.768,-0.534 1.234,-0.691 0.466,-0.158 0.979,-0.236 1.54,-0.236 0.524,0 1.012,0.076 1.461,0.228 0.449,0.152 0.84,0.371 1.172,0.656 0.333,0.286 0.593,0.642 0.779,1.067 0.186,0.426 0.28,0.913 0.28,1.461 10e-4,0.382 -0.052,0.721 -0.157,1.013 z"
inkscape:connector-curvature="0" />
</g>