panels: implement a small margin on all panels to ensure the focus border is always visible
This commit is contained in:
@@ -32,7 +32,7 @@ NodePanel::NodePanel(QWidget *parent) :
|
|||||||
connect(node_view_, SIGNAL(SelectionChanged(QList<Node*>)), this, SIGNAL(SelectionChanged(QList<Node*>)));
|
connect(node_view_, SIGNAL(SelectionChanged(QList<Node*>)), this, SIGNAL(SelectionChanged(QList<Node*>)));
|
||||||
|
|
||||||
// Set it as the main widget of this panel
|
// Set it as the main widget of this panel
|
||||||
setWidget(node_view_);
|
SetWidgetWithPadding(node_view_);
|
||||||
|
|
||||||
// Set strings
|
// Set strings
|
||||||
Retranslate();
|
Retranslate();
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ PixelSamplerPanel::PixelSamplerPanel(QWidget *parent) :
|
|||||||
PanelWidget(QStringLiteral("ProjectPanel"), parent)
|
PanelWidget(QStringLiteral("ProjectPanel"), parent)
|
||||||
{
|
{
|
||||||
sampler_widget_ = new ManagedPixelSamplerWidget();
|
sampler_widget_ = new ManagedPixelSamplerWidget();
|
||||||
setWidget(sampler_widget_);
|
SetWidgetWithPadding(sampler_widget_);
|
||||||
|
|
||||||
Retranslate();
|
Retranslate();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,8 +40,6 @@ ProjectPanel::ProjectPanel(QWidget *parent) :
|
|||||||
// Create main widget and its layout
|
// Create main widget and its layout
|
||||||
QWidget* central_widget = new QWidget(this);
|
QWidget* central_widget = new QWidget(this);
|
||||||
QVBoxLayout* layout = new QVBoxLayout(central_widget);
|
QVBoxLayout* layout = new QVBoxLayout(central_widget);
|
||||||
layout->setMargin(0);
|
|
||||||
//layout->setSpacing(0);
|
|
||||||
setWidget(central_widget);
|
setWidget(central_widget);
|
||||||
|
|
||||||
// Set up project toolbar
|
// Set up project toolbar
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ void TimeBasedPanel::SetTimeBasedWidget(TimeBasedWidget *widget)
|
|||||||
connect(widget_, &TimeBasedWidget::TimebaseChanged, this, &TimeBasedPanel::TimebaseChanged);
|
connect(widget_, &TimeBasedWidget::TimebaseChanged, this, &TimeBasedPanel::TimebaseChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
setWidget(widget_);
|
SetWidgetWithPadding(widget_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TimeBasedPanel::Retranslate()
|
void TimeBasedPanel::Retranslate()
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ ToolPanel::ToolPanel(QWidget *parent) :
|
|||||||
t->SetTool(Core::instance()->tool());
|
t->SetTool(Core::instance()->tool());
|
||||||
t->SetSnapping(Core::instance()->snapping());
|
t->SetSnapping(Core::instance()->snapping());
|
||||||
|
|
||||||
setWidget(t);
|
SetWidgetWithPadding(t);
|
||||||
|
|
||||||
connect(t, &Toolbar::ToolChanged, Core::instance(), &Core::SetTool);
|
connect(t, &Toolbar::ToolChanged, Core::instance(), &Core::SetTool);
|
||||||
connect(Core::instance(), &Core::ToolChanged, t, &Toolbar::SetTool);
|
connect(Core::instance(), &Core::ToolChanged, t, &Toolbar::SetTool);
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ CurveWidget::CurveWidget(QWidget *parent) :
|
|||||||
bridge_(nullptr)
|
bridge_(nullptr)
|
||||||
{
|
{
|
||||||
QVBoxLayout* layout = new QVBoxLayout(this);
|
QVBoxLayout* layout = new QVBoxLayout(this);
|
||||||
|
layout->setMargin(0);
|
||||||
|
|
||||||
QHBoxLayout* top_controls = new QHBoxLayout();
|
QHBoxLayout* top_controls = new QHBoxLayout();
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include <QCloseEvent>
|
#include <QCloseEvent>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QHBoxLayout>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QStyle>
|
#include <QStyle>
|
||||||
#include <QStyleOption>
|
#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
|
OLIVE_NAMESPACE_EXIT
|
||||||
|
|||||||
@@ -181,6 +181,8 @@ protected:
|
|||||||
|
|
||||||
virtual void Retranslate();
|
virtual void Retranslate();
|
||||||
|
|
||||||
|
void SetWidgetWithPadding(QWidget* widget);
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
/**
|
/**
|
||||||
* @brief Set panel's title
|
* @brief Set panel's title
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ ManagedPixelSamplerWidget::ManagedPixelSamplerWidget(QWidget *parent) :
|
|||||||
QWidget(parent)
|
QWidget(parent)
|
||||||
{
|
{
|
||||||
QVBoxLayout* layout = new QVBoxLayout(this);
|
QVBoxLayout* layout = new QVBoxLayout(this);
|
||||||
|
layout->setMargin(0);
|
||||||
|
|
||||||
display_view_ = new PixelSamplerWidget();
|
display_view_ = new PixelSamplerWidget();
|
||||||
display_view_->setTitle(tr("Display"));
|
display_view_->setTitle(tr("Display"));
|
||||||
|
|||||||
Reference in New Issue
Block a user