From f333e0433424593a0bbb66861566276ac391f6f4 Mon Sep 17 00:00:00 2001 From: Patrick von Reth Date: Fri, 4 Jul 2014 12:25:06 +0200 Subject: [PATCH] use point size and open urls directly --- src/plugins/backends/snore/notification.qml | 11 +++++------ src/plugins/backends/snore/notifywidget.cpp | 8 +------- src/plugins/backends/snore/notifywidget.h | 2 -- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/plugins/backends/snore/notification.qml b/src/plugins/backends/snore/notification.qml index 6b183e6..19534b9 100644 --- a/src/plugins/backends/snore/notification.qml +++ b/src/plugins/backends/snore/notification.qml @@ -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) } diff --git a/src/plugins/backends/snore/notifywidget.cpp b/src/plugins/backends/snore/notifywidget.cpp index 70a648f..3d234d3 100644 --- a/src/plugins/backends/snore/notifywidget.cpp +++ b/src/plugins/backends/snore/notifywidget.cpp @@ -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; diff --git a/src/plugins/backends/snore/notifywidget.h b/src/plugins/backends/snore/notifywidget.h index e415ad4..ac43287 100644 --- a/src/plugins/backends/snore/notifywidget.h +++ b/src/plugins/backends/snore/notifywidget.h @@ -60,8 +60,6 @@ private slots: void slotInvoked(); - void slotLinkClicked(QString link); - protected: QSize computeSize();