Mercurial > hg > octave-lyh
changeset 13622:e744593197ef
added scrollToBottomRequest signal for terminal and flipped around progress bar an dstatus bar in browser widget, so the handle is on the right corner.
author | Jacob Dawid <jacob.dawid@googlemail.com> |
---|---|
date | Thu, 18 Aug 2011 13:36:20 +0200 |
parents | fede1c59705a |
children | f03f4ac63569 |
files | gui/src/BrowserWidget.cpp gui/src/terminal/QTerminalWidget.cpp gui/src/terminal/QTerminalWidget.h |
diffstat | 3 files changed, 30 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/src/BrowserWidget.cpp +++ b/gui/src/BrowserWidget.cpp @@ -56,8 +56,8 @@ QWidget *bottomWidget = new QWidget (this); QHBoxLayout *bottomLineLayout = new QHBoxLayout (); + bottomLineLayout->addWidget (m_progressBar); bottomLineLayout->addWidget (m_statusBar); - bottomLineLayout->addWidget (m_progressBar); bottomLineLayout->setMargin (0); bottomWidget->setLayout (bottomLineLayout);
--- a/gui/src/terminal/QTerminalWidget.cpp +++ b/gui/src/terminal/QTerminalWidget.cpp @@ -81,6 +81,9 @@ setFocus (Qt::OtherFocusReason); m_impl->m_terminalDisplay->resize (this->size ()); setFocusProxy (m_impl->m_terminalDisplay); + + connect (m_impl->m_terminalDisplay, SIGNAL (keyPressedSignal (QKeyEvent*)), + this, SLOT (terminalKeyPressed (QKeyEvent*))); } void @@ -158,3 +161,10 @@ { emit finished (); } + +void +QTerminalWidget::terminalKeyPressed (QKeyEvent *keyEvent) +{ + Q_UNUSED (keyEvent); + emit scrollToBottomRequest (); +}
--- a/gui/src/terminal/QTerminalWidget.h +++ b/gui/src/terminal/QTerminalWidget.h @@ -4,12 +4,12 @@ modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. - + You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, @@ -28,36 +28,40 @@ */ class QTerminalWidget:public QWidget { -Q_OBJECT - public: - QTerminalWidget (int startnow = 1, QWidget * parent = 0); - ~QTerminalWidget (); + Q_OBJECT +public: + QTerminalWidget (int startnow = 1, QWidget * parent = 0); + ~QTerminalWidget (); void openTeletype (int fd); - /** Text codec, default is UTF-8. */ + /** Text codec, default is UTF-8. */ void setTextCodec (QTextCodec * codec); - /** Resize terminal widget. */ + /** Resize terminal widget. */ void setSize (int h, int v); - /** History size for scrolling, values below zero mean infinite. */ + /** History size for scrolling, values below zero mean infinite. */ void setHistorySize (int lines); - /** Send some text to the terminal. */ + /** Send some text to the terminal. */ void sendText (const QString & text); - signals: - /** Emitted, when the current program has finished. */ +signals: + /** Emitted, when the current program has finished. */ void finished (); + void scrollToBottomRequest (); + protected: - virtual void resizeEvent (QResizeEvent *); + virtual void resizeEvent (QResizeEvent *); - protected slots:void sessionFinished (); +protected slots: + void sessionFinished (); + void terminalKeyPressed (QKeyEvent *keyEvent); private: - /** Performs initial operations on this widget. */ + /** Performs initial operations on this widget. */ void initialize (); TermWidgetImpl *m_impl; };