mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1365 Whitespace and comment headers
This commit is contained in:
parent
bf9d65d249
commit
6e6e884ab3
@ -33,14 +33,15 @@
|
|||||||
// for more details.
|
// for more details.
|
||||||
//
|
//
|
||||||
//##################################################################################################
|
//##################################################################################################
|
||||||
|
|
||||||
#include "QMinimizePanel.h"
|
#include "QMinimizePanel.h"
|
||||||
|
|
||||||
|
#include <QApplication>
|
||||||
#include <QFrame>
|
#include <QFrame>
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QPixmap>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QResizeEvent>
|
#include <QResizeEvent>
|
||||||
#include <QLabel>
|
|
||||||
#include "QApplication"
|
|
||||||
#include <QPixmap>
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
@ -128,6 +129,9 @@ QMinimizePanel::QMinimizePanel(const QString &title, QWidget* parent/*=0*/)
|
|||||||
this->initialize(title);
|
this->initialize(title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
void QMinimizePanel::initialize(const QString &title)
|
void QMinimizePanel::initialize(const QString &title)
|
||||||
{
|
{
|
||||||
m_titleFrame = new QFrame(this);
|
m_titleFrame = new QFrame(this);
|
||||||
@ -159,7 +163,6 @@ void QMinimizePanel::initialize(const QString &title)
|
|||||||
|
|
||||||
QPalette contentFramePalette = m_contentFrame->palette();
|
QPalette contentFramePalette = m_contentFrame->palette();
|
||||||
contentFramePalette.setBrush(QPalette::Window, QColor(255,250,250,85));
|
contentFramePalette.setBrush(QPalette::Window, QColor(255,250,250,85));
|
||||||
//contentFramePalette.setBrush(QPalette::Foreground, contentFramePalette.dark());
|
|
||||||
m_contentFrame->setPalette(contentFramePalette);
|
m_contentFrame->setPalette(contentFramePalette);
|
||||||
|
|
||||||
connect(m_collapseButton, SIGNAL(clicked()),this, SLOT(toggleExpanded()) );
|
connect(m_collapseButton, SIGNAL(clicked()),this, SLOT(toggleExpanded()) );
|
||||||
@ -203,6 +206,7 @@ QSize QMinimizePanel::sizeHint() const
|
|||||||
QSize contentsMin(m_contentFrame->sizeHint());
|
QSize contentsMin(m_contentFrame->sizeHint());
|
||||||
QSize total = contentsMin.expandedTo(titleBarMin);
|
QSize total = contentsMin.expandedTo(titleBarMin);
|
||||||
total.rheight() += titleBarMin.height();
|
total.rheight() += titleBarMin.height();
|
||||||
|
|
||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -247,6 +251,7 @@ QSize QMinimizePanel::minimumSizeHint() const
|
|||||||
QSize contentsMin(m_contentFrame->minimumSizeHint());
|
QSize contentsMin(m_contentFrame->minimumSizeHint());
|
||||||
QSize total = contentsMin.expandedTo(titleBarMin);
|
QSize total = contentsMin.expandedTo(titleBarMin);
|
||||||
total.rheight() += titleBarMin.height();
|
total.rheight() += titleBarMin.height();
|
||||||
|
|
||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -276,7 +281,10 @@ void QMinimizePanel::resizeEvent(QResizeEvent *resizeEv )
|
|||||||
m_contentFrame->setGeometry(0, titleHeight-1, width, heigth - (titleHeight-1));
|
m_contentFrame->setGeometry(0, titleHeight-1, width, heigth - (titleHeight-1));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QMinimizePanel::event(QEvent* event)
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool QMinimizePanel::event(QEvent* event)
|
||||||
{
|
{
|
||||||
if (event->type() == QEvent::LayoutRequest)
|
if (event->type() == QEvent::LayoutRequest)
|
||||||
{
|
{
|
||||||
|
@ -42,7 +42,12 @@ class QFrame;
|
|||||||
class QLabel;
|
class QLabel;
|
||||||
class QPushButton;
|
class QPushButton;
|
||||||
|
|
||||||
class QMinimizePanel: public QWidget
|
//==================================================================================================
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//==================================================================================================
|
||||||
|
class QMinimizePanel : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
@ -50,31 +55,31 @@ public:
|
|||||||
explicit QMinimizePanel(const QString &title, QWidget* parent=0);
|
explicit QMinimizePanel(const QString &title, QWidget* parent=0);
|
||||||
~QMinimizePanel();
|
~QMinimizePanel();
|
||||||
|
|
||||||
QFrame * contentFrame() { return m_contentFrame; }
|
QFrame* contentFrame() { return m_contentFrame; }
|
||||||
void setTitle (const QString& title);
|
void setTitle (const QString& title);
|
||||||
QString title() const;
|
QString title() const;
|
||||||
|
|
||||||
virtual QSize sizeHint() const override;
|
virtual QSize sizeHint() const override;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setExpanded(bool isExpanded);
|
void setExpanded(bool isExpanded);
|
||||||
void toggleExpanded();
|
void toggleExpanded();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void expandedChanged(bool isExpanded);
|
void expandedChanged(bool isExpanded);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual QSize minimumSizeHint() const override;
|
virtual QSize minimumSizeHint() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QFrame* m_titleFrame;
|
QFrame* m_titleFrame;
|
||||||
QLabel* m_titleLabel;
|
QLabel* m_titleLabel;
|
||||||
QPushButton* m_collapseButton;
|
QPushButton* m_collapseButton;
|
||||||
QFrame* m_contentFrame;
|
QFrame* m_contentFrame;
|
||||||
|
|
||||||
virtual void resizeEvent(QResizeEvent *) override;
|
virtual void resizeEvent(QResizeEvent *) override;
|
||||||
virtual bool event(QEvent* event) override; // To catch QEvent::LayoutRequest
|
virtual bool event(QEvent* event) override; // To catch QEvent::LayoutRequest
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initialize(const QString &title);
|
void initialize(const QString &title);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user