mirror of
https://github.com/status-im/snorenotify.git
synced 2025-02-04 04:33:45 +00:00
scaling \m/
This commit is contained in:
parent
d19ece3b05
commit
b977907a80
@ -46,24 +46,33 @@ Rectangle {
|
|||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: title
|
id: title
|
||||||
x: 106
|
|
||||||
y: 3
|
|
||||||
width: 217
|
|
||||||
height: 14
|
height: 14
|
||||||
color: "#ffffff"
|
color: "#ffffff"
|
||||||
|
|
||||||
text: qsTr("Title")
|
text: qsTr("Title")
|
||||||
|
font.pixelSize: 12
|
||||||
|
anchors.right: closeButton.left
|
||||||
|
anchors.rightMargin: 22
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.topMargin: 3
|
||||||
|
anchors.left: image.right
|
||||||
|
anchors.leftMargin: 6
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: body
|
id: body
|
||||||
x: 106
|
|
||||||
y: 23
|
|
||||||
width: 217
|
|
||||||
height: 69
|
|
||||||
color: "#ffffff"
|
color: "#ffffff"
|
||||||
text: qsTr("Body")
|
text: qsTr("Body")
|
||||||
|
font.pixelSize: 12
|
||||||
|
anchors.right: appIcon.left
|
||||||
|
anchors.rightMargin: 6
|
||||||
|
anchors.top: title.bottom
|
||||||
|
anchors.topMargin: 6
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.bottomMargin: 8
|
||||||
|
anchors.left: image.right
|
||||||
|
anchors.leftMargin: 6
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
onLinkActivated: root.linkClicked(link)
|
onLinkActivated: root.linkClicked(link)
|
||||||
|
|
||||||
@ -73,7 +82,12 @@ Rectangle {
|
|||||||
Image {
|
Image {
|
||||||
id: image
|
id: image
|
||||||
width: 100
|
width: 100
|
||||||
height: 100
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: 0
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.bottomMargin: 0
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.topMargin: 0
|
||||||
z: 4
|
z: 4
|
||||||
fillMode: Image.PreserveAspectFit
|
fillMode: Image.PreserveAspectFit
|
||||||
source: "qrc:/root/images/freedesktop-dbus.png"
|
source: "qrc:/root/images/freedesktop-dbus.png"
|
||||||
@ -85,6 +99,10 @@ Rectangle {
|
|||||||
y: 62
|
y: 62
|
||||||
width: 30
|
width: 30
|
||||||
height: 30
|
height: 30
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: 6
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.bottomMargin: 8
|
||||||
fillMode: Image.PreserveAspectFit
|
fillMode: Image.PreserveAspectFit
|
||||||
source: "qrc:/root/snore.png"
|
source: "qrc:/root/snore.png"
|
||||||
}
|
}
|
||||||
@ -92,9 +110,12 @@ Rectangle {
|
|||||||
Image {
|
Image {
|
||||||
id: closeButton
|
id: closeButton
|
||||||
x: 345
|
x: 345
|
||||||
y: 0
|
|
||||||
width: 20
|
width: 20
|
||||||
height: 20
|
height: 20
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.topMargin: 0
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: 0
|
||||||
fillMode: Image.PreserveAspectFit
|
fillMode: Image.PreserveAspectFit
|
||||||
z: 3
|
z: 3
|
||||||
source: "qrc:/resources/close.png"
|
source: "qrc:/resources/close.png"
|
||||||
@ -102,7 +123,8 @@ Rectangle {
|
|||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: mouseArea1
|
id: mouseArea1
|
||||||
anchors.fill: parent
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.left: parent.left
|
||||||
onClicked: root.dismissed()
|
onClicked: root.dismissed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,7 @@ NotifyWidget::NotifyWidget(int pos,QWidget *parent) :
|
|||||||
m_ready(true)
|
m_ready(true)
|
||||||
{
|
{
|
||||||
qmlNotification = rootObject();
|
qmlNotification = rootObject();
|
||||||
|
|
||||||
this->setWindowFlags(Qt::ToolTip | Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint
|
this->setWindowFlags(Qt::ToolTip | Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
||||||
| Qt::WindowDoesNotAcceptFocus
|
| Qt::WindowDoesNotAcceptFocus
|
||||||
@ -63,7 +64,9 @@ NotifyWidget::NotifyWidget(int pos,QWidget *parent) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setResizeMode(QDeclarativeView::SizeRootObjectToView);
|
||||||
|
float scale = 96.0;
|
||||||
|
resize(width() * logicalDpiX() / scale, height() * logicalDpiY() / scale);
|
||||||
|
|
||||||
m_dest = QPoint(m_desktop.topRight().x() - width(), m_desktop.topRight().y() + 10 + 10 + height() * pos);
|
m_dest = QPoint(m_desktop.topRight().x() - width(), m_desktop.topRight().y() + 10 + 10 + height() * pos);
|
||||||
m_start = QPoint(m_desktop.topRight().x(), m_dest.y());
|
m_start = QPoint(m_desktop.topRight().x(), m_dest.y());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user