Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/keyboard_shortcuts.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ These shortcuts are meant to be used while the Notes window is currently focused
| <kbd>Ctrl</kbd> + <kbd>E</kbd> | Clear the search bar |
| <kbd>Ctrl</kbd> + <kbd>↓</kbd> (or just <kbd>↓</kbd>) | Select note below |
| <kbd>Ctrl</kbd> + <kbd>↑</kbd> (or just <kbd>↑</kbd>) | Select note above |
| <kbd>Ctrl</kbd> + <kbd>↓</kbd> _(macOS)_ | Select note below |
| <kbd>Ctrl</kbd> + <kbd>↑</kbd> _(macOS)_ | Select note above |
| <kbd>Ctrl</kbd> + <kbd>Enter</kbd> | Focus on the text editor |
| <kbd>Ctrl</kbd> + <kbd>L</kbd> _(macOS)_ | Focus on the text editor |
| <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>F</kbd> | Toggle full screen mode |
| <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>K</kbd> | Toggle kanban view |
| <kbd>F11</kbd> | Toggle full screen mode |
Expand Down
6 changes: 6 additions & 0 deletions src/listviewlogic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ void ListViewLogic::deleteNoteRequested(const NodeData &note)

void ListViewLogic::selectNoteUp()
{
// Ensure the list view has focus
m_listView->setFocus();

auto currentIndex = m_listView->currentIndex();
if (currentIndex.isValid()) {
int currentRow = currentIndex.row();
Expand All @@ -209,6 +212,9 @@ void ListViewLogic::selectNoteUp()

void ListViewLogic::selectNoteDown()
{
// Ensure the list view has focus
m_listView->setFocus();

auto currentIndex = m_listView->currentIndex();
if (currentIndex.isValid()) {
int currentRow = currentIndex.row();
Expand Down
12 changes: 10 additions & 2 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,14 +532,22 @@
new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_D), this, SLOT(deleteSelectedNote()));
new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_F), m_searchEdit, SLOT(setFocus()));
new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_E), m_searchEdit, SLOT(clear()));

// Shortcuts for note navigation
#if defined(Q_OS_MACOS)
new QShortcut(QKeySequence(Qt::META | Qt::Key_Down), this, SLOT(selectNoteDown()));
new QShortcut(QKeySequence(Qt::META | Qt::Key_Up), this, SLOT(selectNoteUp()));
new QShortcut(QKeySequence(Qt::META | Qt::Key_L), this, SLOT(setFocusOnText()));
#else
new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Down), this, SLOT(selectNoteDown()));
new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Up), this, SLOT(selectNoteUp()));
new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_L), this, SLOT(setFocusOnText()));
#endif

new QShortcut(QKeySequence(Qt::Key_Down), this, SLOT(selectNoteDown()));
new QShortcut(QKeySequence(Qt::Key_Up), this, SLOT(selectNoteUp()));
new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Enter), this, SLOT(setFocusOnText()));
new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Return), this, SLOT(setFocusOnText()));
// new QShortcut(QKeySequence(Qt::Key_Enter), this, SLOT(setFocusOnText()));
// new QShortcut(QKeySequence(Qt::Key_Return), this, SLOT(setFocusOnText()));
new QShortcut(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_F), this, SLOT(fullscreenWindow()));
new QShortcut(Qt::Key_F11, this, SLOT(fullscreenWindow()));
connect(new QShortcut(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_L), this), &QShortcut::activated, this, [=]() { m_listView->setFocus(); });
Expand Down Expand Up @@ -3676,7 +3684,7 @@
}
case QEvent::ActivationChange: {
if (m_editorSettingsWidget->isHidden()) {
QApplication::setActiveWindow(this); // TODO: The docs say this function is deprecated but it's the only one

Check warning on line 3687 in src/mainwindow.cpp

View workflow job for this annotation

GitHub Actions / macOS / Build (debug, homebrew (qt6), macos-13)

'setActiveWindow' is deprecated: Use QWidget::activateWindow() instead. [-Wdeprecated-declarations]
// that works in returning the user input from m_editorSettingsWidget
// Qt::Popup
m_textEdit->setFocus();
Expand Down
Loading