mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
QML UI: obtain a reasonable margin from QML
This will be used later in the positioning of the profile. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
9df3835035
commit
ef653b41f5
3 changed files with 13 additions and 2 deletions
|
@ -213,4 +213,7 @@ GridLayout {
|
|||
Layout.fillWidth: true
|
||||
Layout.minimumHeight: MobileComponents.Units.gridUnit * 3
|
||||
}
|
||||
Component.onCompleted: {
|
||||
qmlProfile.setMargin(MobileComponents.Units.smallSpacing)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
#include <QTransform>
|
||||
|
||||
QMLProfile::QMLProfile(QQuickItem *parent) :
|
||||
QQuickPaintedItem(parent)
|
||||
QQuickPaintedItem(parent),
|
||||
m_margin(0)
|
||||
{
|
||||
m_profileWidget = new ProfileWidget2(0);
|
||||
m_profileWidget->setProfileState();
|
||||
|
@ -23,6 +24,11 @@ void QMLProfile::paint(QPainter *painter)
|
|||
m_profileWidget->render(painter);
|
||||
}
|
||||
|
||||
void QMLProfile::setMargin(int margin)
|
||||
{
|
||||
m_margin = margin;
|
||||
}
|
||||
|
||||
QString QMLProfile::diveId() const
|
||||
{
|
||||
return m_diveId;
|
||||
|
|
|
@ -17,9 +17,11 @@ public:
|
|||
|
||||
QString diveId() const;
|
||||
void setDiveId(const QString &diveId);
|
||||
|
||||
public slots:
|
||||
void setMargin(int margin);
|
||||
private:
|
||||
QString m_diveId;
|
||||
int m_margin;
|
||||
ProfileWidget2 *m_profileWidget;
|
||||
signals:
|
||||
void rightAlignedChanged();
|
||||
|
|
Loading…
Add table
Reference in a new issue