diff --git a/sdrgui/channel/channelgui.cpp b/sdrgui/channel/channelgui.cpp index 69e70ad5f..106df5191 100644 --- a/sdrgui/channel/channelgui.cpp +++ b/sdrgui/channel/channelgui.cpp @@ -44,6 +44,10 @@ ChannelGUI::ChannelGUI(QWidget *parent) : { qDebug("ChannelGUI::ChannelGUI"); setWindowFlags(windowFlags() | Qt::FramelessWindowHint); + setObjectName("ChannelGUI"); + setStyleSheet(QString(tr("#ChannelGUI { border: 1px solid %1; background-color: %2; }") + .arg(palette().highlight().color().darker(115).name())) + .arg(palette().dark().color().darker(115).name())); m_indexLabel = new QLabel(); m_indexLabel->setFixedSize(50, 16); @@ -124,8 +128,8 @@ ChannelGUI::ChannelGUI(QWidget *parent) : m_statusLabel->setToolTip("Channel status"); m_layouts = new QVBoxLayout(); - m_layouts->setContentsMargins(m_resizer.m_gripSize, 4, m_resizer.m_gripSize, 4); - m_layouts->setSpacing(2); + m_layouts->setContentsMargins(m_resizer.m_gripSize, m_resizer.m_gripSize, m_resizer.m_gripSize, m_resizer.m_gripSize); + m_layouts->setSpacing(0); m_topLayout = new QHBoxLayout(); m_topLayout->setContentsMargins(0, 0, 0, 0); @@ -152,6 +156,7 @@ ChannelGUI::ChannelGUI(QWidget *parent) : m_bottomLayout->addWidget(m_statusLabel); m_sizeGripBottomRight = new QSizeGrip(this); m_sizeGripBottomRight->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + m_sizeGripBottomRight->setFixedHeight(20); // m_bottomLayout->addStretch(1); m_bottomLayout->addWidget(m_sizeGripBottomRight, 0, Qt::AlignBottom | Qt::AlignRight); @@ -318,6 +323,7 @@ void ChannelGUI::shrinkWindow() { qDebug("ChannelGUI::shrinkWindow"); adjustSize(); + resize(width(), m_rollupContents->height() + getAdditionalHeight()); } void ChannelGUI::setTitle(const QString& title) diff --git a/sdrgui/channel/channelgui.h b/sdrgui/channel/channelgui.h index 9e02236ef..79199dd33 100644 --- a/sdrgui/channel/channelgui.h +++ b/sdrgui/channel/channelgui.h @@ -95,7 +95,7 @@ protected: void mouseMoveEvent(QMouseEvent* event) override; void resetContextMenuType() { m_contextMenuType = ContextMenuNone; } void updateIndexLabel(); - int getAdditionalHeight() const { return 29 + 26; } + int getAdditionalHeight() const { return 25 + 22; } DeviceType m_deviceType; int m_deviceSetIndex; diff --git a/sdrgui/feature/featuregui.cpp b/sdrgui/feature/featuregui.cpp index 764e8706b..7b732652f 100644 --- a/sdrgui/feature/featuregui.cpp +++ b/sdrgui/feature/featuregui.cpp @@ -39,6 +39,10 @@ FeatureGUI::FeatureGUI(QWidget *parent) : { qDebug("FeatureGUI::FeatureGUI"); setWindowFlags(windowFlags() | Qt::FramelessWindowHint); + setObjectName("FeatureGUI"); + setStyleSheet(QString(tr("#FeatureGUI { border: 1px solid %1; background-color: %2; }") + .arg(palette().highlight().color().darker(115).name())) + .arg(palette().dark().color().darker(115).name())); m_indexLabel = new QLabel(); m_indexLabel->setFixedSize(40, 16); @@ -90,8 +94,8 @@ FeatureGUI::FeatureGUI(QWidget *parent) : m_statusLabel->setToolTip("Feature status"); m_layouts = new QVBoxLayout(); - m_layouts->setContentsMargins(m_resizer.m_gripSize, 4, m_resizer.m_gripSize, 4); - m_layouts->setSpacing(2); + m_layouts->setContentsMargins(m_resizer.m_gripSize, m_resizer.m_gripSize, m_resizer.m_gripSize, m_resizer.m_gripSize); + m_layouts->setSpacing(0); m_topLayout = new QHBoxLayout(); m_topLayout->setContentsMargins(0, 0, 0, 0); @@ -112,6 +116,7 @@ FeatureGUI::FeatureGUI(QWidget *parent) : m_bottomLayout->addWidget(m_statusLabel); m_sizeGripBottomRight = new QSizeGrip(this); m_sizeGripBottomRight->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + m_sizeGripBottomRight->setFixedHeight(20); // m_bottomLayout->addStretch(1); m_bottomLayout->addWidget(m_sizeGripBottomRight, 0, Qt::AlignBottom | Qt::AlignRight); @@ -256,6 +261,7 @@ void FeatureGUI::shrinkWindow() { qDebug("FeatureGUI::shrinkWindow"); adjustSize(); + resize(width(), m_rollupContents.height() + getAdditionalHeight()); } void FeatureGUI::setTitle(const QString& title) diff --git a/sdrgui/feature/featuregui.h b/sdrgui/feature/featuregui.h index 0d8e5ae78..fbccad7b6 100644 --- a/sdrgui/feature/featuregui.h +++ b/sdrgui/feature/featuregui.h @@ -72,6 +72,7 @@ protected: void mouseReleaseEvent(QMouseEvent* event) override; void mouseMoveEvent(QMouseEvent* event) override; void resetContextMenuType() { m_contextMenuType = ContextMenuNone; } + int getAdditionalHeight() const { return 25 + 22; } int m_featureIndex; QString m_helpURL; diff --git a/sdrgui/gui/framelesswindowresizer.h b/sdrgui/gui/framelesswindowresizer.h index 931b36c63..7b2e106eb 100644 --- a/sdrgui/gui/framelesswindowresizer.h +++ b/sdrgui/gui/framelesswindowresizer.h @@ -54,7 +54,7 @@ public: void mouseMoveEvent(QMouseEvent* event); void leaveEvent(QEvent* event); - const int m_gripSize = 3; // Size in pixels of the border of the window that can be clicked in to resize it + const int m_gripSize = 2; // Size in pixels of the border of the window that can be clicked in to resize it protected: bool mouseOnTopBorder(QPoint pos) const; diff --git a/sdrgui/gui/rollupcontents.cpp b/sdrgui/gui/rollupcontents.cpp index cce640575..aa5c90b5e 100644 --- a/sdrgui/gui/rollupcontents.cpp +++ b/sdrgui/gui/rollupcontents.cpp @@ -92,22 +92,6 @@ void RollupContents::setHighlighted(bool highlighted) } } -int RollupContents::getAdditionalHeiht() -{ - int pos = 0; - - for (int i = 0; i < children().count(); ++i) - { - QWidget* r = qobject_cast(children()[i]); - - if (r && isRollupChild(r) && !r->isHidden()) { - pos += 5; - } - } - - return pos; -} - bool RollupContents::hasExpandableWidgets() { for (int i = 0; i < children().count(); ++i) @@ -218,7 +202,8 @@ int RollupContents::arrangeRollups() void RollupContents::paintEvent(QPaintEvent*) { QPainter p(this); - QColor frameColor = palette().highlight().color().darker(115); + QColor frameColor = palette().highlight().color().darker(125); + // QColor frameColor = Qt::black; // Eigenbau QFontMetrics fm(font()); @@ -237,9 +222,10 @@ void RollupContents::paintEvent(QPaintEvent*) p.setPen(m_highlighted ? Qt::white : frameColor); p.setBrush(palette().window()); QRectF r(rect()); - r.adjust(0.5, 0.5, -0.5, -0.5); + // r.adjust(0.5, 0.5, -0.5, -0.5); // p.drawRoundedRect(r, 3.0, 3.0, Qt::AbsoluteSize); - p.drawRect(r); + // p.drawRect(r); + p.fillRect(r, palette().window()); // Rollups int pos = 2; // fm.height() + 4; diff --git a/sdrgui/gui/rollupcontents.h b/sdrgui/gui/rollupcontents.h index 2777b6f78..898505a59 100644 --- a/sdrgui/gui/rollupcontents.h +++ b/sdrgui/gui/rollupcontents.h @@ -34,7 +34,6 @@ public: void saveState(RollupState& state) const; void restoreState(const RollupState& state); int arrangeRollups(); - int getAdditionalHeiht(); bool hasExpandableWidgets(); signals: