Skip to content

Commit

Permalink
feat(UI): new settimgbar tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio286 committed Nov 28, 2022
1 parent b06bafe commit 6728964
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 6 deletions.
62 changes: 62 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
"electron-updater": "~4.6.5",
"electron-window-state": "~5.0.3",
"encoding": "~0.1.13",
"floating-vue": "~2.0.0-beta.20",
"leaflet": "~1.7.1",
"marked": "~4.0.19",
"moment": "~2.29.4",
Expand Down
8 changes: 7 additions & 1 deletion src/renderer/components/SettingBarConnections.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,15 @@
>
<div
v-if="!element.isFolder && !folderedConnections.includes(element.uid)"
v-tooltip="{
strategy: 'fixed',
placement: 'right',
content: getConnectionName(element.uid)
}"
class="settingbar-element btn btn-link"
:class="{ 'selected': element.uid === selectedWorkspace }"
:title="getConnectionName(element.uid)"
placement="right"
strategy="fixed"
@click.stop="selectWorkspace(element.uid)"
>
<!-- Creates a new folder -->
Expand Down
12 changes: 11 additions & 1 deletion src/renderer/components/SettingBarConnectionsFolder.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
<template>
<div
v-tooltip="{
strategy: 'fixed',
placement: 'right',
content: folder.name,
disabled: isOpen || !folder.name
}"
class="settingbar-element folder btn btn-link p-1"
:class="[{ 'selected-inside': hasSelectedInside && !isOpen }]"
:style="isOpen ? `height: auto; opacity: 1;` : null"
:title="folder.name"
>
<Draggable
class="folder-container"
Expand Down Expand Up @@ -40,6 +45,11 @@
<template #item="{ element }">
<div
:key="element"
v-tooltip="{
strategy: 'fixed',
placement: 'right',
content: getConnectionName(element)
}"
class="folder-element"
:class="{ 'selected': element === selectedWorkspace }"
@click="emit('select-workspace', element)"
Expand Down
24 changes: 20 additions & 4 deletions src/renderer/components/TheSettingBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,26 @@
<ul class="settingbar-elements">
<li
v-if="isScrollable"
v-tooltip="{
strategy: 'fixed',
placement: 'right',
content: t('message.allConnections')
}"
class="settingbar-element btn btn-link"
:title="t('message.allConnections')"
@click="emit('show-connections-modal')"
>
<div class="settingbar-element-icon-wrapper">
<i class="settingbar-element-icon mdi mdi-24px mdi-dots-horizontal text-light" />
</div>
</li>
<li
v-tooltip="{
strategy: 'fixed',
placement: 'right',
content: t('message.addConnection')
}"
class="settingbar-element btn btn-link"
:class="{ 'selected': 'NEW' === selectedWorkspace }"
:title="t('message.addConnection')"
@click="selectWorkspace('NEW')"
>
<div class="settingbar-element-icon-wrapper">
Expand All @@ -44,15 +52,23 @@
<ul class="settingbar-elements">
<li
v-if="!disableScratchpad"
v-tooltip="{
strategy: 'fixed',
placement: 'right',
content: t('word.scratchpad')
}"
class="settingbar-element btn btn-link"
:title="t('word.scratchpad')"
@click="showScratchpad"
>
<i class="settingbar-element-icon mdi mdi-24px mdi-notebook-edit-outline text-light" />
</li>
<li
v-tooltip="{
strategy: 'fixed',
placement: 'right',
content: t('word.settings')
}"
class="settingbar-element btn btn-link"
:title="t('word.settings')"
@click="showSettingModal('general')"
>
<i
Expand Down
3 changes: 3 additions & 0 deletions src/renderer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import { ipcRenderer } from 'electron';
import { createApp } from 'vue';
import { createPinia } from 'pinia';
import { VueMaskDirective } from 'v-mask';
import * as FloatingVue from 'floating-vue';
import '@mdi/font/css/materialdesignicons.css';
import 'floating-vue/dist/style.css';
import 'leaflet/dist/leaflet.css';
import '@/scss/main.scss';

Expand All @@ -27,6 +29,7 @@ createApp(App)
.directive('mask', vMaskV3)
.use(createPinia())
.use(i18n)
.use(FloatingVue)
.mount('#app');

const { locale } = useSettingsStore();
Expand Down

0 comments on commit 6728964

Please sign in to comment.