diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2023-03-29 15:58:56 +0200 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2023-03-30 09:14:31 +0000 |
commit | cb3fd6eb0dd564b7ff9d58473fe00d83bd24011c (patch) | |
tree | 783abe7e77f9f31cbc9afa566ec8f26406ed4ac6 /src/libs/qmleditorwidgets/contextpanewidget.cpp | |
parent | 73c645820fe3df797b5e813c1881afabcab0fd7e (diff) |
Utils: Introduce Utils::Icons::PINNED_SMALL
Replaces two duplicated pin.xpm in the pinnable debugger tooltip and the
qmleditorwidgets with the new icon.
Change-Id: I57b7adc5c0b92ffdf01da12dd832482d739cb86e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/libs/qmleditorwidgets/contextpanewidget.cpp')
-rw-r--r-- | src/libs/qmleditorwidgets/contextpanewidget.cpp | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/src/libs/qmleditorwidgets/contextpanewidget.cpp b/src/libs/qmleditorwidgets/contextpanewidget.cpp index 688c65ad7b3..8d675bf95b1 100644 --- a/src/libs/qmleditorwidgets/contextpanewidget.cpp +++ b/src/libs/qmleditorwidgets/contextpanewidget.cpp @@ -6,6 +6,7 @@ #include "qmleditorwidgetstr.h" #include <utils/hostosinfo.h> +#include <utils/utilsicons.h> #include <QToolButton> #include <QFontComboBox> @@ -27,26 +28,6 @@ using namespace Utils; namespace QmlEditorWidgets { -/* XPM */ -static const char * pin_xpm[] = { -"12 9 7 1", -" c None", -". c #000000", -"+ c #515151", -"@ c #A8A8A8", -"# c #A9A9A9", -"$ c #999999", -"% c #696969", -" . ", -" ......+", -" .@@@@@.", -" .#####.", -"+.....$$$$$.", -" .%%%%%.", -" .......", -" ......+", -" . "}; - DragWidget::DragWidget(QWidget *parent) : QFrame(parent) { setFrameStyle(QFrame::NoFrame); @@ -143,7 +124,7 @@ ContextPaneWidget::ContextPaneWidget(QWidget *parent) : DragWidget(parent), m_cu m_toolButton->setIcon(style()->standardIcon(QStyle::SP_DockWidgetCloseButton)); m_toolButton->setToolButtonStyle(Qt::ToolButtonIconOnly); - m_toolButton->setFixedSize(16, 16); + m_toolButton->setFixedSize(20, 20); m_toolButton->setToolTip(Tr::tr("Hides this toolbar.")); connect(m_toolButton, &QToolButton::clicked, this, &ContextPaneWidget::onTogglePane); @@ -464,9 +445,7 @@ void ContextPaneWidget::setPinButton() m_toolButton->setAutoRaise(true); m_pinned = true; - m_toolButton->setIcon(QPixmap::fromImage(QImage(pin_xpm))); - m_toolButton->setToolButtonStyle(Qt::ToolButtonIconOnly); - m_toolButton->setFixedSize(20, 20); + m_toolButton->setIcon(Utils::Icons::PINNED_SMALL.icon()); m_toolButton->setToolTip(Tr::tr("Unpins the toolbar and moves it to the default position.")); emit pinnedChanged(true); @@ -481,8 +460,6 @@ void ContextPaneWidget::setLineButton() m_pinned = false; m_toolButton->setAutoRaise(true); m_toolButton->setIcon(style()->standardIcon(QStyle::SP_DockWidgetCloseButton)); - m_toolButton->setToolButtonStyle(Qt::ToolButtonIconOnly); - m_toolButton->setFixedSize(20, 20); m_toolButton->setToolTip(Tr::tr("Hides this toolbar. This toolbar can be" " permanently disabled in the options page or in the context menu.")); |