From 1f9564c2b7d936d579a94726913b35dc6d42d9f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Fri, 4 May 2012 08:03:34 +0000 Subject: [PATCH] undone [229], but disabled URL label with respect to #129; refs #140 --- src/browser.hxx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/browser.hxx b/src/browser.hxx index 8a66426..2480885 100644 --- a/src/browser.hxx +++ b/src/browser.hxx @@ -161,8 +161,10 @@ class Browser: public QMainWindow, protected Ui::Browser { assert(connect(_editbookmarks.get(), SIGNAL(accepted()), SLOT(saveBookmarks()))); } else { - QLabel* label(new QLabel(_toolbar)); + QLineEdit* label(new QLineEdit(_toolbar)); _url = label; + label->setReadOnly(true); + label->setEnabled(false); _toolbar->addWidget(_url); } if (!_kiosk) { @@ -293,7 +295,7 @@ class Browser: public QMainWindow, protected Ui::Browser { if (qobject_cast(_url)) load(qobject_cast(_url)->currentText()); else - load(qobject_cast(_url)->text()); + load(qobject_cast(_url)->text()); } void load(QString page) { @@ -661,9 +663,10 @@ class Browser: public QMainWindow, protected Ui::Browser { ->url().toString()); qobject_cast(_url)->lineEdit()->setCursorPosition(0); } else { - qobject_cast(_url)->setText + qobject_cast(_url)->setText (qobject_cast(_tabs->currentWidget()) ->url().toString()); + qobject_cast(_url)->setCursorPosition(0); } activateTab(); } @@ -944,7 +947,8 @@ class Browser: public QMainWindow, protected Ui::Browser { qobject_cast(_url)->setEditText(url.toString()); qobject_cast(_url)->lineEdit()->setCursorPosition(0); } else { - qobject_cast(_url)->setText(url.toString()); + qobject_cast(_url)->setText(url.toString()); + qobject_cast(_url)->setCursorPosition(0); } } @@ -1521,7 +1525,7 @@ class Browser: public QMainWindow, protected Ui::Browser { (qobject_cast(_url)->lineEdit()) ->changeStyleSheet(tr("background-color: white", "valid url")); else - qobject_cast(_url) + qobject_cast(_url) ->setStyleSheet(tr("background-color: white", "valid url")); }