mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-11 11:02:27 +08:00
feat(client): set up quick search as launcher
This commit is contained in:
parent
045c8699a9
commit
20b0215364
@ -107,7 +107,7 @@ export default class DesktopLayout {
|
|||||||
.css("flex-grow", "1")
|
.css("flex-grow", "1")
|
||||||
.optChild(!launcherPaneIsHorizontal, launcherPane)
|
.optChild(!launcherPaneIsHorizontal, launcherPane)
|
||||||
.child(new LeftPaneContainer()
|
.child(new LeftPaneContainer()
|
||||||
.child(new QuickSearchWidget())
|
.optChild(!launcherPaneIsHorizontal, new QuickSearchWidget())
|
||||||
.child(appContext.noteTreeWidget)
|
.child(appContext.noteTreeWidget)
|
||||||
.child(...this.customWidgets.get('left-pane'))
|
.child(...this.customWidgets.get('left-pane'))
|
||||||
)
|
)
|
||||||
|
@ -10,6 +10,7 @@ import CommandButtonWidget from "../buttons/command_button.js";
|
|||||||
import utils from "../../services/utils.js";
|
import utils from "../../services/utils.js";
|
||||||
import TodayLauncher from "../buttons/launcher/today_launcher.js";
|
import TodayLauncher from "../buttons/launcher/today_launcher.js";
|
||||||
import HistoryNavigationButton from "../buttons/history_navigation.js";
|
import HistoryNavigationButton from "../buttons/history_navigation.js";
|
||||||
|
import QuickSearchWidget from "../quick_search.js";
|
||||||
|
|
||||||
export default class LauncherWidget extends BasicWidget {
|
export default class LauncherWidget extends BasicWidget {
|
||||||
constructor() {
|
constructor() {
|
||||||
@ -107,6 +108,8 @@ export default class LauncherWidget extends BasicWidget {
|
|||||||
return new HistoryNavigationButton(note, "forwardInNoteHistory");
|
return new HistoryNavigationButton(note, "forwardInNoteHistory");
|
||||||
case "todayInJournal":
|
case "todayInJournal":
|
||||||
return new TodayLauncher(note);
|
return new TodayLauncher(note);
|
||||||
|
case "quickSearch":
|
||||||
|
return new QuickSearchWidget();
|
||||||
default:
|
default:
|
||||||
throw new Error(`Unrecognized builtin widget ${builtinWidget} for launcher ${note.noteId} "${note.title}"`);
|
throw new Error(`Unrecognized builtin widget ${builtinWidget} for launcher ${note.noteId} "${note.title}"`);
|
||||||
}
|
}
|
||||||
|
@ -1136,6 +1136,9 @@ li.dropdown-submenu:hover > ul.dropdown-menu {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#launcher-pane.horizontal .quick-search {
|
||||||
|
width: 350px;
|
||||||
|
}
|
||||||
|
|
||||||
#launcher-pane .icon-action:hover {
|
#launcher-pane .icon-action:hover {
|
||||||
background-color: var(--hover-item-background-color);
|
background-color: var(--hover-item-background-color);
|
||||||
|
@ -34,7 +34,7 @@ interface Item {
|
|||||||
baseSize?: string;
|
baseSize?: string;
|
||||||
growthFactor?: string;
|
growthFactor?: string;
|
||||||
targetNoteId?: "_backendLog" | "_globalNoteMap";
|
targetNoteId?: "_backendLog" | "_globalNoteMap";
|
||||||
builtinWidget?: "bookmarks" | "spacer" | "backInHistoryButton" | "forwardInHistoryButton" | "syncStatus" | "protectedSession" | "todayInJournal" | "calendar";
|
builtinWidget?: "bookmarks" | "spacer" | "backInHistoryButton" | "forwardInHistoryButton" | "syncStatus" | "protectedSession" | "todayInJournal" | "calendar" | "quickSearch";
|
||||||
command?: keyof typeof Command;
|
command?: keyof typeof Command;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -240,6 +240,7 @@ const HIDDEN_SUBTREE_DEFINITION: Item = {
|
|||||||
{ id: '_lbBookmarks', title: 'Bookmarks', type: 'launcher', builtinWidget: 'bookmarks', icon: 'bx bx-bookmark' },
|
{ id: '_lbBookmarks', title: 'Bookmarks', type: 'launcher', builtinWidget: 'bookmarks', icon: 'bx bx-bookmark' },
|
||||||
{ id: '_lbToday', title: "Open Today's Journal Note", type: 'launcher', builtinWidget: 'todayInJournal', icon: 'bx bx-calendar-star' },
|
{ id: '_lbToday', title: "Open Today's Journal Note", type: 'launcher', builtinWidget: 'todayInJournal', icon: 'bx bx-calendar-star' },
|
||||||
{ id: '_lbSpacer2', title: 'Spacer', type: 'launcher', builtinWidget: 'spacer', baseSize: "0", growthFactor: "1" },
|
{ id: '_lbSpacer2', title: 'Spacer', type: 'launcher', builtinWidget: 'spacer', baseSize: "0", growthFactor: "1" },
|
||||||
|
{ id: '_lbQuickSearch', title: "Quick Search", type: "launcher", builtinWidget: "quickSearch", icon: "bx bx-rectangle" },
|
||||||
{ id: '_lbProtectedSession', title: 'Protected Session', type: 'launcher', builtinWidget: 'protectedSession', icon: 'bx bx bx-shield-quarter' },
|
{ id: '_lbProtectedSession', title: 'Protected Session', type: 'launcher', builtinWidget: 'protectedSession', icon: 'bx bx bx-shield-quarter' },
|
||||||
{ id: '_lbSyncStatus', title: 'Sync Status', type: 'launcher', builtinWidget: 'syncStatus', icon: 'bx bx-wifi' },
|
{ id: '_lbSyncStatus', title: 'Sync Status', type: 'launcher', builtinWidget: 'syncStatus', icon: 'bx bx-wifi' },
|
||||||
{ id: '_lbSettings', title: 'Settings', type: 'launcher', command: 'showOptions', icon: 'bx bx-cog' }
|
{ id: '_lbSettings', title: 'Settings', type: 'launcher', command: 'showOptions', icon: 'bx bx-cog' }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user