mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Define and use a common set of content margin sizes
This commit is contained in:
parent
9fc380dd5f
commit
43c5705c8b
@ -24,6 +24,8 @@
|
|||||||
|
|
||||||
#include "DockWidget.h"
|
#include "DockWidget.h"
|
||||||
|
|
||||||
|
#include "cafStyleSheetTools.h"
|
||||||
|
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QPlainTextEdit>
|
#include <QPlainTextEdit>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
@ -42,7 +44,7 @@ RiuMessagePanel::RiuMessagePanel( QWidget* parent )
|
|||||||
: QWidget( parent )
|
: QWidget( parent )
|
||||||
{
|
{
|
||||||
QVBoxLayout* layout = new QVBoxLayout( this );
|
QVBoxLayout* layout = new QVBoxLayout( this );
|
||||||
layout->setMargin( 0 );
|
layout->setMargin( caf::StyleSheetTools::smallContentMargin() );
|
||||||
|
|
||||||
m_textEdit = new QPlainTextEdit;
|
m_textEdit = new QPlainTextEdit;
|
||||||
m_textEdit->setReadOnly( true );
|
m_textEdit->setReadOnly( true );
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
|
|
||||||
#include "cafPdmObject.h"
|
#include "cafPdmObject.h"
|
||||||
#include "cafPdmUiDefaultObjectEditor.h"
|
#include "cafPdmUiDefaultObjectEditor.h"
|
||||||
|
#include "cafStyleSheetTools.h"
|
||||||
|
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
@ -96,7 +97,10 @@ PdmUiPropertyView::PdmUiPropertyView( QWidget* parent, Qt::WindowFlags f )
|
|||||||
m_scrollArea->setWidget( m_placeholder );
|
m_scrollArea->setWidget( m_placeholder );
|
||||||
|
|
||||||
m_placeHolderLayout = new QVBoxLayout();
|
m_placeHolderLayout = new QVBoxLayout();
|
||||||
m_placeHolderLayout->setContentsMargins( 5, 5, 5, 0 );
|
m_placeHolderLayout->setContentsMargins( caf::StyleSheetTools::mediumContentMargin(),
|
||||||
|
caf::StyleSheetTools::mediumContentMargin(),
|
||||||
|
caf::StyleSheetTools::mediumContentMargin(),
|
||||||
|
0 );
|
||||||
m_placeholder->setLayout( m_placeHolderLayout );
|
m_placeholder->setLayout( m_placeHolderLayout );
|
||||||
|
|
||||||
QVBoxLayout* dummy = new QVBoxLayout( this );
|
QVBoxLayout* dummy = new QVBoxLayout( this );
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
#include "cafPdmUiTreeOrdering.h"
|
#include "cafPdmUiTreeOrdering.h"
|
||||||
#include "cafPdmUiTreeViewEditor.h"
|
#include "cafPdmUiTreeViewEditor.h"
|
||||||
#include "cafQTreeViewStateSerializer.h"
|
#include "cafQTreeViewStateSerializer.h"
|
||||||
|
#include "cafStyleSheetTools.h"
|
||||||
|
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
@ -59,7 +60,12 @@ PdmUiTreeView::PdmUiTreeView( QWidget* parent, Qt::WindowFlags f )
|
|||||||
: QWidget( parent, f )
|
: QWidget( parent, f )
|
||||||
{
|
{
|
||||||
m_layout = new QVBoxLayout();
|
m_layout = new QVBoxLayout();
|
||||||
m_layout->setContentsMargins( 0, 0, 0, 0 );
|
|
||||||
|
// 0 as content margin has been used for a long time, but that is too little
|
||||||
|
m_layout->setContentsMargins( caf::StyleSheetTools::mediumContentMargin(),
|
||||||
|
caf::StyleSheetTools::mediumContentMargin(),
|
||||||
|
caf::StyleSheetTools::mediumContentMargin(),
|
||||||
|
caf::StyleSheetTools::mediumContentMargin() );
|
||||||
|
|
||||||
setLayout( m_layout );
|
setLayout( m_layout );
|
||||||
|
|
||||||
|
@ -70,3 +70,19 @@ QString StyleSheetTools::colorStringWithAlpha( const QColor& color )
|
|||||||
{
|
{
|
||||||
return QString( "rgba(%1, %2, %3, %4)" ).arg( color.red() ).arg( color.green() ).arg( color.blue() ).arg( color.alpha() );
|
return QString( "rgba(%1, %2, %3, %4)" ).arg( color.red() ).arg( color.green() ).arg( color.blue() ).arg( color.alpha() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
int StyleSheetTools::smallContentMargin()
|
||||||
|
{
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
int StyleSheetTools::mediumContentMargin()
|
||||||
|
{
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
@ -50,6 +50,10 @@ public:
|
|||||||
const QColor& backgroundColor,
|
const QColor& backgroundColor,
|
||||||
const QColor& backgroundFrameColor );
|
const QColor& backgroundFrameColor );
|
||||||
static QString colorStringWithAlpha( const QColor& color );
|
static QString colorStringWithAlpha( const QColor& color );
|
||||||
|
|
||||||
|
// Default content margin on most platforms is 11 pixels
|
||||||
|
static int smallContentMargin();
|
||||||
|
static int mediumContentMargin();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace caf
|
} // namespace caf
|
||||||
|
Loading…
Reference in New Issue
Block a user