Hello,
I don't know if the attached is safe, but it solves my problem of clipped text
in the completion list. Using layout()->itemAt()->sizeHint().height() resulted
in some strange resizing while typing that I don't understand.
Also, I have added Qt::Key_Enter to activate the current choice.
In Firefox, pressing Esc closes the completion listwidget while maintaining
focus in the lineedit, something to consider.
Thanks,
Peter
diff --git a/src/urlbar/completionwidget.cpp b/src/urlbar/completionwidget.cpp
index 3ea35a0..3a54f89 100644
--- a/src/urlbar/completionwidget.cpp
+++ b/src/urlbar/completionwidget.cpp
@@ -82,7 +82,14 @@ void CompletionWidget::insertSearchList(const UrlSearchList &list)
void CompletionWidget::sizeAndPosition()
{
// size
- setFixedHeight(layout()->count() * 44 );
+ int h = 34;
+ ListItem *widget;
+ for(int i = 0; i < layout()->count(); ++i)
+ {
+ widget = findChild<ListItem *>( QString::number(i) );
+ h = qMax(widget->sizeHint().height(), h);
+ }
+ setFixedHeight(layout()->count() * (h + 10) );
setFixedWidth( _parent->width() );
// position
@@ -206,6 +213,7 @@ bool CompletionWidget::eventFilter( QObject *o, QEvent *e )
}
break;
+ case Qt::Key_Enter:
case Qt::Key_Return:
hide();
emit chosenUrl(currentUrl().url(), Rekonq::CurrentTab);
_______________________________________________
rekonq mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/rekonq