Searcher: add name of parent directory to the result

This commit is contained in:
Le Tan 2018-08-22 20:08:48 +08:00
parent 5d4b450fab
commit 4ef6925bf7
7 changed files with 19 additions and 4 deletions

View File

@ -9,7 +9,7 @@ mdhl_file=v_detorte.mdhl
css_file=v_detorte.css
codeblock_css_file=v_detorte_codeblock.css
mermaid_css_file=v_detorte_mermaid.css
version=8
version=9
; This mapping will be used to translate colors when the content of HTML is copied
; without background. You could just specify the foreground colors mapping here.
@ -175,6 +175,7 @@ toolbox_icon_active_fg=@master_fg
toolbox_title_border=@master_bg
; Dockwidget.
dockwidget_bg=@base_bg
dockwidget_title_fg=@title_fg
dockwidget_title_bg=@title_bg
dockwidget_button_hover_bg=@hover_bg

View File

@ -151,6 +151,7 @@ QToolButton::menu-arrow {
/* DockWidget */
QDockWidget {
color: @dockwidget_title_fg;
background: @dockwidget_bg;
titlebar-close-icon: url(close.svg);
titlebar-normal-icon: url(float.svg);
}

View File

@ -7,7 +7,7 @@ mdhl_file=v_moonlight.mdhl
css_file=v_moonlight.css
codeblock_css_file=v_moonlight_codeblock.css
mermaid_css_file=v_moonlight_mermaid.css
version=19
version=20
; This mapping will be used to translate colors when the content of HTML is copied
; without background. You could just specify the foreground colors mapping here.
@ -173,6 +173,7 @@ toolbox_icon_active_fg=@master_fg
toolbox_title_border=@master_bg
; Dockwidget.
dockwidget_bg=@base_bg
dockwidget_title_fg=@title_fg
dockwidget_title_bg=@title_bg
dockwidget_button_hover_bg=@hover_bg

View File

@ -151,6 +151,7 @@ QToolButton::menu-arrow {
/* DockWidget */
QDockWidget {
color: @dockwidget_title_fg;
background: @dockwidget_bg;
titlebar-close-icon: url(close.svg);
titlebar-normal-icon: url(float.svg);
}

View File

@ -7,7 +7,7 @@ mdhl_file=v_pure.mdhl
css_file=v_pure.css
codeblock_css_file=v_pure_codeblock.css
mermaid_css_file=v_pure_mermaid.css
version=17
version=18
[phony]
; Abstract color attributes.
@ -165,6 +165,7 @@ toolbox_icon_active_fg=@master_fg
toolbox_title_border=@master_bg
; Dockwidget.
dockwidget_bg=@base_bg
dockwidget_title_fg=@title_fg
dockwidget_title_bg=@title_bg
dockwidget_button_hover_bg=@hover_bg

View File

@ -151,6 +151,7 @@ QToolButton::menu-arrow {
/* DockWidget */
QDockWidget {
color: @dockwidget_title_fg;
background: @dockwidget_bg;
titlebar-close-icon: url(close.svg);
titlebar-normal-icon: url(float.svg);
}

View File

@ -11,6 +11,7 @@
#include "vcart.h"
#include "vhistorylist.h"
#include "vexplorer.h"
#include "vuniversalentry.h"
extern VNote *g_vnote;
@ -112,7 +113,15 @@ void VSearchResultTree::appendItem(const QSharedPointer<VSearchResultItem> &p_it
QTreeWidgetItem *item = new QTreeWidgetItem(this);
item->setData(0, Qt::UserRole, m_data.size() - 1);
item->setText(0, p_item->m_text.isEmpty() ? p_item->m_path : p_item->m_text);
QString text;
if (p_item->m_text.isEmpty()) {
text = p_item->m_path;
} else if (p_item->m_type != VSearchResultItem::Notebook) {
text = VUniversalEntry::fileNameWithDir(p_item->m_text, p_item->m_path);
} else {
text = p_item->m_text;
}
item->setText(0, text);
item->setToolTip(0, p_item->m_path);
switch (p_item->m_type) {