diff options
6 files changed, 37 insertions, 6 deletions
diff --git a/src-qt5/desktop-utils/lumina-textedit/ColorDialog.cpp b/src-qt5/desktop-utils/lumina-textedit/ColorDialog.cpp index d89bdad0..1a63815b 100644 --- a/src-qt5/desktop-utils/lumina-textedit/ColorDialog.cpp +++ b/src-qt5/desktop-utils/lumina-textedit/ColorDialog.cpp @@ -23,7 +23,7 @@ ColorDialog::ColorDialog(QSettings *set, QWidget *parent) : QDialog(parent), ui( void ColorDialog::LoadColors(){ ui->treeWidget->clear(); QStringList colors = settings->allKeys().filter("colors/"); - + for(int i=0; i<colors.length(); i++){ QTreeWidgetItem *it = new QTreeWidgetItem(); it->setText(0, colors[i].section("/",-1)); @@ -56,4 +56,4 @@ void ColorDialog::changeColor(){ if(!color.isValid()){ return; } it->setText(1, color.name()); it->setBackground(2, QBrush(color)); -}
\ No newline at end of file +} diff --git a/src-qt5/desktop-utils/lumina-textedit/DnDTabBar.h b/src-qt5/desktop-utils/lumina-textedit/DnDTabBar.h index 0979cf82..f31c7a8e 100644 --- a/src-qt5/desktop-utils/lumina-textedit/DnDTabBar.h +++ b/src-qt5/desktop-utils/lumina-textedit/DnDTabBar.h @@ -59,8 +59,12 @@ protected: virtual void mouseMoveEvent(QMouseEvent *ev){ //qDebug() << "Got Move Event:" << this->geometry() << ev->pos(); - if(selTab>=0 && !this->parentWidget()->geometry().contains( this->mapToParent(ev->pos())) ){ - //qDebug() << "Starting Drag:" << this->geometry() << ev->pos(); + QWidget *parent = this->parentWidget(); //top-level parent widget + while(parent->parentWidget()!=0 && !parent->isWindow()){ parent = parent->parentWidget(); } + if(selTab>=0 && !QRect(QPoint(0,0), parent->size()).contains( this->mapTo(parent, ev->pos())) ){ + //qDebug() << "Got Mouse outside of parent:" << parent->geometry() << this->geometry() << this->mapTo(parent, ev->pos()); + //if(ev->button()!=Qt::LeftButton){ QTabBar::mouseMoveEvent(ev); return; } + qDebug() << "Starting Drag:" << this->geometry() << ev->pos(); QString tab = selTab; this->mouseReleaseEvent(new QMouseEvent(QEvent::MouseButtonRelease, ev->pos(), ev->button(), ev->buttons(), ev->modifiers()) ); //will reset selTab //this->update(); 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); diff --git a/src-qt5/desktop-utils/lumina-textedit/MainUI.h b/src-qt5/desktop-utils/lumina-textedit/MainUI.h index 464e7a52..c9c4e534 100644 --- a/src-qt5/desktop-utils/lumina-textedit/MainUI.h +++ b/src-qt5/desktop-utils/lumina-textedit/MainUI.h @@ -40,7 +40,7 @@ private: QFontComboBox *fontbox; ColorDialog *colorDLG; QSettings *settings; - QShortcut *closeFindS; + QShortcut *closeFindS, *nextTabS, *prevTabS; QSpinBox *fontSizes; QAction *label_readonly; @@ -77,6 +77,8 @@ private slots: void tabClosed(int); void tabDetached(int); void tabDraggedOut(int, Qt::DropAction); + void nextTab(); + void prevTab(); //Find/Replace functions void closeFindReplace(); diff --git a/src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp b/src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp index b1592cc3..f96efef1 100644 --- a/src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp +++ b/src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp @@ -53,6 +53,7 @@ void PlainTextEditor::showLineNumbers(bool show){ } void PlainTextEditor::LoadSyntaxRule(QString type){ + qDebug() << "Load SyntaxRule"; QList<SyntaxFile> files = SyntaxFile::availableFiles(settings); for(int i=0; i<files.length(); i++){ if(files[i].name() == type){ @@ -66,6 +67,7 @@ void PlainTextEditor::LoadSyntaxRule(QString type){ } void PlainTextEditor::updateSyntaxColors(){ + qDebug() << "Update Syntax Colors"; SYNTAX->reloadRules(); SYNTAX->rehighlight(); } diff --git a/src-qt5/desktop-utils/lumina-textedit/syntax_rules/md.syntax b/src-qt5/desktop-utils/lumina-textedit/syntax_rules/md.syntax index 2ba4bca7..3cd0a7b6 100644 --- a/src-qt5/desktop-utils/lumina-textedit/syntax_rules/md.syntax +++ b/src-qt5/desktop-utils/lumina-textedit/syntax_rules/md.syntax @@ -91,7 +91,7 @@ }, { "name" : "lists", - "regex" : "^\\s*([0-9].|[\\*\\+\\-]{1})\\s+", + "regex" : "^\\s*([0-9]+.|[\\*\\+\\-]{1})\\s+", "foreground" : "colors/function" }, { |