mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-19 10:16:34 +01:00
parent
68eff6bc3a
commit
611e8bbfdf
@ -22,6 +22,7 @@ Version 1.5.0
|
||||
* X11: Set correct WM_CLASS property to windows
|
||||
* fixed: size of preferences dialog on low-res screens
|
||||
* fixed: loading plugins with relative paths in portable build
|
||||
* fixed: displaying a lot of RSS feeds in RSS widget in locationbar
|
||||
|
||||
Version 1.4.4
|
||||
* released 1 September 2013
|
||||
|
@ -37,6 +37,11 @@ RSSWidget::RSSWidget(WebView* view, QWidget* parent)
|
||||
QWebFrame* frame = m_view->page()->mainFrame();
|
||||
QWebElementCollection links = frame->findAllElements("link[type=\"application/rss+xml\"]");
|
||||
|
||||
// Make sure RSS feeds fit into a window, in case there is a lot of feeds from one page
|
||||
// See #906
|
||||
int cols = links.count() / 10 == 0 ? 1 : links.count() / 10;
|
||||
int row = 0;
|
||||
|
||||
for (int i = 0; i < links.count(); i++) {
|
||||
QWebElement element = links.at(i);
|
||||
QString title = element.attribute("title");
|
||||
@ -51,14 +56,22 @@ RSSWidget::RSSWidget(WebView* view, QWidget* parent)
|
||||
|
||||
QPushButton* button = new QPushButton(this);
|
||||
button->setText(tr("Add"));
|
||||
button->setToolTip(title);
|
||||
button->setToolTip(url.toString());
|
||||
button->setProperty("rss-url", url);
|
||||
button->setProperty("rss-title", title);
|
||||
QLabel* label = new QLabel(this);
|
||||
label->setText(title);
|
||||
label->setText(fontMetrics().elidedText(title, Qt::ElideRight, 300));
|
||||
label->setToolTip(title);
|
||||
|
||||
ui->gridLayout->addWidget(label, i, 0);
|
||||
ui->gridLayout->addWidget(button, i, 1);
|
||||
int pos = i % cols > 0 ? (i % cols) * 2 : 0;
|
||||
|
||||
ui->gridLayout->addWidget(label, row, pos);
|
||||
ui->gridLayout->addWidget(button, row, pos + 1);
|
||||
connect(button, SIGNAL(clicked()), this, SLOT(addRss()));
|
||||
|
||||
if (i % cols == cols - 1) {
|
||||
row++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -78,13 +91,10 @@ void RSSWidget::addRss()
|
||||
return;
|
||||
}
|
||||
|
||||
QString title;
|
||||
if (button->toolTip().isEmpty()) {
|
||||
QString title = button->property("rss-title").toString();
|
||||
if (title.isEmpty()) {
|
||||
title = m_view->url().host();
|
||||
}
|
||||
else {
|
||||
title = button->toolTip();
|
||||
}
|
||||
|
||||
RSSNotification* notif = new RSSNotification(title, url, m_view);
|
||||
m_view->addNotification(notif);
|
||||
|
Loading…
Reference in New Issue
Block a user