Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: save collapse-state for note tree #2928

Merged
merged 3 commits into from
Dec 23, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
move connect calls to better place, add slot back
  • Loading branch information
Miika Tuominen committed Dec 20, 2023
commit 9fed061bce199fac21842301e60bf7b9af789543
4 changes: 2 additions & 2 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,8 @@ void MainWindow::initTreeWidgets() {
&MainWindow::onMultipleSubfoldersSelected);
connect(ui->noteSubFolderTreeWidget, &NoteSubFolderTree::currentSubFolderChanged, this,
&MainWindow::onCurrentSubFolderChanged);
connect(ui->noteTreeWidget, &QTreeWidget::itemExpanded, ui->noteSubFolderTreeWidget, &NoteSubFolderTree::onItemExpanded);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only should be done in the experimental note tree mode!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure the notelist can be expanded if not in experimental note tree mode?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the note list is a list by default.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only should be done in the experimental note tree mode!

Do you want to add the check? There is a method for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done !

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

connect(ui->noteTreeWidget, &QTreeWidget::itemCollapsed, ui->noteSubFolderTreeWidget, &NoteSubFolderTree::onItemExpanded);
}

void MainWindow::initNotePreviewAndTextEdits() {
Expand Down Expand Up @@ -2123,8 +2125,6 @@ void MainWindow::loadNoteDirectoryList() {

ui->noteSubFolderTreeWidget->buildTreeForParentItem(noteFolderItem);
noteFolderItem->setExpanded(true);
connect(ui->noteTreeWidget, &QTreeWidget::itemExpanded, ui->noteSubFolderTreeWidget, &NoteSubFolderTree::onItemExpanded);
connect(ui->noteTreeWidget, &QTreeWidget::itemCollapsed, ui->noteSubFolderTreeWidget, &NoteSubFolderTree::onItemExpanded);

itemCount = Note::countAll();
} else {
Expand Down
1 change: 1 addition & 0 deletions src/widgets/notesubfoldertree.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class NoteSubFolderTree : public QTreeWidget {

static QMenu *contextMenu(QTreeWidget *parent);

public Q_SLOTS:
void onItemExpanded(QTreeWidgetItem *item);

private Q_SLOTS:
Expand Down
Loading