some changes to default backend layout, extended test

This commit is contained in:
Patrick von Reth 2014-02-18 15:15:11 +01:00
parent f18a3a1702
commit 75d6970818
3 changed files with 20 additions and 25 deletions

View File

@ -34,11 +34,11 @@ NotifyWidget::NotifyWidget(int pos,QWidget *parent) :
{
ui->setupUi(this);
TomahawkUtils::DpiScaler::setFontSize(this->ui->titel->fontInfo().pointSize());
TomahawkUtils::DpiScaler::setFontSize(10);
m_scaler = new TomahawkUtils::DpiScaler(this);
ui->closeButton->setMaximumWidth(ui->closeButton->height());
// setFixedSize( m_scaler->scaled(300, 80));
setFixedSize( m_scaler->scaled(300, 80));
m_dest = QPoint(m_desktop.topRight().x() - width(), m_desktop.topRight().y() + (m_scaler->scaledY(10) + height()) * pos);
}
@ -102,11 +102,10 @@ void NotifyWidget::on_closeButton_clicked()
hide();
}
void NotifyWidget::mousePressEvent(QMouseEvent *e)
void NotifyWidget::mousePressEvent(QMouseEvent *)
{
emit invoked();
hide();
QWidget::mousePressEvent(e);
}
void NotifyWidget::setPalette(const QImage &img)

View File

@ -143,7 +143,7 @@
</layout>
</item>
<item>
<widget class="QTextEdit" name="body">
<widget class="QTextBrowser" name="body">
<property name="enabled">
<bool>false</bool>
</property>
@ -152,37 +152,23 @@
<pointsize>10</pointsize>
</font>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="undoRedoEnabled">
<bool>false</bool>
</property>
<property name="html">
<string notr="true">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Body&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse</set>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>

View File

@ -97,7 +97,14 @@ void TrayIcon::slotTestNotification()
{
m_snore->registerApplication(m_app);
}
Notification noti(m_app, m_alert, "Hello World", "This is Snore", Icon(":/root/snore.png"));
Notification noti(m_app, m_alert, "Hello World",
"<i>This is Snore</i><br>"
"<a href=\"https://github.com/TheOneRing/Snorenotify\">Project Website</a><br>"
"1<br>"
"2<br>"
"3<br>"
"4<br>"
"5<br>", Icon(":/root/snore.png"));
noti.addAction(Action(1,"Test Action"));
m_snore->broadcastNotification(noti);
@ -115,7 +122,10 @@ void TrayIcon::sloutUpdateTestNotification()
{
QTimer *timer = qobject_cast<QTimer*>(sender());
Notification noti = m_notifications.take(timer);
Notification update(noti, "Hello World", "This is Snore, color test", Icon("http://jweatherwatch.googlecode.com/svn/trunk/iconset/04.png"));
Notification update(noti, "Hello World",
"<b>This is Snore</b><br>"
"<u>This icon is in color</u><br>"
"<a href=\"https://github.com/TheOneRing/Snorenotify\">Project Website</a>", Icon("http://jweatherwatch.googlecode.com/svn/trunk/iconset/04.png"));
m_snore->broadcastNotification(update);
timer->deleteLater();
}