Skip to content

Commit 2290b2b

Browse files
committed
GUI - add M-l for downcasing next word or selection
1 parent 9fef8ef commit 2290b2b

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

app/gui/qt/mainwindow.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,10 @@ MainWindow::MainWindow(QApplication &app, QSplashScreen* splash)
222222
QShortcut *upcaseWord= new QShortcut(metaKey('u'), workspace);
223223
connect(upcaseWord, SIGNAL(activated()), workspace, SLOT(upcaseWordOrSelection()));
224224

225+
//downcase next word
226+
QShortcut *downcaseWord= new QShortcut(metaKey('l'), workspace);
227+
connect(downcaseWord, SIGNAL(activated()), workspace, SLOT(downcaseWordOrSelection()));
228+
225229
//Goto nth Tab
226230
QShortcut *changeTab = new QShortcut(metaKey(int2char(ws)), this);
227231
connect(changeTab, SIGNAL(activated()), signalMapper, SLOT(map()));

app/gui/qt/sonicpiscintilla.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,3 +398,15 @@ void SonicPiScintilla::upcaseWordOrSelection(){
398398
deselect();
399399
}
400400
}
401+
402+
403+
void SonicPiScintilla::downcaseWordOrSelection(){
404+
if(hasSelectedText()) {
405+
SendScintilla(SCI_LOWERCASE);
406+
} else {
407+
setMark();
408+
SendScintilla(SCI_WORDRIGHT);
409+
SendScintilla(SCI_LOWERCASE);
410+
deselect();
411+
}
412+
}

app/gui/qt/sonicpiscintilla.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class SonicPiScintilla : public QsciScintilla
4848
void moveLines(int numLines);
4949
void deselect();
5050
void upcaseWordOrSelection();
51+
void downcaseWordOrSelection();
5152

5253
private:
5354
void addKeyBinding(QSettings &qs, int cmd, int key);

0 commit comments

Comments
 (0)