Skip to content

Commit 89dea10

Browse files
authored
Migrate TopNav to the composition API (#7227)
1 parent c1f5cdb commit 89dea10

File tree

7 files changed

+691
-654
lines changed

7 files changed

+691
-654
lines changed

src/renderer/App.js

+3-32
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineComponent } from 'vue'
22
import { mapActions, mapMutations } from 'vuex'
33
import FtFlexBox from './components/ft-flex-box/ft-flex-box.vue'
4-
import TopNav from './components/top-nav/top-nav.vue'
4+
import TopNav from './components/TopNav/TopNav.vue'
55
import SideNav from './components/SideNav/SideNav.vue'
66
import FtNotificationBanner from './components/ft-notification-banner/ft-notification-banner.vue'
77
import FtPrompt from './components/FtPrompt/FtPrompt.vue'
@@ -201,7 +201,6 @@ export default defineComponent({
201201
this.setupListenersToSyncWindows()
202202
this.activateKeyboardShortcuts()
203203
this.openAllLinksExternally()
204-
this.enableSetSearchQueryText()
205204
this.enableOpenUrl()
206205
this.watchSystemTheme()
207206
await this.checkExternalPlayer()
@@ -227,7 +226,6 @@ export default defineComponent({
227226
methods: {
228227
setDocumentTitle: function(value) {
229228
document.title = value
230-
this.$nextTick(() => this.$refs.topNav?.setActiveNavigationHistoryEntryTitle(value))
231229
},
232230
checkThemeSettings: function () {
233231
const theme = {
@@ -358,25 +356,8 @@ export default defineComponent({
358356
this.$store.commit('setIsKeyboardShortcutPromptShown', !this.isKeyboardShortcutPromptShown)
359357
}
360358

361-
if (event.altKey) {
362-
switch (event.key) {
363-
case 'D':
364-
case 'd':
365-
this.$refs.topNav.focusSearch()
366-
break
367-
}
368-
}
369-
switch (event.key) {
370-
case 'Tab':
371-
this.showOutlines()
372-
break
373-
case 'L':
374-
case 'l':
375-
if ((process.platform !== 'darwin' && event.ctrlKey) ||
376-
(process.platform === 'darwin' && event.metaKey)) {
377-
this.$refs.topNav.focusSearch()
378-
}
379-
break
359+
if (event.key === 'Tab') {
360+
this.showOutlines()
380361
}
381362
},
382363

@@ -528,16 +509,6 @@ export default defineComponent({
528509
})
529510
},
530511

531-
enableSetSearchQueryText: function () {
532-
ipcRenderer.on(IpcChannels.UPDATE_SEARCH_INPUT_TEXT, (event, searchQueryText) => {
533-
if (searchQueryText) {
534-
this.$refs.topNav.updateSearchInputText(searchQueryText)
535-
}
536-
})
537-
538-
ipcRenderer.send(IpcChannels.SEARCH_INPUT_HANDLING_READY)
539-
},
540-
541512
enableOpenUrl: function () {
542513
ipcRenderer.on(IpcChannels.OPEN_URL, (event, url, { isLaunchLink = false } = { }) => {
543514
if (url) {

src/renderer/App.vue

-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@
7171
v-if="showProgressBar"
7272
/>
7373
<top-nav
74-
ref="topNav"
7574
:inert="isPromptOpen"
7675
/>
7776
<side-nav

0 commit comments

Comments
 (0)