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
+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