From dd70b3d46f631fde5d936c2903e98aa497b11b61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Tue, 14 Feb 2012 12:00:56 +0000 Subject: [PATCH] set cursor position to 0 in kiosk-mode; refs #106 --- src/browser.hxx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/browser.hxx b/src/browser.hxx index fea933a..d22cd67 100644 --- a/src/browser.hxx +++ b/src/browser.hxx @@ -623,15 +623,17 @@ class Browser: public QMainWindow, protected Ui::Browser { on__tabs_tabCloseRequested(_tabs->currentIndex()); } - void on__tabs_currentChanged(int index) { - if (qobject_cast(_url)) + void on__tabs_currentChanged(int) { + if (qobject_cast(_url)) { qobject_cast(_url)->setEditText (qobject_cast(_tabs->currentWidget()) ->url().toString()); - else + } else { qobject_cast(_url)->setText (qobject_cast(_tabs->currentWidget()) ->url().toString()); + qobject_cast(_url)->setCursorPosition(0); + } activateTab(); } @@ -883,10 +885,12 @@ class Browser: public QMainWindow, protected Ui::Browser { LOG<currentWidget()) return; LOG<<"signal on current tab"; - if (qobject_cast(_url)) + if (qobject_cast(_url)) { qobject_cast(_url)->setEditText(url.toString()); - else + } else { qobject_cast(_url)->setText(url.toString()); + qobject_cast(_url)->setCursorPosition(0); + } } void linkClicked(const QUrl& url) {