# HG changeset patch # User Chris Cannam # Date 1481812780 0 # Node ID 2513f660c18379e0659cb600233b3429ab7dd956 # Parent 7609580fb05a8ade15ee12a6a85b2af7814dc046 An attempt to improve PropertyBox layout on the Mac. Make all rows consistent by always creating a group layout for each row, regardless of whether the item(s) in it are marked as grouped or not. diff -r 7609580fb05a -r 2513f660c183 widgets/PropertyBox.cpp --- a/widgets/PropertyBox.cpp Thu Dec 15 11:54:12 2016 +0000 +++ b/widgets/PropertyBox.cpp Thu Dec 15 14:39:40 2016 +0000 @@ -169,6 +169,7 @@ m_playButton = new NotifyingToolButton; m_playButton->setCheckable(true); m_playButton->setIcon(IconLoader().load("speaker")); + m_playButton->setToolTip(tr("Click to toggle playback")); m_playButton->setChecked(!params->isPlayMuted()); m_playButton->setFixedSize(buttonSize); connect(m_playButton, SIGNAL(toggled(bool)), @@ -261,24 +262,31 @@ bool inGroup = (groupName != QString()); if (!have) { + + QLabel *labelWidget = 0; + if (inGroup) { if (m_groupLayouts.find(groupName) == m_groupLayouts.end()) { -#ifdef DEBUG_PROPERTY_BOX - cerr << "PropertyBox: adding label \"" << groupName << "\" and frame for group for \"" << name << "\"" << endl; -#endif - m_layout->addWidget(new QLabel(groupName, m_mainWidget), row, 0); - QFrame *frame = new QFrame(m_mainWidget); - m_layout->addWidget(frame, row, 1, 1, 2); - m_groupLayouts[groupName] = new QGridLayout; - m_groupLayouts[groupName]->setMargin(0); - frame->setLayout(m_groupLayouts[groupName]); - } - } else { -#ifdef DEBUG_PROPERTY_BOX - cerr << "PropertyBox: adding label \"" << propertyLabel << "\"" << endl; -#endif - m_layout->addWidget(new QLabel(propertyLabel, m_mainWidget), row, 0); - } + labelWidget = new QLabel(groupName, m_mainWidget); + } + } else { + inGroup = true; + groupName = "ungrouped: " + propertyLabel; + if (m_groupLayouts.find(groupName) == m_groupLayouts.end()) { + labelWidget = new QLabel(propertyLabel, m_mainWidget); + } + } + + if (labelWidget) { + m_layout->addWidget(labelWidget, row, 0); + QWidget *frame = new QWidget(m_mainWidget); + frame->setMinimumSize(WidgetScale::scaleQSize(QSize(1, 24))); + m_groupLayouts[groupName] = new QGridLayout; + m_groupLayouts[groupName]->setMargin(0); + frame->setLayout(m_groupLayouts[groupName]); + m_layout->addWidget(frame, row, 1, 1, 2); + m_layout->setColumnStretch(1, 10); + } } switch (type) {