some changes to default backend layout, extended test
This commit is contained in:
parent
f18a3a1702
commit
75d6970818
|
@ -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)
|
||||
|
|
|
@ -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"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:10pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Body</span></p>
|
||||
<p style="-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;"><br /></p></body></html></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>
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue