mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +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
3 changed files with 38 additions and 3 deletions
|
@ -35,8 +35,10 @@
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
#include <QPainter>
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
#include <QResizeEvent>
|
#include <QResizeEvent>
|
||||||
|
#include <QStyleOptionMenuItem>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
|
@ -45,6 +47,37 @@
|
||||||
#include "metatextlabel.h"
|
#include "metatextlabel.h"
|
||||||
#include "pixmapviewer.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) :
|
InfoSidebarPage::InfoSidebarPage(QWidget* parent) :
|
||||||
SidebarPage(parent),
|
SidebarPage(parent),
|
||||||
m_pendingPreview(false),
|
m_pendingPreview(false),
|
||||||
|
@ -90,8 +123,10 @@ InfoSidebarPage::InfoSidebarPage(QWidget* parent) :
|
||||||
|
|
||||||
layout->addWidget(m_nameLabel);
|
layout->addWidget(m_nameLabel);
|
||||||
layout->addWidget(m_preview);
|
layout->addWidget(m_preview);
|
||||||
|
layout->addWidget(new InfoSeparator(this));
|
||||||
if (m_metaDataWidget != 0) {
|
if (m_metaDataWidget != 0) {
|
||||||
layout->addWidget(m_metaDataWidget);
|
layout->addWidget(m_metaDataWidget);
|
||||||
|
layout->addWidget(new InfoSeparator(this));
|
||||||
}
|
}
|
||||||
layout->addWidget(m_metaTextLabel);
|
layout->addWidget(m_metaTextLabel);
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
|
||||||
MetaTextLabel::MetaTextLabel(QWidget* parent) :
|
MetaTextLabel::MetaTextLabel(QWidget* parent) :
|
||||||
QGroupBox(i18nc("@title:group General metadata", "General"), parent),
|
QWidget(parent),
|
||||||
m_lines(0),
|
m_lines(0),
|
||||||
m_layout(0)
|
m_layout(0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#ifndef METATEXTLABEL_H
|
#ifndef METATEXTLABEL_H
|
||||||
#define METATEXTLABEL_H
|
#define METATEXTLABEL_H
|
||||||
|
|
||||||
#include <QGroupBox>
|
#include <QWidget>
|
||||||
|
|
||||||
class KVBox;
|
class KVBox;
|
||||||
class QHBoxLayout;
|
class QHBoxLayout;
|
||||||
|
@ -30,7 +30,7 @@ class QHBoxLayout;
|
||||||
*
|
*
|
||||||
* Each line contains a label and the the meta information.
|
* Each line contains a label and the the meta information.
|
||||||
*/
|
*/
|
||||||
class MetaTextLabel : public QGroupBox
|
class MetaTextLabel : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue