panels: implement a small margin on all panels to ensure the focus border is always visible

This commit is contained in:
itsmattkc
2020-04-20 18:06:50 +10:00
parent cb14af326c
commit 84e73395ff
9 changed files with 18 additions and 6 deletions
+1
View File
@@ -39,6 +39,7 @@ CurveWidget::CurveWidget(QWidget *parent) :
bridge_(nullptr)
{
QVBoxLayout* layout = new QVBoxLayout(this);
layout->setMargin(0);
QHBoxLayout* top_controls = new QHBoxLayout();
+10
View File
@@ -22,6 +22,7 @@
#include <QCloseEvent>
#include <QDebug>
#include <QHBoxLayout>
#include <QPainter>
#include <QStyle>
#include <QStyleOption>
@@ -144,4 +145,13 @@ void PanelWidget::Retranslate()
{
}
void PanelWidget::SetWidgetWithPadding(QWidget *widget)
{
QWidget* wrapper = new QWidget();
QHBoxLayout* layout = new QHBoxLayout(wrapper);
layout->setMargin(layout->margin() / 2);
layout->addWidget(widget);
setWidget(wrapper);
}
OLIVE_NAMESPACE_EXIT
+2
View File
@@ -181,6 +181,8 @@ protected:
virtual void Retranslate();
void SetWidgetWithPadding(QWidget* widget);
protected slots:
/**
* @brief Set panel's title
+1
View File
@@ -60,6 +60,7 @@ ManagedPixelSamplerWidget::ManagedPixelSamplerWidget(QWidget *parent) :
QWidget(parent)
{
QVBoxLayout* layout = new QVBoxLayout(this);
layout->setMargin(0);
display_view_ = new PixelSamplerWidget();
display_view_->setTitle(tr("Display"));