1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-13 10:32:11 +01:00

BookmarksManager: Move cursor at the start in bookmark edit inputs

Title, Address, Keyword and Description inputs will now always
show the text from the start
This commit is contained in:
David Rosca 2014-09-17 13:15:09 +02:00
parent d6fb19e104
commit b8c5f6f75d

View File

@ -231,24 +231,23 @@ void BookmarksManager::updateEditBox(BookmarkItem* item)
bool editable = bookmarkEditable(item); bool editable = bookmarkEditable(item);
bool showAddressAndKeyword = item && item->isUrl(); bool showAddressAndKeyword = item && item->isUrl();
bool clearBox = !item;
if (clearBox) { if (!item) {
ui->title->clear(); ui->title->clear();
ui->address->clear(); ui->address->clear();
ui->keyword->clear(); ui->keyword->clear();
ui->description->clear(); ui->description->clear();
ui->title->setReadOnly(true);
ui->address->setReadOnly(true);
ui->keyword->setReadOnly(true);
ui->description->setReadOnly(true);
} }
else { else {
ui->title->setText(item->title()); ui->title->setText(item->title());
ui->address->setText(item->url().toEncoded()); ui->address->setText(item->url().toEncoded());
ui->keyword->setText(item->keyword()); ui->keyword->setText(item->keyword());
ui->description->setPlainText(item->description()); ui->description->setPlainText(item->description());
ui->title->setCursorPosition(0);
ui->address->setCursorPosition(0);
ui->keyword->setCursorPosition(0);
ui->description->moveCursor(QTextCursor::Start);
} }
ui->title->setReadOnly(!editable); ui->title->setReadOnly(!editable);