use the margins of the framesvg instead of own
This commit is contained in:
parent
799a5989d9
commit
73ab93e009
@ -39,61 +39,6 @@
|
||||
#include <QDebug>
|
||||
|
||||
|
||||
DialogMargins::DialogMargins(QQuickWindow *dialog, QObject *parent)
|
||||
: QObject(parent),
|
||||
m_left(0), m_top(0), m_right(0), m_bottom(0),
|
||||
m_dialog(dialog)
|
||||
{
|
||||
checkMargins();
|
||||
}
|
||||
|
||||
void DialogMargins::checkMargins()
|
||||
{
|
||||
int _m = 16;
|
||||
int top = _m;
|
||||
int bottom = _m;
|
||||
int left = _m;
|
||||
int right = _m;
|
||||
//m_dialog->getContentsMargins(&left, &top, &right, &bottom);
|
||||
|
||||
if (left != m_left) {
|
||||
m_left = left;
|
||||
emit leftChanged();
|
||||
}
|
||||
if (top != m_top) {
|
||||
m_top = top;
|
||||
emit topChanged();
|
||||
}
|
||||
if (right != m_right) {
|
||||
m_right = right;
|
||||
emit rightChanged();
|
||||
}
|
||||
if (bottom != m_bottom) {
|
||||
m_bottom = bottom;
|
||||
emit bottomChanged();
|
||||
}
|
||||
}
|
||||
|
||||
int DialogMargins::left() const
|
||||
{
|
||||
return m_left;
|
||||
}
|
||||
|
||||
int DialogMargins::top() const
|
||||
{
|
||||
return m_top;
|
||||
}
|
||||
|
||||
int DialogMargins::right() const
|
||||
{
|
||||
return m_right;
|
||||
}
|
||||
|
||||
int DialogMargins::bottom() const
|
||||
{
|
||||
return m_bottom;
|
||||
}
|
||||
|
||||
DialogProxy::DialogProxy(QQuickItem *parent)
|
||||
: QQuickWindow(),
|
||||
m_activeWindow(false),
|
||||
@ -106,7 +51,6 @@ DialogProxy::DialogProxy(QQuickItem *parent)
|
||||
setColor(QColor(Qt::transparent));
|
||||
setFlags(Qt::FramelessWindowHint);
|
||||
|
||||
m_margins = new DialogMargins(this, this);
|
||||
m_flags = flags();
|
||||
|
||||
m_syncTimer = new QTimer(this);
|
||||
@ -309,7 +253,7 @@ void DialogProxy::setLocation(int location)
|
||||
|
||||
QObject *DialogProxy::margins() const
|
||||
{
|
||||
return m_margins;
|
||||
return m_frameSvgItem->margins();
|
||||
}
|
||||
|
||||
void DialogProxy::resizeEvent(QResizeEvent *re)
|
||||
|
@ -35,56 +35,6 @@ namespace Plasma
|
||||
}
|
||||
|
||||
|
||||
class DialogMargins : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
/**
|
||||
* Width in pixels of the left margin
|
||||
*/
|
||||
Q_PROPERTY(int left READ left NOTIFY leftChanged)
|
||||
|
||||
/**
|
||||
* Height in pixels of the top margin
|
||||
*/
|
||||
Q_PROPERTY(int top READ top NOTIFY topChanged)
|
||||
|
||||
/**
|
||||
* Width in pixels of the right margin
|
||||
*/
|
||||
Q_PROPERTY(int right READ right NOTIFY rightChanged)
|
||||
|
||||
/**
|
||||
* Height in pixels of the bottom margin
|
||||
*/
|
||||
Q_PROPERTY(int bottom READ bottom NOTIFY bottomChanged)
|
||||
|
||||
public:
|
||||
DialogMargins(QQuickWindow *dialog, QObject *parent = 0);
|
||||
|
||||
int left() const;
|
||||
int top() const;
|
||||
int right() const;
|
||||
int bottom() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void leftChanged();
|
||||
void rightChanged();
|
||||
void topChanged();
|
||||
void bottomChanged();
|
||||
|
||||
protected:
|
||||
void checkMargins();
|
||||
|
||||
private:
|
||||
int m_left;
|
||||
int m_top;
|
||||
int m_right;
|
||||
int m_bottom;
|
||||
QQuickWindow *m_dialog;
|
||||
friend class DialogProxy;
|
||||
};
|
||||
|
||||
/**
|
||||
* QML wrapper for kdelibs Plasma::Dialog
|
||||
*
|
||||
@ -216,7 +166,6 @@ private:
|
||||
QTimer *m_syncTimer;
|
||||
QWeakPointer<QQuickItem> m_mainItem;
|
||||
QWeakPointer<QQuickItem> m_visualParent;
|
||||
DialogMargins *m_margins;
|
||||
bool m_activeWindow;
|
||||
Plasma::Location m_location;
|
||||
Plasma::FrameSvgItem *m_frameSvgItem;
|
||||
|
Loading…
Reference in New Issue
Block a user