diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index 35b682bfc43171f5de7443d62cbdfab716e389a1..823a750b91c6df28c67ff4669a383c416f3132ab 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -259,44 +259,6 @@ BreakHandler::BreakHandler() << tr("Address") << tr("Condition") << tr("Ignore") << tr("Threads")); } -QIcon BreakHandler::breakpointIcon() -{ - static QIcon icon = Icons::BREAKPOINT.icon(); - return icon; -} - -QIcon BreakHandler::disabledBreakpointIcon() -{ - static QIcon icon = Icons::BREAKPOINT_DISABLED.icon(); - return icon; -} - -QIcon BreakHandler::pendingBreakpointIcon() -{ - static QIcon icon = Icons::BREAKPOINT_PENDING.icon(); - return icon; -} - -QIcon BreakHandler::watchpointIcon() -{ - static QIcon icon = Icons::WATCHPOINT.icon(); - return icon; -} - -QIcon BreakHandler::tracepointIcon() -{ - static QIcon icon = Icons::TRACEPOINT.icon(); - return icon; -} - -QIcon BreakHandler::emptyIcon() -{ - static QIcon icon = Icons::BREAKPOINT_PENDING.icon(); - //static QIcon icon = Icons::WATCHPOINT.icon(); - //static QIcon icon = Icons::EMPTY.icon(); - return icon; -} - static inline bool fileNameMatch(const QString &f1, const QString &f2) { if (HostOsInfo::fileNameCaseSensitivity() == Qt::CaseInsensitive) @@ -1401,16 +1363,16 @@ QIcon BreakpointItem::icon() const // FIXME: This seems to be called on each cursor blink as soon as the // cursor is near a line with a breakpoint marker (+/- 2 lines or so). if (m_params.isTracepoint()) - return BreakHandler::tracepointIcon(); + return Icons::TRACEPOINT.icon(); if (m_params.type == WatchpointAtAddress) - return BreakHandler::watchpointIcon(); + return Icons::WATCHPOINT.icon(); if (m_params.type == WatchpointAtExpression) - return BreakHandler::watchpointIcon(); + return Icons::WATCHPOINT.icon(); if (!m_params.enabled) - return BreakHandler::disabledBreakpointIcon(); + return Icons::BREAKPOINT_DISABLED.icon(); if (m_state == BreakpointInserted && !m_response.pending) - return BreakHandler::breakpointIcon(); - return BreakHandler::pendingBreakpointIcon(); + return Icons::BREAKPOINT.icon(); + return Icons::BREAKPOINT_PENDING.icon(); } QString BreakpointItem::toToolTip() const diff --git a/src/plugins/debugger/breakhandler.h b/src/plugins/debugger/breakhandler.h index 7fda24c4c1c2c5b0f1d536f2c1935abe93ffa8ef..97d16f6fa8f582dda262201ab69b607008767d4a 100644 --- a/src/plugins/debugger/breakhandler.h +++ b/src/plugins/debugger/breakhandler.h @@ -187,13 +187,6 @@ public: Breakpoints findBreakpointsByIndex(const QList<QModelIndex> &list) const; void updateMarkers(); - static QIcon breakpointIcon(); - static QIcon disabledBreakpointIcon(); - static QIcon pendingBreakpointIcon(); - static QIcon emptyIcon(); - static QIcon watchpointIcon(); - static QIcon tracepointIcon(); - Breakpoint findBreakpointByFileAndLine(const QString &fileName, int lineNumber, bool useMarkerPosition = true); Breakpoint findBreakpointByAddress(quint64 address) const; diff --git a/src/plugins/debugger/debugger.pro b/src/plugins/debugger/debugger.pro index a09fbb72321a63510b4a169a5ecd467396ba8a0e..e3a9513814277c53fcebe99ae6360c0b65799bdc 100644 --- a/src/plugins/debugger/debugger.pro +++ b/src/plugins/debugger/debugger.pro @@ -123,7 +123,8 @@ SOURCES += \ localsandexpressionswindow.cpp \ imageviewer.cpp \ simplifytype.cpp \ - unstartedappwatcherdialog.cpp + unstartedappwatcherdialog.cpp \ + debuggericons.cpp RESOURCES += debugger.qrc diff --git a/src/plugins/debugger/debugger.qbs b/src/plugins/debugger/debugger.qbs index 351cd076fadad43352a703d63ed85689f1a1369c..581424113aa0c5702dd7875aff8a281c020ad936 100644 --- a/src/plugins/debugger/debugger.qbs +++ b/src/plugins/debugger/debugger.qbs @@ -49,7 +49,7 @@ Project { "debugger_global.h", "debuggeractions.cpp", "debuggeractions.h", "debuggerconstants.h", - "debuggericons.h", + "debuggericons.h", "debuggericons.cpp", "debuggercore.h", "debuggerdialogs.cpp", "debuggerdialogs.h", "debuggerengine.cpp", "debuggerengine.h", diff --git a/src/plugins/debugger/debuggercore.h b/src/plugins/debugger/debuggercore.h index c8398a7a14bc142357a23077c88292f4ff52d722..11237e2712fd5edf4f001ed99ce67626d5cc4a9e 100644 --- a/src/plugins/debugger/debuggercore.h +++ b/src/plugins/debugger/debuggercore.h @@ -61,7 +61,6 @@ enum TestCases // Some convenience. void updateState(DebuggerEngine *engine); void updateWatchersWindow(bool showWatch, bool showReturn); -QIcon locationMarkIcon(); const CPlusPlus::Snapshot &cppCodeModelSnapshot(); bool hasSnapshots(); void openTextEditor(const QString &titlePattern, const QString &contents); diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 8aa4c3aaddcd465e7a7f4471c89dfc31851759f5..e1e89e17c25866c81ccd73c19127242219f0176b 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -28,6 +28,7 @@ #include "debuggerinternalconstants.h" #include "debuggeractions.h" #include "debuggercore.h" +#include "debuggericons.h" #include "debuggerruncontrol.h" #include "debuggerstartparameters.h" #include "debuggertooltipmanager.h" @@ -131,7 +132,7 @@ Location::Location(const StackFrame &frame, bool marker) LocationMark::LocationMark(DebuggerEngine *engine, const QString &file, int line) : TextMark(file, line, Constants::TEXT_MARK_CATEGORY_LOCATION), m_engine(engine) { - setIcon(Internal::locationMarkIcon()); + setIcon(Icons::LOCATION.icon()); setPriority(TextMark::HighPriority); } diff --git a/src/plugins/debugger/debuggericons.cpp b/src/plugins/debugger/debuggericons.cpp new file mode 100644 index 0000000000000000000000000000000000000000..af974ac38bca33a586b4551b7111278c0bc8c819 --- /dev/null +++ b/src/plugins/debugger/debuggericons.cpp @@ -0,0 +1,128 @@ +/**************************************************************************** +** +** Copyright (C) 2016 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 "debuggericons.h" + +using namespace Utils; + +namespace Debugger { +namespace Icons { + +const Icon BREAKPOINT({ + {":/debugger/images/breakpoint.png", Theme::IconsErrorColor}}, Icon::Tint); +const Icon BREAKPOINT_DISABLED({ + {":/debugger/images/breakpoint_disabled.png", Theme::IconsErrorColor}}, Icon::Tint); +const Icon BREAKPOINT_PENDING({ + {":/debugger/images/breakpoint.png", Theme::IconsErrorColor}, + {":/debugger/images/breakpoint_pending_overlay.png", Theme::PanelTextColorDark}}, Icon::IconStyleOptions(Icon::Tint | Icon::PunchEdges)); +const Icon BREAKPOINTS( + ":/debugger/images/debugger_breakpoints.png"); +const Icon WATCHPOINT({ + {":/core/images/eye_open.png", Theme::TextColorNormal}}, Icon::Tint); +const Icon TRACEPOINT({ + {":/core/images/eye_open.png", Theme::TextColorNormal}, + {":/debugger/images/tracepointoverlay.png", Theme::TextColorNormal}}, Icon::Tint | Icon::PunchEdges); +const Icon CONTINUE( + ":/debugger/images/debugger_continue.png"); +const Icon CONTINUE_FLAT({ + {":/debugger/images/debugger_continue_1_mask.png", Theme::IconsInterruptToolBarColor}, + {":/debugger/images/debugger_continue_2_mask.png", Theme::IconsRunToolBarColor}, + {":/projectexplorer/images/debugger_beetle_mask.png", Theme::IconsDebugColor}}); +const Icon DEBUG_CONTINUE_SMALL({ + {":/projectexplorer/images/continue_1_small.png", Theme::IconsInterruptColor}, + {":/projectexplorer/images/continue_2_small.png", Theme::IconsRunColor}, + {":/projectexplorer/images/debugger_overlay_small.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle); +const Icon DEBUG_CONTINUE_SMALL_TOOLBAR({ + {":/projectexplorer/images/continue_1_small.png", Theme::IconsInterruptToolBarColor}, + {":/projectexplorer/images/continue_2_small.png", Theme::IconsRunToolBarColor}, + {":/projectexplorer/images/debugger_overlay_small.png", Theme::IconsDebugColor}}); +const Icon INTERRUPT( + ":/debugger/images/debugger_interrupt.png"); +const Icon INTERRUPT_FLAT({ + {":/debugger/images/debugger_interrupt_mask.png", Theme::IconsInterruptToolBarColor}, + {":/projectexplorer/images/debugger_beetle_mask.png", Theme::IconsDebugColor}}); +const Icon DEBUG_INTERRUPT_SMALL({ + {":/core/images/interrupt_small.png", Theme::IconsInterruptColor}, + {":/projectexplorer/images/debugger_overlay_small.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle); +const Icon DEBUG_INTERRUPT_SMALL_TOOLBAR({ + {":/core/images/interrupt_small.png", Theme::IconsInterruptToolBarColor}, + {":/projectexplorer/images/debugger_overlay_small.png", Theme::IconsDebugColor}}); +const Icon DEBUG_EXIT_SMALL({ + {":/core/images/stop_small.png", Theme::IconsStopColor}, + {":/projectexplorer/images/debugger_overlay_small.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle); +const Icon DEBUG_EXIT_SMALL_TOOLBAR({ + {":/core/images/stop_small.png", Theme::IconsStopToolBarColor}, + {":/projectexplorer/images/debugger_overlay_small.png", Theme::IconsDebugColor}}); +const Icon LOCATION({ + {":/debugger/images/location_background.png", Theme::IconsCodeModelOverlayForegroundColor}, + {":/debugger/images/location.png", Theme::IconsWarningToolBarColor}}, Icon::Tint); +const Icon REVERSE_MODE({ + {":/debugger/images/debugger_reversemode_background.png", Theme::IconsCodeModelOverlayForegroundColor}, + {":/debugger/images/debugger_reversemode.png", Theme::IconsInfoColor}}, Icon::Tint); +const Icon APP_ON_TOP({ + {":/debugger/images/qml/app-on-top.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle); +const Icon APP_ON_TOP_TOOLBAR({ + {":/debugger/images/qml/app-on-top.png", Theme::IconsBaseColor}}); +const Icon SELECT({ + {":/debugger/images/qml/select.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle); +const Icon SELECT_TOOLBAR({ + {":/debugger/images/qml/select.png", Theme::IconsBaseColor}}); +const Icon EMPTY( + ":/debugger/images/debugger_empty_14.png"); +const Icon RECORD_ON({ + {":/debugger/images/recordfill.png", Theme::IconsStopColor}, + {":/debugger/images/recordoutline.png", Theme::IconsBaseColor}}, Icon::Tint | Icon::DropShadow); +const Icon RECORD_OFF({ + {":/debugger/images/recordfill.png", Theme::IconsDisabledColor}, + {":/debugger/images/recordoutline.png", Theme::IconsBaseColor}}, Icon::Tint | Icon::DropShadow); + +const Icon STEP_OVER({ + {":/debugger/images/debugger_stepover_small.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle); +const Icon STEP_OVER_TOOLBAR({ + {":/debugger/images/debugger_stepover_small.png", Theme::IconsBaseColor}}); +const Icon STEP_INTO({ + {":/debugger/images/debugger_stepinto_small.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle); +const Icon STEP_INTO_TOOLBAR({ + {":/debugger/images/debugger_stepinto_small.png", Theme::IconsBaseColor}}); +const Icon STEP_OUT({ + {":/debugger/images/debugger_stepout_small.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle); +const Icon STEP_OUT_TOOLBAR({ + {":/debugger/images/debugger_stepout_small.png", Theme::IconsBaseColor}}); +const Icon RESTART({ + {":/debugger/images/debugger_restart_small.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle); +const Icon RESTART_TOOLBAR({ + {":/debugger/images/debugger_restart_small.png", Theme::IconsRunToolBarColor}}); +const Icon SINGLE_INSTRUCTION_MODE({ + {":/debugger/images/debugger_singleinstructionmode.png", Theme::IconsBaseColor}}); + +const Icon MODE_DEBUGGER_CLASSIC( + ":/debugger/images/mode_debug.png"); +const Icon MODE_DEBUGGER_FLAT({ + {":/debugger/images/mode_debug_mask.png", Theme::IconsBaseColor}}); +const Icon MODE_DEBUGGER_FLAT_ACTIVE({ + {":/debugger/images/mode_debug_mask.png", Theme::IconsModeDebugActiveColor}}); + +} // namespace Icons +} // namespace Debugger diff --git a/src/plugins/debugger/debuggericons.h b/src/plugins/debugger/debuggericons.h index 220b06fe4cab99cf961ccd2acaa194095f5af5e8..7306ce920af9cf64b96a04c893402b23d0a70d7a 100644 --- a/src/plugins/debugger/debuggericons.h +++ b/src/plugins/debugger/debuggericons.h @@ -25,104 +25,54 @@ #pragma once +#include "debugger_global.h" + #include <utils/icon.h> namespace Debugger { namespace Icons { -const Utils::Icon BREAKPOINT({ - {QLatin1String(":/debugger/images/breakpoint.png"), Utils::Theme::IconsErrorColor}}, Utils::Icon::Tint); -const Utils::Icon BREAKPOINT_DISABLED({ - {QLatin1String(":/debugger/images/breakpoint_disabled.png"), Utils::Theme::IconsErrorColor}}, Utils::Icon::Tint); -const Utils::Icon BREAKPOINT_PENDING({ - {QLatin1String(":/debugger/images/breakpoint.png"), Utils::Theme::IconsErrorColor}, - {QLatin1String(":/debugger/images/breakpoint_pending_overlay.png"), Utils::Theme::PanelTextColorDark}}, Utils::Icon::IconStyleOptions(Utils::Icon::Tint | Utils::Icon::PunchEdges)); -const Utils::Icon BREAKPOINTS( - QLatin1String(":/debugger/images/debugger_breakpoints.png")); -const Utils::Icon WATCHPOINT({ - {QLatin1String(":/core/images/eye_open.png"), Utils::Theme::TextColorNormal}}, Utils::Icon::Tint); -const Utils::Icon TRACEPOINT({ - {QLatin1String(":/core/images/eye_open.png"), Utils::Theme::TextColorNormal}, - {QLatin1String(":/debugger/images/tracepointoverlay.png"), Utils::Theme::TextColorNormal}}, Utils::Icon::Tint | Utils::Icon::PunchEdges); -const Utils::Icon CONTINUE( - QLatin1String(":/debugger/images/debugger_continue.png")); -const Utils::Icon CONTINUE_FLAT({ - {QLatin1String(":/debugger/images/debugger_continue_1_mask.png"), Utils::Theme::IconsInterruptToolBarColor}, - {QLatin1String(":/debugger/images/debugger_continue_2_mask.png"), Utils::Theme::IconsRunToolBarColor}, - {QLatin1String(":/projectexplorer/images/debugger_beetle_mask.png"), Utils::Theme::IconsDebugColor}}); -const Utils::Icon DEBUG_CONTINUE_SMALL({ - {QLatin1String(":/projectexplorer/images/continue_1_small.png"), Utils::Theme::IconsInterruptColor}, - {QLatin1String(":/projectexplorer/images/continue_2_small.png"), Utils::Theme::IconsRunColor}, - {QLatin1String(":/projectexplorer/images/debugger_overlay_small.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle); -const Utils::Icon DEBUG_CONTINUE_SMALL_TOOLBAR({ - {QLatin1String(":/projectexplorer/images/continue_1_small.png"), Utils::Theme::IconsInterruptToolBarColor}, - {QLatin1String(":/projectexplorer/images/continue_2_small.png"), Utils::Theme::IconsRunToolBarColor}, - {QLatin1String(":/projectexplorer/images/debugger_overlay_small.png"), Utils::Theme::IconsDebugColor}}); -const Utils::Icon INTERRUPT( - QLatin1String(":/debugger/images/debugger_interrupt.png")); -const Utils::Icon INTERRUPT_FLAT({ - {QLatin1String(":/debugger/images/debugger_interrupt_mask.png"), Utils::Theme::IconsInterruptToolBarColor}, - {QLatin1String(":/projectexplorer/images/debugger_beetle_mask.png"), Utils::Theme::IconsDebugColor}}); -const Utils::Icon DEBUG_INTERRUPT_SMALL({ - {QLatin1String(":/core/images/interrupt_small.png"), Utils::Theme::IconsInterruptColor}, - {QLatin1String(":/projectexplorer/images/debugger_overlay_small.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle); -const Utils::Icon DEBUG_INTERRUPT_SMALL_TOOLBAR({ - {QLatin1String(":/core/images/interrupt_small.png"), Utils::Theme::IconsInterruptToolBarColor}, - {QLatin1String(":/projectexplorer/images/debugger_overlay_small.png"), Utils::Theme::IconsDebugColor}}); -const Utils::Icon DEBUG_EXIT_SMALL({ - {QLatin1String(":/core/images/stop_small.png"), Utils::Theme::IconsStopColor}, - {QLatin1String(":/projectexplorer/images/debugger_overlay_small.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle); -const Utils::Icon DEBUG_EXIT_SMALL_TOOLBAR({ - {QLatin1String(":/core/images/stop_small.png"), Utils::Theme::IconsStopToolBarColor}, - {QLatin1String(":/projectexplorer/images/debugger_overlay_small.png"), Utils::Theme::IconsDebugColor}}); -const Utils::Icon LOCATION({ - {QLatin1String(":/debugger/images/location_background.png"), Utils::Theme::IconsCodeModelOverlayForegroundColor}, - {QLatin1String(":/debugger/images/location.png"), Utils::Theme::IconsWarningToolBarColor}}, Utils::Icon::Tint); -const Utils::Icon REVERSE_MODE({ - {QLatin1String(":/debugger/images/debugger_reversemode_background.png"), Utils::Theme::IconsCodeModelOverlayForegroundColor}, - {QLatin1String(":/debugger/images/debugger_reversemode.png"), Utils::Theme::IconsInfoColor}}, Utils::Icon::Tint); -const Utils::Icon APP_ON_TOP({ - {QLatin1String(":/debugger/images/qml/app-on-top.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle); -const Utils::Icon APP_ON_TOP_TOOLBAR({ - {QLatin1String(":/debugger/images/qml/app-on-top.png"), Utils::Theme::IconsBaseColor}}); -const Utils::Icon SELECT({ - {QLatin1String(":/debugger/images/qml/select.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle); -const Utils::Icon SELECT_TOOLBAR({ - {QLatin1String(":/debugger/images/qml/select.png"), Utils::Theme::IconsBaseColor}}); -const Utils::Icon EMPTY( - QLatin1String(":/debugger/images/debugger_empty_14.png")); -const Utils::Icon RECORD_ON({ - {QLatin1String(":/debugger/images/recordfill.png"), Utils::Theme::IconsStopColor}, - {QLatin1String(":/debugger/images/recordoutline.png"), Utils::Theme::IconsBaseColor}}, Utils::Icon::Tint | Utils::Icon::DropShadow); -const Utils::Icon RECORD_OFF({ - {QLatin1String(":/debugger/images/recordfill.png"), Utils::Theme::IconsDisabledColor}, - {QLatin1String(":/debugger/images/recordoutline.png"), Utils::Theme::IconsBaseColor}}, Utils::Icon::Tint | Utils::Icon::DropShadow); +// Used in QmlProfiler. +DEBUGGER_EXPORT extern const Utils::Icon RECORD_ON; +DEBUGGER_EXPORT extern const Utils::Icon RECORD_OFF; + +extern const Utils::Icon BREAKPOINT; +extern const Utils::Icon BREAKPOINT_DISABLED; +extern const Utils::Icon BREAKPOINT_PENDING; +extern const Utils::Icon BREAKPOINTS; +extern const Utils::Icon WATCHPOINT; +extern const Utils::Icon TRACEPOINT; +extern const Utils::Icon CONTINUE; +extern const Utils::Icon CONTINUE_FLAT; +extern const Utils::Icon DEBUG_CONTINUE_SMALL; +extern const Utils::Icon DEBUG_CONTINUE_SMALL_TOOLBAR; +extern const Utils::Icon INTERRUPT; +extern const Utils::Icon INTERRUPT_FLAT; +extern const Utils::Icon DEBUG_INTERRUPT_SMALL; +extern const Utils::Icon DEBUG_INTERRUPT_SMALL_TOOLBAR; +extern const Utils::Icon DEBUG_EXIT_SMALL; +extern const Utils::Icon DEBUG_EXIT_SMALL_TOOLBAR; +extern const Utils::Icon LOCATION; +extern const Utils::Icon REVERSE_MODE; +extern const Utils::Icon APP_ON_TOP; +extern const Utils::Icon APP_ON_TOP_TOOLBAR; +extern const Utils::Icon SELECT; +extern const Utils::Icon SELECT_TOOLBAR; +extern const Utils::Icon EMPTY; -const Utils::Icon STEP_OVER({ - {QLatin1String(":/debugger/images/debugger_stepover_small.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle); -const Utils::Icon STEP_OVER_TOOLBAR({ - {QLatin1String(":/debugger/images/debugger_stepover_small.png"), Utils::Theme::IconsBaseColor}}); -const Utils::Icon STEP_INTO({ - {QLatin1String(":/debugger/images/debugger_stepinto_small.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle); -const Utils::Icon STEP_INTO_TOOLBAR({ - {QLatin1String(":/debugger/images/debugger_stepinto_small.png"), Utils::Theme::IconsBaseColor}}); -const Utils::Icon STEP_OUT({ - {QLatin1String(":/debugger/images/debugger_stepout_small.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle); -const Utils::Icon STEP_OUT_TOOLBAR({ - {QLatin1String(":/debugger/images/debugger_stepout_small.png"), Utils::Theme::IconsBaseColor}}); -const Utils::Icon RESTART({ - {QLatin1String(":/debugger/images/debugger_restart_small.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle); -const Utils::Icon RESTART_TOOLBAR({ - {QLatin1String(":/debugger/images/debugger_restart_small.png"), Utils::Theme::IconsRunToolBarColor}}); -const Utils::Icon SINGLE_INSTRUCTION_MODE({ - {QLatin1String(":/debugger/images/debugger_singleinstructionmode.png"), Utils::Theme::IconsBaseColor}}); +extern const Utils::Icon STEP_OVER; +extern const Utils::Icon STEP_OVER_TOOLBAR; +extern const Utils::Icon STEP_INTO; +extern const Utils::Icon STEP_INTO_TOOLBAR; +extern const Utils::Icon STEP_OUT; +extern const Utils::Icon STEP_OUT_TOOLBAR; +extern const Utils::Icon RESTART; +extern const Utils::Icon RESTART_TOOLBAR; +extern const Utils::Icon SINGLE_INSTRUCTION_MODE; -const Utils::Icon MODE_DEBUGGER_CLASSIC( - QLatin1String(":/debugger/images/mode_debug.png")); -const Utils::Icon MODE_DEBUGGER_FLAT({ - {QLatin1String(":/debugger/images/mode_debug_mask.png"), Utils::Theme::IconsBaseColor}}); -const Utils::Icon MODE_DEBUGGER_FLAT_ACTIVE({ - {QLatin1String(":/debugger/images/mode_debug_mask.png"), Utils::Theme::IconsModeDebugActiveColor}}); +extern const Utils::Icon MODE_DEBUGGER_CLASSIC; +extern const Utils::Icon MODE_DEBUGGER_FLAT; +extern const Utils::Icon MODE_DEBUGGER_FLAT_ACTIVE; } // namespace Icons } // namespace Debugger diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index c8213bed9fde7c80201b234275b1a5f417dd1edb..8ef07a30bf540ddc996622288700bc7a7018fab4 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -998,8 +998,6 @@ public: QToolButton *m_reverseToolButton = 0; - QIcon m_locationMarkIcon; - QLabel *m_threadLabel = 0; QComboBox *m_threadBox = 0; @@ -1310,8 +1308,6 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, const Context cppDebuggercontext(C_CPPDEBUGGER); const Context cppeditorcontext(CppEditor::Constants::CPPEDITOR_ID); - m_locationMarkIcon = Icons::LOCATION.icon(); - m_busy = false; m_logWindow = new LogWindow; @@ -3107,11 +3103,6 @@ void updateWatchersWindow(bool showWatch, bool showReturn) dd->m_returnWindow->setVisible(showReturn); } -QIcon locationMarkIcon() -{ - return dd->m_locationMarkIcon; -} - bool hasSnapshots() { return dd->m_snapshotHandler->size(); diff --git a/src/plugins/debugger/snapshothandler.cpp b/src/plugins/debugger/snapshothandler.cpp index 7bf37a5e568f57dfd17ccc8da4d1c44266f86445..d5b161582b9d5d2d6e5b0a951c704908efc079a4 100644 --- a/src/plugins/debugger/snapshothandler.cpp +++ b/src/plugins/debugger/snapshothandler.cpp @@ -119,8 +119,6 @@ QDebug operator<<(QDebug d, const SnapshotData &f) */ SnapshotHandler::SnapshotHandler() - : m_positionIcon(Icons::LOCATION.icon()), - m_emptyIcon(Icons::EMPTY.icon()) { m_currentIndex = -1; } @@ -178,8 +176,7 @@ QVariant SnapshotHandler::data(const QModelIndex &index, int role) const case Qt::DecorationRole: // Return icon that indicates whether this is the active stack frame. if (index.column() == 0) - return (index.row() == m_currentIndex) ? m_positionIcon : m_emptyIcon; - break; + return (index.row() == m_currentIndex) ? Icons::LOCATION.icon() : Icons::EMPTY.icon(); default: break; diff --git a/src/plugins/debugger/snapshothandler.h b/src/plugins/debugger/snapshothandler.h index b17a498867d603f78e10ed4555801e0459ae1cfa..acecb0531d69e8e367e6a20d8e311ef996cd05ab 100644 --- a/src/plugins/debugger/snapshothandler.h +++ b/src/plugins/debugger/snapshothandler.h @@ -65,8 +65,6 @@ private: int m_currentIndex; QList< QPointer<DebuggerEngine> > m_snapshots; - const QVariant m_positionIcon; - const QVariant m_emptyIcon; }; } // namespace Internal diff --git a/src/plugins/debugger/sourceagent.cpp b/src/plugins/debugger/sourceagent.cpp index f04bf49960c993c23961c25e6474f59701678822..1d9042d16ec020858fd5adbbf6d3012307ff8233 100644 --- a/src/plugins/debugger/sourceagent.cpp +++ b/src/plugins/debugger/sourceagent.cpp @@ -26,8 +26,8 @@ #include "sourceagent.h" #include "debuggerengine.h" +#include "debuggericons.h" #include "debuggerinternalconstants.h" -#include "debuggercore.h" #include "stackhandler.h" #include <coreplugin/editormanager/editormanager.h> @@ -141,7 +141,7 @@ void SourceAgent::updateLocationMarker() d->locationMark = new TextMark(QString(), lineNumber, Constants::TEXT_MARK_CATEGORY_LOCATION); - d->locationMark->setIcon(locationMarkIcon()); + d->locationMark->setIcon(Icons::LOCATION.icon()); d->locationMark->setPriority(TextMark::HighPriority); d->editor->textDocument()->addMark(d->locationMark); diff --git a/src/plugins/debugger/stackhandler.cpp b/src/plugins/debugger/stackhandler.cpp index 8ab60b86753e28b510f5a8a94375fbb240b2037f..ffcb003d3be8984bf97bd459bd20ee47929c14dd 100644 --- a/src/plugins/debugger/stackhandler.cpp +++ b/src/plugins/debugger/stackhandler.cpp @@ -54,9 +54,7 @@ namespace Internal { */ StackHandler::StackHandler(DebuggerEngine *engine) - : m_engine(engine), - m_positionIcon(Icons::LOCATION.icon()), - m_emptyIcon(Icons::EMPTY.icon()) + : m_engine(engine) { setObjectName(QLatin1String("StackModel")); m_resetLocationScheduled = false; @@ -93,7 +91,7 @@ QVariant StackHandler::data(const QModelIndex &index, int role) const if (role == Qt::DisplayRole && index.column() == StackFunctionNameColumn) return tr("<More>"); if (role == Qt::DecorationRole && index.column() == StackLevelColumn) - return m_emptyIcon; + return Icons::EMPTY.icon(); return QVariant(); } @@ -120,7 +118,7 @@ QVariant StackHandler::data(const QModelIndex &index, int role) const if (role == Qt::DecorationRole && index.column() == StackLevelColumn) { // Return icon that indicates whether this is the active stack frame return (m_contentsValid && index.row() == m_currentIndex) - ? m_positionIcon : m_emptyIcon; + ? Icons::LOCATION.icon() : Icons::EMPTY.icon(); } if (role == Qt::ToolTipRole && boolSetting(UseToolTipsInStackView)) diff --git a/src/plugins/debugger/stackhandler.h b/src/plugins/debugger/stackhandler.h index cbc298bb045bb230ad4ad53bd529e0d08b720017..6f88b1c3f28343dce5c194a3908a0280e9c1bace 100644 --- a/src/plugins/debugger/stackhandler.h +++ b/src/plugins/debugger/stackhandler.h @@ -88,8 +88,6 @@ private: DebuggerEngine *m_engine; StackFrames m_stackFrames; int m_currentIndex; - const QVariant m_positionIcon; - const QVariant m_emptyIcon; bool m_canExpand; bool m_resetLocationScheduled; bool m_contentsValid; diff --git a/src/plugins/debugger/threadshandler.cpp b/src/plugins/debugger/threadshandler.cpp index b5a2d343b86f30cc5c97b3cecb817b1358d67aa7..f387a9ae9743386ba5ae9ce143dbe55db0ea8aae 100644 --- a/src/plugins/debugger/threadshandler.cpp +++ b/src/plugins/debugger/threadshandler.cpp @@ -48,18 +48,6 @@ namespace Internal { // /////////////////////////////////////////////////////////////////////// -static const QIcon &positionIcon() -{ - static QIcon icon = Icons::LOCATION.icon(); - return icon; -} - -static const QIcon &emptyIcon() -{ - static QIcon icon = Icons::EMPTY.icon(); - return icon; -} - class ThreadItem : public TreeItem { Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::ThreadsHandler) @@ -79,7 +67,8 @@ public: case Qt::DecorationRole: // Return icon that indicates whether this is the active stack frame. if (column == 0) - return threadData.id == handler->currentThread() ? positionIcon() : emptyIcon(); + return threadData.id == handler->currentThread() ? Icons::LOCATION.icon() + : Icons::EMPTY.icon(); break; case ThreadData::IdRole: return threadData.id.raw();