aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-01-17 09:34:07 -0500
committerKen Moore <ken@ixsystems.com>2017-01-17 09:34:07 -0500
commit26155420d02ef6911781923dea69e1dd9ed49270 (patch)
tree33ff4205c38b87a658e46101879510beeb48bada
parentMerge branch 'master' of github.com:trueos/lumina (diff)
downloadlumina-26155420d02ef6911781923dea69e1dd9ed49270.tar.gz
lumina-26155420d02ef6911781923dea69e1dd9ed49270.tar.bz2
lumina-26155420d02ef6911781923dea69e1dd9ed49270.zip
Fix up some of the focus issues with the terminal and multiple tabs
-rw-r--r--src-qt5/desktop-utils/lumina-terminal/TermWindow.cpp4
-rw-r--r--src-qt5/desktop-utils/lumina-terminal/TerminalWidget.cpp1
2 files changed, 4 insertions, 1 deletions
diff --git a/src-qt5/desktop-utils/lumina-terminal/TermWindow.cpp b/src-qt5/desktop-utils/lumina-terminal/TermWindow.cpp
index 15cfe047..812d3679 100644
--- a/src-qt5/desktop-utils/lumina-terminal/TermWindow.cpp
+++ b/src-qt5/desktop-utils/lumina-terminal/TermWindow.cpp
@@ -31,6 +31,7 @@ TermWindow::TermWindow(QSettings *set) : QWidget(0, Qt::Window | Qt::BypassWindo
tabWidget->setTabsClosable(true);
tabWidget->setMovable(true);
tabWidget->setUsesScrollButtons(true);
+ tabWidget->setFocusPolicy(Qt::ClickFocus);
this->layout()->addWidget(tabWidget);
//Setup the animation
ANIM = new QPropertyAnimation(this, "geometry", this);
@@ -99,7 +100,7 @@ void TermWindow::OpenDirs(QStringList dirs){
page->setWhatsThis(ID);
tabWidget->addTab(page, ID);
tabWidget->setCurrentWidget(page);
- page->setFocus();
+ QTimer::singleShot(500, this, SLOT(focusOnWidget()));//page->setFocus();
qDebug() << "New Tab:" << ID << dirs[i];
connect(page, SIGNAL(ProcessClosed(QString)), this, SLOT(Close_Tab(QString)) );
}
@@ -255,6 +256,7 @@ void TermWindow::Prev_Tab(){
void TermWindow::focusOnWidget(){
if(tabWidget->currentWidget()!=0){
+ //qDebug() << "Focus on Widget";
tabWidget->currentWidget()->setFocus();
}
}
diff --git a/src-qt5/desktop-utils/lumina-terminal/TerminalWidget.cpp b/src-qt5/desktop-utils/lumina-terminal/TerminalWidget.cpp
index 906252cf..7601ae9f 100644
--- a/src-qt5/desktop-utils/lumina-terminal/TerminalWidget.cpp
+++ b/src-qt5/desktop-utils/lumina-terminal/TerminalWidget.cpp
@@ -30,6 +30,7 @@ TerminalWidget::TerminalWidget(QWidget *parent, QString dir) : QTextEdit(parent)
this->setOverwriteMode(true);
this->setFocusPolicy(Qt::StrongFocus);
this->setTabStopWidth( 8 * this->fontMetrics().width(" ") ); //8 character spaces per tab (UNIX standard)
+ this->setTabChangesFocus(false);
//this->setWordWrapMode(QTextOption::NoWrap);
this->setContextMenuPolicy(Qt::CustomContextMenu);
resizeTimer = new QTimer(this);
bgstack15