Skip to content

Commit

Permalink
feat: window title in app title bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio286 committed Aug 5, 2020
1 parent 4fd72ec commit 0089c0c
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/renderer/components/TheTitleBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<img class="titlebar-logo" :src="require('@/images/logo.svg').default">
</div>
<div class="titlebar-elements">
<!-- -->
{{ windowTitle }}
</div>
<div class="titlebar-elements">
<div
Expand Down Expand Up @@ -38,6 +38,7 @@

<script>
import { remote, ipcRenderer } from 'electron';
import { mapGetters } from 'vuex';
export default {
name: 'TheTitleBar',
Expand All @@ -48,6 +49,22 @@ export default {
isDevelopment: process.env.NODE_ENV === 'development'
};
},
computed: {
...mapGetters({
getConnectionName: 'connections/getConnectionName',
selectedWorkspace: 'workspaces/getSelected',
getWorkspace: 'workspaces/getWorkspace'
}),
windowTitle () {
if (!this.selectedWorkspace) return '';
const connectionName = this.getConnectionName(this.selectedWorkspace);
const workspace = this.getWorkspace(this.selectedWorkspace);
const breadcrumbs = Object.values(workspace.breadcrumbs).filter(breadcrumb => breadcrumb);
return [connectionName, ...breadcrumbs].join('');
}
},
created () {
window.addEventListener('resize', this.onResize);
},
Expand Down

0 comments on commit 0089c0c

Please sign in to comment.