aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-textedit/MainUI.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2018-05-21 15:06:17 -0400
committerKen Moore <ken@ixsystems.com>2018-05-21 15:08:08 -0400
commit2f1549b6866541ab42fa9d75db402fa9ac12ad0d (patch)
treefc1bf1b7defcca5cc2547c6c2c248c78e15b6820 /src-qt5/desktop-utils/lumina-textedit/MainUI.cpp
parentMerge pull request #581 from rodlie/549 (diff)
downloadlumina-2f1549b6866541ab42fa9d75db402fa9ac12ad0d.tar.gz
lumina-2f1549b6866541ab42fa9d75db402fa9ac12ad0d.tar.bz2
lumina-2f1549b6866541ab42fa9d75db402fa9ac12ad0d.zip
Couple quick updates to lumina-textedit:
1. Support the forward/back keyboard shortcuts to switch between tabs (Alt+[Left/Right] typically). 2. Make sure that the "drag" start of a tab is when the cursor leaves the entire window - not just the tab bar.
Diffstat (limited to 'src-qt5/desktop-utils/lumina-textedit/MainUI.cpp')
-rw-r--r--src-qt5/desktop-utils/lumina-textedit/MainUI.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src-qt5/desktop-utils/lumina-textedit/MainUI.cpp b/src-qt5/desktop-utils/lumina-textedit/MainUI.cpp
index bdb9d29c..50b83ee8 100644
--- a/src-qt5/desktop-utils/lumina-textedit/MainUI.cpp
+++ b/src-qt5/desktop-utils/lumina-textedit/MainUI.cpp
@@ -78,6 +78,11 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){
closeFindS = new QShortcut(QKeySequence(Qt::Key_Escape), this);
connect(closeFindS, SIGNAL(activated()), this, SLOT(closeFindReplace()) );
ui->groupReplace->setVisible(false);
+ nextTabS = new QShortcut(QKeySequence(QKeySequence::Forward), this);
+ prevTabS = new QShortcut(QKeySequence(QKeySequence::Back), this);
+ connect(nextTabS, SIGNAL(activated()), this, SLOT(nextTab()) );
+ connect(prevTabS, SIGNAL(activated()), this, SLOT(prevTab()) );
+
//Update the menu of available syntax highlighting modes
QStringList smodes = Custom_Syntax::availableRules(settings);
for(int i=0; i<smodes.length(); i++){
@@ -452,6 +457,24 @@ void MainUI::tabDraggedOut(int tab, Qt::DropAction act){
}
}
+void MainUI::nextTab(){
+ //qDebug() << "Next Tab";
+ if(tabWidget->count()<1){ return; } //no tabs
+ int cur = tabWidget->currentIndex();
+ cur++;
+ if(cur>=tabWidget->count()){ cur = 0; }
+ tabWidget->setCurrentIndex(cur);
+}
+
+void MainUI::prevTab(){
+ //qDebug() << "Previous Tab";
+ if(tabWidget->count()<1){ return; } //no tabs
+ int cur = tabWidget->currentIndex();
+ cur--;
+ if(cur<0){ cur = tabWidget->count()-1; }
+ tabWidget->setCurrentIndex(cur);
+}
+
//Find/Replace functions
void MainUI::closeFindReplace(){
ui->groupReplace->setVisible(false);
bgstack15