QuickToolBar: use (x) icon to hide ToolBar

This commit is contained in:
Thomas Hartmann
2010-08-17 15:40:46 +02:00
parent cb7b38790f
commit 164b81add7

View File

@@ -51,21 +51,24 @@ namespace QmlEditorWidgets {
/* XPM */ /* XPM */
static const char * const line_xpm[] = { static const char * const line_xpm[] = {
"12 12 2 1", "14 14 3 1",
" c None", " c None",
". c #0c0c0c", ". c #0c0c0c",
"............", "x c #1c1c1c",
". .", "............. ",
". .", ". . ",
". .", ". x x . ",
". .", ". x x . ",
". .", ". x x . ",
". .", ". x x . ",
". .", ". x . ",
". .", ". x x . ",
". ........ .", ". x x . ",
". .", ". x x . ",
"............"}; ". x x . ",
". . ",
"............. ",
" "};
/* XPM */ /* XPM */
static const char * pin_xpm[] = { static const char * pin_xpm[] = {
@@ -171,7 +174,7 @@ ContextPaneWidget::ContextPaneWidget(QWidget *parent) : DragWidget(parent), m_cu
m_toolButton = new QToolButton(this); m_toolButton = new QToolButton(this);
m_toolButton->setAutoRaise(false); m_toolButton->setAutoRaise(false);
m_toolButton->setIcon(QPixmap::fromImage(QImage(line_xpm))); m_toolButton->setIcon(style()->standardIcon(QStyle::SP_DockWidgetCloseButton));
m_toolButton->setToolButtonStyle(Qt::ToolButtonIconOnly); m_toolButton->setToolButtonStyle(Qt::ToolButtonIconOnly);
m_toolButton->setFixedSize(16, 16); m_toolButton->setFixedSize(16, 16);
@@ -487,7 +490,7 @@ void ContextPaneWidget::setLineButton()
{ {
m_pinned = false; m_pinned = false;
m_toolButton->setAutoRaise(true); m_toolButton->setAutoRaise(true);
m_toolButton->setIcon(QPixmap::fromImage(QImage(line_xpm))); m_toolButton->setIcon(style()->standardIcon(QStyle::SP_DockWidgetCloseButton));
m_toolButton->setToolButtonStyle(Qt::ToolButtonIconOnly); m_toolButton->setToolButtonStyle(Qt::ToolButtonIconOnly);
m_toolButton->setFixedSize(20, 20); m_toolButton->setFixedSize(20, 20);
m_toolButton->setToolTip(tr("Hides this toolbar. This toolbar can be permantly disabled in the options or in the context menu.")); m_toolButton->setToolTip(tr("Hides this toolbar. This toolbar can be permantly disabled in the options or in the context menu."));