Changeset View
Changeset View
Standalone View
Standalone View
kdevplatform/sublime/idealbuttonbarwidget.cpp
Show First 20 Lines • Show All 104 Lines • ▼ Show 20 Line(s) | 101 | IdealButtonBarWidget::IdealButtonBarWidget(Qt::DockWidgetArea area, | |||
---|---|---|---|---|---|
105 | , m_controller(controller) | 105 | , m_controller(controller) | ||
106 | , m_corner(nullptr) | 106 | , m_corner(nullptr) | ||
107 | , m_showState(false) | 107 | , m_showState(false) | ||
108 | , m_buttonsLayout(nullptr) | 108 | , m_buttonsLayout(nullptr) | ||
109 | { | 109 | { | ||
110 | setContextMenuPolicy(Qt::CustomContextMenu); | 110 | setContextMenuPolicy(Qt::CustomContextMenu); | ||
111 | setToolTip(i18nc("@info:tooltip", "Right click to add new tool views.")); | 111 | setToolTip(i18nc("@info:tooltip", "Right click to add new tool views.")); | ||
112 | 112 | | |||
113 | m_buttonsLayout = new IdealButtonBarLayout(orientation()); | ||||
113 | if (area == Qt::BottomDockWidgetArea) | 114 | if (area == Qt::BottomDockWidgetArea) | ||
114 | { | 115 | { | ||
115 | QBoxLayout *statusLayout = new QBoxLayout(QBoxLayout::LeftToRight, this); | 116 | QBoxLayout *statusLayout = new QBoxLayout(QBoxLayout::LeftToRight, this); | ||
116 | statusLayout->setMargin(0); | 117 | statusLayout->setMargin(0); | ||
117 | 118 | | |||
118 | m_buttonsLayout = new IdealButtonBarLayout(orientation()); | | |||
119 | statusLayout->addLayout(m_buttonsLayout); | 119 | statusLayout->addLayout(m_buttonsLayout); | ||
120 | 120 | | |||
121 | statusLayout->addStretch(1); | 121 | statusLayout->addStretch(1); | ||
122 | 122 | | |||
123 | m_corner = new QWidget(this); | 123 | m_corner = new QWidget(this); | ||
124 | QBoxLayout *cornerLayout = new QBoxLayout(QBoxLayout::LeftToRight, m_corner); | 124 | QBoxLayout *cornerLayout = new QBoxLayout(QBoxLayout::LeftToRight, m_corner); | ||
125 | cornerLayout->setMargin(0); | 125 | cornerLayout->setMargin(0); | ||
126 | cornerLayout->setSpacing(0); | 126 | cornerLayout->setSpacing(0); | ||
127 | statusLayout->addWidget(m_corner); | 127 | statusLayout->addWidget(m_corner); | ||
128 | } else { | ||||
129 | QBoxLayout *superLayout = new QBoxLayout(QBoxLayout::TopToBottom, this); | ||||
130 | superLayout->setMargin(0); | ||||
131 | | ||||
132 | superLayout->addLayout(m_buttonsLayout); | ||||
133 | superLayout->addStretch(1); | ||||
128 | } | 134 | } | ||
129 | else | | |||
130 | m_buttonsLayout = new IdealButtonBarLayout(orientation(), this); | | |||
131 | } | 135 | } | ||
132 | 136 | | |||
133 | QAction* IdealButtonBarWidget::addWidget(IdealDockWidget *dock, | 137 | QAction* IdealButtonBarWidget::addWidget(IdealDockWidget *dock, | ||
134 | Area *area, View *view) | 138 | Area *area, View *view) | ||
135 | { | 139 | { | ||
136 | if (m_area == Qt::BottomDockWidgetArea || m_area == Qt::TopDockWidgetArea) | 140 | if (m_area == Qt::BottomDockWidgetArea || m_area == Qt::TopDockWidgetArea) | ||
137 | dock->setFeatures( dock->features() | IdealDockWidget::DockWidgetVerticalTitleBar ); | 141 | dock->setFeatures( dock->features() | IdealDockWidget::DockWidgetVerticalTitleBar ); | ||
138 | 142 | | |||
▲ Show 20 Lines • Show All 222 Lines • Show Last 20 Lines |