Skip to content

Commit

Permalink
bugfix: save collapse-state for note tree (#2928)
Browse files Browse the repository at this point in the history
* bugfix: save collapse-state for note tree

* move connect calls to better place, add slot back

* connect calls only in note tree mode

---------

Co-authored-by: Miika Tuominen <[email protected]>
  • Loading branch information
discapes and Miika Tuominen authored Dec 23, 2023
1 parent deef4ee commit 045efb1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,10 @@ void MainWindow::initTreeWidgets() {
&MainWindow::onMultipleSubfoldersSelected);
connect(ui->noteSubFolderTreeWidget, &NoteSubFolderTree::currentSubFolderChanged, this,
&MainWindow::onCurrentSubFolderChanged);
if (NoteFolder::isCurrentNoteTreeEnabled()) {
connect(ui->noteTreeWidget, &QTreeWidget::itemExpanded, ui->noteSubFolderTreeWidget, &NoteSubFolderTree::onItemExpanded);
connect(ui->noteTreeWidget, &QTreeWidget::itemCollapsed, ui->noteSubFolderTreeWidget, &NoteSubFolderTree::onItemExpanded);
}
}

void MainWindow::initNotePreviewAndTextEdits() {
Expand Down
4 changes: 3 additions & 1 deletion src/widgets/notesubfoldertree.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ class NoteSubFolderTree : public QTreeWidget {

static QMenu *contextMenu(QTreeWidget *parent);

private Q_SLOTS:
public Q_SLOTS:
void onItemExpanded(QTreeWidgetItem *item);

private Q_SLOTS:
void onContextMenuRequested(QPoint pos);
void onCurrentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
void onItemChanged(QTreeWidgetItem *item, int column);
Expand Down

0 comments on commit 045efb1

Please sign in to comment.