Merge branch 'master' of git://anongit.kde.org/kde-runtime
This commit is contained in:
commit
64781a6c3a
@ -70,8 +70,13 @@ FrameSvgItem::~FrameSvgItem()
|
||||
|
||||
void FrameSvgItem::setImagePath(const QString &path)
|
||||
{
|
||||
if (m_frameSvg->imagePath() == path)
|
||||
return;
|
||||
|
||||
m_frameSvg->setImagePath(path);
|
||||
m_frameSvg->setElementPrefix(m_prefix);
|
||||
|
||||
emit imagePathChanged();
|
||||
update();
|
||||
}
|
||||
|
||||
@ -83,8 +88,13 @@ QString FrameSvgItem::imagePath() const
|
||||
|
||||
void FrameSvgItem::setPrefix(const QString &prefix)
|
||||
{
|
||||
if (m_prefix == prefix)
|
||||
return;
|
||||
|
||||
m_frameSvg->setElementPrefix(prefix);
|
||||
m_prefix = prefix;
|
||||
|
||||
emit prefixChanged();
|
||||
update();
|
||||
}
|
||||
|
||||
@ -100,7 +110,11 @@ FrameSvgItemMargins *FrameSvgItem::margins() const
|
||||
|
||||
void FrameSvgItem::setEnabledBorders(const Plasma::FrameSvg::EnabledBorders borders)
|
||||
{
|
||||
if (m_frameSvg->enabledBorders() == borders)
|
||||
return;
|
||||
|
||||
m_frameSvg->setEnabledBorders(borders);
|
||||
emit enabledBordersChanged();
|
||||
}
|
||||
|
||||
Plasma::FrameSvg::EnabledBorders FrameSvgItem::enabledBorders() const
|
||||
|
@ -73,14 +73,14 @@ class FrameSvgItem : public QDeclarativeItem
|
||||
/**
|
||||
* Theme relative path of the svg, like "widgets/background"
|
||||
*/
|
||||
Q_PROPERTY(QString imagePath READ imagePath WRITE setImagePath)
|
||||
Q_PROPERTY(QString imagePath READ imagePath WRITE setImagePath NOTIFY imagePathChanged)
|
||||
|
||||
/**
|
||||
* prefix for the 9 piece svg, like "pushed" or "normal" for the button
|
||||
* see http://techbase.kde.org/Development/Tutorials/Plasma/ThemeDetails
|
||||
* for a list of paths and prefixes
|
||||
*/
|
||||
Q_PROPERTY(QString prefix READ prefix WRITE setPrefix)
|
||||
Q_PROPERTY(QString prefix READ prefix WRITE setPrefix NOTIFY prefixChanged)
|
||||
|
||||
/**
|
||||
* The margins of the frame, read only
|
||||
@ -97,7 +97,7 @@ class FrameSvgItem : public QDeclarativeItem
|
||||
* LeftBorder
|
||||
* RightBorder
|
||||
*/
|
||||
Q_PROPERTY(Plasma::FrameSvg::EnabledBorders enabledBorders READ enabledBorders WRITE setEnabledBorders)
|
||||
Q_PROPERTY(Plasma::FrameSvg::EnabledBorders enabledBorders READ enabledBorders WRITE setEnabledBorders NOTIFY enabledBordersChanged)
|
||||
|
||||
public:
|
||||
FrameSvgItem(QDeclarativeItem *parent=0);
|
||||
@ -119,6 +119,11 @@ public:
|
||||
void geometryChanged(const QRectF &newGeometry,
|
||||
const QRectF &oldGeometry);
|
||||
|
||||
signals:
|
||||
void imagePathChanged();
|
||||
void prefixChanged();
|
||||
void enabledBordersChanged();
|
||||
|
||||
private Q_SLOTS:
|
||||
void doUpdate();
|
||||
|
||||
|
@ -266,7 +266,7 @@ void FullScreenWindow::syncMainItemToView()
|
||||
m_mainItem.data()->setProperty("height", m_view->height());
|
||||
|
||||
if (m_declarativeItemContainer) {
|
||||
m_view->resize(m_declarativeItemContainer->size().toSize());
|
||||
m_declarativeItemContainer->resize(m_view->size());
|
||||
m_view->setSceneRect(m_declarativeItemContainer->geometry());
|
||||
} else {
|
||||
QRectF itemGeometry(QPointF(m_mainItem.data()->x(), m_mainItem.data()->y()),
|
||||
|
@ -47,8 +47,9 @@ import "." 0.1
|
||||
|
||||
Item {
|
||||
id: root
|
||||
width: dialog.width
|
||||
height: dialog.height
|
||||
|
||||
width: theme.defaultFont.mSize.width * 40
|
||||
height: titleBar.childrenRect.height + contentItem.childrenRect.height + buttonItem.childrenRect.height + 8
|
||||
|
||||
property alias title: titleBar.children
|
||||
property alias content: contentItem.children
|
||||
@ -110,9 +111,7 @@ Item {
|
||||
|
||||
PlasmaCore.FrameSvgItem {
|
||||
id: dialog
|
||||
width: mainItem.width + margins.left + margins.right
|
||||
height: mainItem.height + margins.top + margins.bottom
|
||||
anchors.centerIn: parent
|
||||
anchors.fill: parent
|
||||
imagePath: "dialogs/background"
|
||||
|
||||
state: "closed"
|
||||
@ -121,10 +120,14 @@ Item {
|
||||
|
||||
Item {
|
||||
id: mainItem
|
||||
x: dialog.margins.left
|
||||
y: dialog.margins.top
|
||||
width: theme.defaultFont.mSize.width * 40
|
||||
height: titleBar.childrenRect.height + contentItem.childrenRect.height + buttonItem.childrenRect.height + 8
|
||||
anchors {
|
||||
fill: parent
|
||||
leftMargin: dialog.margins.left
|
||||
topMargin: dialog.margins.top
|
||||
rightMargin: dialog.margins.right
|
||||
bottomMargin: dialog.margins.bottom
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Consume all key events that are not processed by children
|
||||
|
@ -52,7 +52,7 @@ Properties:
|
||||
Sets the font for the button.
|
||||
|
||||
bool enabled:
|
||||
Returns wether the button is currently enabled and receives user input.
|
||||
Returns whether the button is currently enabled and receives user input.
|
||||
|
||||
Signals:
|
||||
onClicked:
|
||||
|
@ -37,10 +37,15 @@ QImageItem::~QImageItem()
|
||||
|
||||
void QImageItem::setImage(const QImage &image)
|
||||
{
|
||||
bool oldImageNull = m_image.isNull();
|
||||
m_image = image;
|
||||
update();
|
||||
emit nativeWidthChanged();
|
||||
emit nativeHeightChanged();
|
||||
emit imageChanged();
|
||||
if (oldImageNull != m_image.isNull()) {
|
||||
emit nullChanged();
|
||||
}
|
||||
}
|
||||
|
||||
QImage QImageItem::image() const
|
||||
@ -143,5 +148,9 @@ void QImageItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option
|
||||
painter->restore();
|
||||
}
|
||||
|
||||
bool QImageItem::isNull() const
|
||||
{
|
||||
return m_image.isNull();
|
||||
}
|
||||
|
||||
#include "qimageitem.moc"
|
||||
|
@ -26,11 +26,12 @@ class QImageItem : public QDeclarativeItem
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(QImage image READ image WRITE setImage)
|
||||
Q_PROPERTY(QImage image READ image WRITE setImage NOTIFY imageChanged)
|
||||
Q_PROPERTY(bool smooth READ smooth WRITE setSmooth)
|
||||
Q_PROPERTY(int nativeWidth READ nativeWidth NOTIFY nativeWidthChanged)
|
||||
Q_PROPERTY(int nativeHeight READ nativeHeight NOTIFY nativeHeightChanged)
|
||||
Q_PROPERTY(FillMode fillMode READ fillMode WRITE setFillMode NOTIFY fillModeChanged)
|
||||
Q_PROPERTY(bool null READ isNull NOTIFY nullChanged)
|
||||
Q_ENUMS(FillMode)
|
||||
|
||||
public:
|
||||
@ -60,10 +61,14 @@ public:
|
||||
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
|
||||
bool isNull() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void nativeWidthChanged();
|
||||
void nativeHeightChanged();
|
||||
void fillModeChanged();
|
||||
void imageChanged();
|
||||
void nullChanged();
|
||||
|
||||
private:
|
||||
QImage m_image;
|
||||
|
@ -37,10 +37,15 @@ QPixmapItem::~QPixmapItem()
|
||||
|
||||
void QPixmapItem::setPixmap(const QPixmap &pixmap)
|
||||
{
|
||||
bool oldPixmapNull = m_pixmap.isNull();
|
||||
m_pixmap = pixmap;
|
||||
update();
|
||||
emit nativeWidthChanged();
|
||||
emit nativeHeightChanged();
|
||||
emit pixmapChanged();
|
||||
if (oldPixmapNull != m_pixmap.isNull()) {
|
||||
emit nullChanged();
|
||||
}
|
||||
}
|
||||
|
||||
QPixmap QPixmapItem::pixmap() const
|
||||
@ -143,5 +148,9 @@ void QPixmapItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *optio
|
||||
painter->restore();
|
||||
}
|
||||
|
||||
bool QPixmapItem::isNull() const
|
||||
{
|
||||
return m_pixmap.isNull();
|
||||
}
|
||||
|
||||
#include "qpixmapitem.moc"
|
||||
|
@ -26,11 +26,12 @@ class QPixmapItem : public QDeclarativeItem
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap)
|
||||
Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap NOTIFY pixmapChanged)
|
||||
Q_PROPERTY(bool smooth READ smooth WRITE setSmooth)
|
||||
Q_PROPERTY(int nativeWidth READ nativeWidth NOTIFY nativeWidthChanged)
|
||||
Q_PROPERTY(int nativeHeight READ nativeHeight NOTIFY nativeHeightChanged)
|
||||
Q_PROPERTY(FillMode fillMode READ fillMode WRITE setFillMode NOTIFY fillModeChanged)
|
||||
Q_PROPERTY(bool null READ isNull NOTIFY nullChanged)
|
||||
Q_ENUMS(FillMode)
|
||||
|
||||
public:
|
||||
@ -60,10 +61,14 @@ public:
|
||||
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
|
||||
bool isNull() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void nativeWidthChanged();
|
||||
void nativeHeightChanged();
|
||||
void fillModeChanged();
|
||||
void pixmapChanged();
|
||||
void nullChanged();
|
||||
|
||||
private:
|
||||
QPixmap m_pixmap;
|
||||
|
Loading…
Reference in New Issue
Block a user