mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-12 12:54:29 +00:00
minor layout improvements for the Information Panel:
* use the KStyle for drawing separators * remove frame from general meta data box CCMAIL: sebastian@trueg.de svn path=/trunk/KDE/kdebase/apps/; revision=788834
This commit is contained in:
parent
d3a0432188
commit
4eaa9ddcb1
|
@ -35,8 +35,10 @@
|
|||
#include <QEvent>
|
||||
#include <QInputDialog>
|
||||
#include <QLabel>
|
||||
#include <QPainter>
|
||||
#include <QPixmap>
|
||||
#include <QResizeEvent>
|
||||
#include <QStyleOptionMenuItem>
|
||||
#include <QTimer>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
|
@ -45,6 +47,37 @@
|
|||
#include "metatextlabel.h"
|
||||
#include "pixmapviewer.h"
|
||||
|
||||
class InfoSeparator : public QWidget
|
||||
{
|
||||
public:
|
||||
InfoSeparator(QWidget* parent);
|
||||
virtual ~InfoSeparator();
|
||||
|
||||
protected:
|
||||
virtual void paintEvent(QPaintEvent* event);
|
||||
};
|
||||
|
||||
InfoSeparator::InfoSeparator(QWidget* parent) :
|
||||
QWidget(parent)
|
||||
{
|
||||
setMinimumSize(0, 8);
|
||||
}
|
||||
|
||||
InfoSeparator::~InfoSeparator()
|
||||
{
|
||||
}
|
||||
|
||||
void InfoSeparator::paintEvent(QPaintEvent* event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
QPainter painter(this);
|
||||
|
||||
QStyleOptionMenuItem option;
|
||||
option.initFrom(this);
|
||||
option.menuItemType = QStyleOptionMenuItem::Separator;
|
||||
style()->drawControl(QStyle::CE_MenuItem, &option, &painter, this);
|
||||
}
|
||||
|
||||
InfoSidebarPage::InfoSidebarPage(QWidget* parent) :
|
||||
SidebarPage(parent),
|
||||
m_pendingPreview(false),
|
||||
|
@ -90,8 +123,10 @@ InfoSidebarPage::InfoSidebarPage(QWidget* parent) :
|
|||
|
||||
layout->addWidget(m_nameLabel);
|
||||
layout->addWidget(m_preview);
|
||||
layout->addWidget(new InfoSeparator(this));
|
||||
if (m_metaDataWidget != 0) {
|
||||
layout->addWidget(m_metaDataWidget);
|
||||
layout->addWidget(new InfoSeparator(this));
|
||||
}
|
||||
layout->addWidget(m_metaTextLabel);
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include <QLabel>
|
||||
|
||||
MetaTextLabel::MetaTextLabel(QWidget* parent) :
|
||||
QGroupBox(i18nc("@title:group General metadata", "General"), parent),
|
||||
QWidget(parent),
|
||||
m_lines(0),
|
||||
m_layout(0)
|
||||
{
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#ifndef METATEXTLABEL_H
|
||||
#define METATEXTLABEL_H
|
||||
|
||||
#include <QGroupBox>
|
||||
#include <QWidget>
|
||||
|
||||
class KVBox;
|
||||
class QHBoxLayout;
|
||||
|
@ -30,7 +30,7 @@ class QHBoxLayout;
|
|||
*
|
||||
* Each line contains a label and the the meta information.
|
||||
*/
|
||||
class MetaTextLabel : public QGroupBox
|
||||
class MetaTextLabel : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
Loading…
Reference in a new issue