mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
change panel view when locating to a folder or notebook
This commit is contained in:
parent
bc85c0d199
commit
9b114832f1
@ -2376,10 +2376,12 @@ bool VMainWindow::locateFile(VFile *p_file)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Open the directory and file panels after location.
|
// Open the directory and file panels after location.
|
||||||
if (m_panelViewState == PanelViewState::CompactMode) {
|
if (ret) {
|
||||||
compactModeView();
|
if (m_panelViewState == PanelViewState::CompactMode) {
|
||||||
} else {
|
compactModeView();
|
||||||
twoPanelView();
|
} else {
|
||||||
|
twoPanelView();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -2398,14 +2400,43 @@ bool VMainWindow::locateDirectory(VDirectory *p_directory)
|
|||||||
QCoreApplication::sendPostedEvents();
|
QCoreApplication::sendPostedEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = directoryTree->locateDirectory(p_directory);
|
if (directoryTree->locateDirectory(p_directory)) {
|
||||||
|
ret = true;
|
||||||
|
directoryTree->setFocus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Open the directory and file panels after location.
|
// Open the directory and file panels after location.
|
||||||
if (m_panelViewState == PanelViewState::CompactMode) {
|
if (ret) {
|
||||||
compactModeView();
|
if (m_panelViewState == PanelViewState::CompactMode) {
|
||||||
} else {
|
compactModeView();
|
||||||
twoPanelView();
|
} else {
|
||||||
|
twoPanelView();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool VMainWindow::locateNotebook(VNotebook *p_notebook)
|
||||||
|
{
|
||||||
|
bool ret = false;
|
||||||
|
if (!p_notebook) {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_notebookSelector->locateNotebook(p_notebook)) {
|
||||||
|
ret = true;
|
||||||
|
directoryTree->setFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Open the directory and file panels after location.
|
||||||
|
if (ret) {
|
||||||
|
if (m_panelViewState == PanelViewState::CompactMode) {
|
||||||
|
compactModeView();
|
||||||
|
} else {
|
||||||
|
twoPanelView();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -65,6 +65,9 @@ public:
|
|||||||
// Returns true if the location succeeds.
|
// Returns true if the location succeeds.
|
||||||
bool locateDirectory(VDirectory *p_directory);
|
bool locateDirectory(VDirectory *p_directory);
|
||||||
|
|
||||||
|
// Returns true if the location succeeds.
|
||||||
|
bool locateNotebook(VNotebook *p_notebook);
|
||||||
|
|
||||||
VFileList *getFileList() const;
|
VFileList *getFileList() const;
|
||||||
|
|
||||||
VEditArea *getEditArea() const;
|
VEditArea *getEditArea() const;
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
#include "utils/viconutils.h"
|
#include "utils/viconutils.h"
|
||||||
#include "vnote.h"
|
#include "vnote.h"
|
||||||
#include "vmainwindow.h"
|
#include "vmainwindow.h"
|
||||||
#include "vnotebookselector.h"
|
|
||||||
#include "vnotefile.h"
|
#include "vnotefile.h"
|
||||||
#include "vcart.h"
|
#include "vcart.h"
|
||||||
|
|
||||||
@ -252,7 +251,7 @@ void VSearchResultTree::activateItem(const QTreeWidgetItem *p_item) const
|
|||||||
{
|
{
|
||||||
VNotebook *nb = g_vnote->getNotebook(resItem->m_path);
|
VNotebook *nb = g_vnote->getNotebook(resItem->m_path);
|
||||||
if (nb) {
|
if (nb) {
|
||||||
g_mainWin->getNotebookSelector()->locateNotebook(nb);
|
g_mainWin->locateNotebook(nb);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -794,7 +794,7 @@ void VSearchUE::activateItem(const QSharedPointer<VSearchResultItem> &p_item)
|
|||||||
{
|
{
|
||||||
VNotebook *nb = g_vnote->getNotebook(p_item->m_path);
|
VNotebook *nb = g_vnote->getNotebook(p_item->m_path);
|
||||||
if (nb) {
|
if (nb) {
|
||||||
g_mainWin->getNotebookSelector()->locateNotebook(nb);
|
g_mainWin->locateNotebook(nb);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user