elide notifications title!
This commit is contained in:
parent
967ed28f8c
commit
24f72dee33
@ -71,6 +71,7 @@ void ArticleListNotification::loadResults(const QHash<Feed*, QList<Message>>& ne
|
||||
m_newMessages = new_messages;
|
||||
|
||||
m_ui.m_lblTitle->setText(tr("%n feeds fetched", nullptr, new_messages.size()));
|
||||
m_ui.m_lblTitle->setToolTip(m_ui.m_lblTitle->text());
|
||||
|
||||
m_ui.m_cmbFeeds->model()->sort(0, Qt::SortOrder::AscendingOrder);
|
||||
m_ui.m_cmbFeeds->clear();
|
||||
|
@ -51,16 +51,13 @@
|
||||
<item row="0" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="m_titleLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="m_lblTitle">
|
||||
<widget class="SqueezeLabel" name="m_lblTitle">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -136,6 +133,11 @@
|
||||
<extends>QToolButton</extends>
|
||||
<header>plaintoolbutton.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>SqueezeLabel</class>
|
||||
<extends>QLabel</extends>
|
||||
<header>squeezelabel.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>m_btnClose</tabstop>
|
||||
|
@ -24,7 +24,9 @@ ToastNotification::ToastNotification(Notification::Event event,
|
||||
|
||||
void ToastNotification::loadNotification(Notification::Event event, const GuiMessage& msg, const GuiAction& action) {
|
||||
m_ui.m_lblTitle->setText(msg.m_title);
|
||||
m_ui.m_lblTitle->setToolTip(msg.m_title);
|
||||
m_ui.m_lblBody->setText(msg.m_message);
|
||||
m_ui.m_lblBody->setToolTip(msg.m_message);
|
||||
|
||||
m_ui.m_lblIcon->setPixmap(iconForType(msg.m_type)
|
||||
.pixmap({
|
||||
@ -41,6 +43,7 @@ void ToastNotification::loadNotification(Notification::Event event, const GuiMes
|
||||
}
|
||||
else {
|
||||
m_ui.m_mainLayout->removeItem(m_ui.m_actionLayout);
|
||||
m_ui.m_mainLayout->update();
|
||||
m_ui.m_btnAction->deleteLater();
|
||||
}
|
||||
}
|
||||
|
@ -26,16 +26,13 @@
|
||||
<item row="0" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="m_titleLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="m_lblTitle">
|
||||
<widget class="SqueezeLabel" name="m_lblTitle">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -100,6 +97,11 @@
|
||||
<extends>QToolButton</extends>
|
||||
<header>plaintoolbutton.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>SqueezeLabel</class>
|
||||
<extends>QLabel</extends>
|
||||
<header>squeezelabel.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
@ -10,7 +10,7 @@ void SqueezeLabel::paintEvent(QPaintEvent* event) {
|
||||
QFontMetrics fm = fontMetrics();
|
||||
|
||||
if (fm.horizontalAdvance(m_squeezedTextCache) > contentsRect().width()) {
|
||||
setText(fm.elidedText(text(), Qt::ElideMiddle, width()));
|
||||
setText(fm.elidedText(text(), Qt::TextElideMode::ElideRight, width()));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user