Commit 5b736f96 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.propertyEditor: stabilize collapse button

parent 74d8802e
......@@ -475,6 +475,11 @@ void PropertyEditor::expand()
while (parentWidget) {
if (Core::SideBar *sideBar = qobject_cast<Core::SideBar*>(parentWidget)) {
childWidget->setMaximumWidth(2000);
foreach (QObject* child, sideBar->children()) {
if (QWidget* otherWidget = qobject_cast<QWidget*>(child))
if (otherWidget != childWidget && !qobject_cast<QComboBox*>(otherWidget))
otherWidget->show();
}
QList<QComboBox*> list = sideBar->findChildren<QComboBox*>();
foreach (QComboBox* box, list) {
if (qobject_cast<QToolBar*>(box->parentWidget()))
......@@ -502,10 +507,18 @@ void PropertyEditor::collapse()
while (parentWidget) {
if (Core::SideBar *sideBar = qobject_cast<Core::SideBar*>(parentWidget)) {
childWidget->setMaximumWidth(22);
foreach (QObject* child, sideBar->children()) {
if (QWidget* otherWidget = qobject_cast<QWidget*>(child))
if (otherWidget != childWidget && !qobject_cast<QComboBox*>(otherWidget))
otherWidget->hide();
}
QSplitter* parentSplitter = qobject_cast<QSplitter*>(sideBar->parentWidget());
QList<int> s = sideBar->sizes();
QList<int> s = parentSplitter->sizes();
qDebug() << s;
s.removeLast();
s.append(25);
qDebug() << s;
parentSplitter->setSizes(s);
parentSplitter->refresh();
parentSplitter->update();
......@@ -574,7 +587,7 @@ void PropertyEditor::setQmlDir(const QString &qmlDir)
void PropertyEditor::delayedResetView()
{
if (m_timerId == 0)
m_timerId = startTimer(500);
m_timerId = startTimer(200);
}
void PropertyEditor::timerEvent(QTimerEvent *timerEvent)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment