diff options
Diffstat (limited to 'src/urlbar/listitem.cpp')
-rw-r--r-- | src/urlbar/listitem.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/urlbar/listitem.cpp b/src/urlbar/listitem.cpp index 13535a74..78a929a8 100644 --- a/src/urlbar/listitem.cpp +++ b/src/urlbar/listitem.cpp @@ -129,7 +129,7 @@ void ListItem::leaveEvent(QEvent *e) void ListItem::mousePressEvent(QMouseEvent *e) { - emit itemClicked(this, e->button()); + emit itemClicked(this, e->button(), e->modifiers()); QWidget::mousePressEvent(e); } @@ -220,7 +220,16 @@ PreviewListItem::PreviewListItem(const UrlSearchItem &item, const QString &text, QVBoxLayout *vLayout = new QVBoxLayout; vLayout->setMargin(0); - vLayout->addWidget(new TextLabel(item.title, text, this)); + + QString title = item.title; + if (title.isEmpty()) + { + title = item.url.url(); + title = title.remove("http://"); + title.truncate(title.indexOf("/")); + } + + vLayout->addWidget(new TextLabel(title, text, this)); vLayout->addWidget(new TextLabel("<i>" + item.url.url() + "</i>", text, this)); hLayout->addLayout(vLayout); |