forked from qt-creator/qt-creator
QmlDesigner: Implement transient scrollbar for widgets in studiostyle
Task-number: QDS-9556 Task-number: QDS-10368 Task-number: QDS-10385 Change-Id: Idcbc70db3075f7741a754376580f48d7df40e67a Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
This commit is contained in:
committed by
Ali Kianian
parent
98a28d30bc
commit
c78e0965c0
@@ -50,6 +50,7 @@ public:
|
||||
DockAreaWidget *m_dockArea = nullptr;
|
||||
QAction *m_toggleViewAction = nullptr;
|
||||
bool m_closed = false;
|
||||
bool m_focused = false;
|
||||
QScrollArea *m_scrollArea = nullptr;
|
||||
QToolBar *m_toolBar = nullptr;
|
||||
Qt::ToolButtonStyle m_toolBarStyleDocked = Qt::ToolButtonIconOnly;
|
||||
@@ -219,6 +220,7 @@ void DockWidgetPrivate::setupScrollArea()
|
||||
m_scrollArea = new QScrollArea(q);
|
||||
m_scrollArea->setObjectName("dockWidgetScrollArea");
|
||||
m_scrollArea->setWidgetResizable(true);
|
||||
m_scrollArea->setProperty("focused", q->isFocused());
|
||||
m_layout->addWidget(m_scrollArea);
|
||||
}
|
||||
|
||||
@@ -439,6 +441,21 @@ bool DockWidget::isClosed() const
|
||||
return d->m_closed;
|
||||
}
|
||||
|
||||
void DockWidget::setFocused(bool focused)
|
||||
{
|
||||
if (d->m_focused == focused)
|
||||
return;
|
||||
|
||||
d->m_focused = focused;
|
||||
if (d->m_scrollArea)
|
||||
d->m_scrollArea->setProperty("focused", focused);
|
||||
}
|
||||
|
||||
bool DockWidget::isFocused() const
|
||||
{
|
||||
return d->m_focused;
|
||||
}
|
||||
|
||||
QAction *DockWidget::toggleViewAction() const
|
||||
{
|
||||
return d->m_toggleViewAction;
|
||||
|
||||
Reference in New Issue
Block a user