Changeset View
Changeset View
Standalone View
Standalone View
src/statusbar/dolphinstatusbar.cpp
| Show First 20 Lines • Show All 101 Lines • ▼ Show 20 Line(s) | 61 | { | |||
|---|---|---|---|---|---|
| 102 | m_resetToDefaultTextTimer = new QTimer(this); | 102 | m_resetToDefaultTextTimer = new QTimer(this); | ||
| 103 | m_resetToDefaultTextTimer->setInterval(ResetToDefaultTimeout); | 103 | m_resetToDefaultTextTimer->setInterval(ResetToDefaultTimeout); | ||
| 104 | m_resetToDefaultTextTimer->setSingleShot(true); | 104 | m_resetToDefaultTextTimer->setSingleShot(true); | ||
| 105 | connect(m_resetToDefaultTextTimer, &QTimer::timeout, this, &DolphinStatusBar::slotResetToDefaultText); | 105 | connect(m_resetToDefaultTextTimer, &QTimer::timeout, this, &DolphinStatusBar::slotResetToDefaultText); | ||
| 106 | 106 | | |||
| 107 | // Initialize top layout and size policies | 107 | // Initialize top layout and size policies | ||
| 108 | const int fontHeight = QFontMetrics(m_label->font()).height(); | 108 | const int fontHeight = QFontMetrics(m_label->font()).height(); | ||
| 109 | const int zoomSliderHeight = m_zoomSlider->minimumSizeHint().height(); | 109 | const int zoomSliderHeight = m_zoomSlider->minimumSizeHint().height(); | ||
| 110 | const int contentHeight = qMax(fontHeight, zoomSliderHeight); | 110 | const int buttonHeight = m_stopButton->height(); | ||
| 111 | const int contentHeight = qMax(qMax(fontHeight, zoomSliderHeight), buttonHeight); | ||||
| 111 | 112 | | |||
| 112 | QFontMetrics fontMetrics(m_label->font()); | 113 | QFontMetrics fontMetrics(m_label->font()); | ||
| 113 | 114 | | |||
| 114 | m_label->setFixedHeight(contentHeight); | 115 | m_label->setFixedHeight(contentHeight); | ||
| 115 | m_label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); | 116 | m_label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); | ||
| 116 | 117 | | |||
| 117 | m_zoomSlider->setMaximumWidth(fontMetrics.averageCharWidth() * 25); | 118 | m_zoomSlider->setMaximumWidth(fontMetrics.averageCharWidth() * 25); | ||
| 118 | 119 | | |||
| 119 | m_spaceInfo->setFixedHeight(contentHeight); | 120 | m_spaceInfo->setFixedHeight(zoomSliderHeight); | ||
elvisangelaccio: Now the space bar is actually smaller on Oxygen. I think we should use `zoomSliderHeight` here… | |||||
| 120 | m_spaceInfo->setMaximumWidth(fontMetrics.averageCharWidth() * 25); | 121 | m_spaceInfo->setMaximumWidth(fontMetrics.averageCharWidth() * 25); | ||
| 121 | m_spaceInfo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); | 122 | m_spaceInfo->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); | ||
| 122 | 123 | | |||
| 123 | m_progressBar->setFixedHeight(contentHeight); | 124 | m_progressBar->setFixedHeight(zoomSliderHeight); | ||
elvisangelaccio: and also here | |||||
| 124 | m_progressBar->setMaximumWidth(fontMetrics.averageCharWidth() * 25); | 125 | m_progressBar->setMaximumWidth(fontMetrics.averageCharWidth() * 25); | ||
| 125 | 126 | | |||
| 126 | QHBoxLayout* topLayout = new QHBoxLayout(this); | 127 | QHBoxLayout* topLayout = new QHBoxLayout(this); | ||
| 127 | topLayout->setMargin(0); | 128 | topLayout->setContentsMargins(2, 0, 2, 0); | ||
| 128 | topLayout->setSpacing(4); | 129 | topLayout->setSpacing(4); | ||
| 129 | topLayout->addWidget(m_label); | 130 | topLayout->addWidget(m_label); | ||
| 130 | topLayout->addWidget(m_zoomSlider); | 131 | topLayout->addWidget(m_zoomSlider); | ||
| 131 | topLayout->addWidget(m_spaceInfo); | 132 | topLayout->addWidget(m_spaceInfo); | ||
| 132 | topLayout->addWidget(m_stopButton); | 133 | topLayout->addWidget(m_stopButton); | ||
| 133 | topLayout->addWidget(m_progressTextLabel); | 134 | topLayout->addWidget(m_progressTextLabel); | ||
| 134 | topLayout->addWidget(m_progressBar); | 135 | topLayout->addWidget(m_progressBar); | ||
| 135 | 136 | | |||
| ▲ Show 20 Lines • Show All 224 Lines • Show Last 20 Lines | |||||
Now the space bar is actually smaller on Oxygen. I think we should use zoomSliderHeight here, instead.