use point size and open urls directly
This commit is contained in:
parent
4c5f916b30
commit
f333e04334
|
@ -2,7 +2,6 @@ import QtQuick 1.1
|
|||
|
||||
|
||||
|
||||
|
||||
Rectangle {
|
||||
objectName: "qmlNotification"
|
||||
id: root
|
||||
|
@ -12,12 +11,12 @@ Rectangle {
|
|||
|
||||
signal dismissed()
|
||||
|
||||
signal linkClicked(string link)
|
||||
|
||||
signal invoked()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function update(nTitle, bBody, nImage, nAppIcon, color, textColor)
|
||||
{
|
||||
title.text = nTitle
|
||||
|
@ -50,8 +49,8 @@ Rectangle {
|
|||
color: "#000000"
|
||||
|
||||
text: qsTr("Title")
|
||||
font.pointSize: 10
|
||||
font.bold: true
|
||||
font.pixelSize: 12
|
||||
anchors.right: closeButton.left
|
||||
anchors.rightMargin: 22
|
||||
anchors.top: parent.top
|
||||
|
@ -65,7 +64,7 @@ Rectangle {
|
|||
id: body
|
||||
color: "#000000"
|
||||
text: qsTr("Body")
|
||||
font.pixelSize: 12
|
||||
font.pointSize: 10
|
||||
anchors.right: appIcon.left
|
||||
anchors.rightMargin: 6
|
||||
anchors.top: title.bottom
|
||||
|
@ -75,7 +74,7 @@ Rectangle {
|
|||
anchors.left: image.right
|
||||
anchors.leftMargin: 6
|
||||
wrapMode: Text.WordWrap
|
||||
onLinkActivated: root.linkClicked(link)
|
||||
onLinkActivated: Qt.openUrlExternally(link)
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -71,7 +71,6 @@ NotifyWidget::NotifyWidget(int pos,QWidget *parent) :
|
|||
|
||||
connect(qmlNotification, SIGNAL(invoked()),this, SLOT(slotInvoked()));
|
||||
connect(qmlNotification, SIGNAL(dismissed()),this, SLOT(slotDismissed()));
|
||||
connect(qmlNotification, SIGNAL(linkClicked(QString)),this, SLOT(slotLinkClicked(QString)));
|
||||
}
|
||||
|
||||
NotifyWidget::~NotifyWidget()
|
||||
|
@ -120,7 +119,7 @@ void NotifyWidget::update(const Notification ¬ification)
|
|||
Q_ARG( QVariant, QUrl::fromLocalFile(notification.icon().localUrl())),
|
||||
Q_ARG( QVariant, QUrl::fromLocalFile(notification.application().icon().localUrl())),
|
||||
Q_ARG( QVariant, color),
|
||||
Q_ARG( QVariant, textColor ));
|
||||
Q_ARG( QVariant, textColor));
|
||||
|
||||
|
||||
}
|
||||
|
@ -215,11 +214,6 @@ QColor NotifyWidget::computeBackgrondColor(const QImage &img)
|
|||
|
||||
}
|
||||
|
||||
void NotifyWidget::slotLinkClicked(QString link)
|
||||
{
|
||||
QDesktopServices::openUrl( QUrl(link));
|
||||
}
|
||||
|
||||
QSize NotifyWidget::computeSize()
|
||||
{
|
||||
int width = 365;
|
||||
|
|
|
@ -60,8 +60,6 @@ private slots:
|
|||
|
||||
void slotInvoked();
|
||||
|
||||
void slotLinkClicked(QString link);
|
||||
|
||||
protected:
|
||||
QSize computeSize();
|
||||
|
||||
|
|
Loading…
Reference in New Issue