Skip to content

Commit 9b36c6b

Browse files
authored
Add side bar icon tooltip (#206)
1 parent d87058b commit 9b36c6b

File tree

5 files changed

+15
-3
lines changed

5 files changed

+15
-3
lines changed

src/components/sidebar/SideBarIcon.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
icon: 'side-bar-button-icon',
1212
}"
1313
@click="emit('click', $event)"
14+
v-tooltip="{ value: props.tooltip, showDelay: 300, hideDelay: 300 }"
1415
/>
1516
</template>
1617

@@ -20,6 +21,10 @@ import Button from "primevue/button";
2021
const props = defineProps({
2122
icon: String,
2223
selected: Boolean,
24+
tooltip: {
25+
type: String,
26+
default: "",
27+
},
2328
});
2429
2530
const emit = defineEmits(["click"]);

src/components/sidebar/SideBarSettingsToggleIcon.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<SideBarIcon icon="pi pi-cog" @click="showSetting" />
2+
<SideBarIcon icon="pi pi-cog" @click="showSetting" tooltip="Settings" />
33
</template>
44

55
<script setup lang="ts">

src/components/sidebar/SideBarThemeToggleIcon.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<SideBarIcon :icon="icon" @click="toggleTheme" />
2+
<SideBarIcon :icon="icon" @click="toggleTheme" tooltip="Toggle Theme" />
33
</template>
44

55
<script setup lang="ts">

src/components/sidebar/SideToolBar.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<SideBarIcon
55
v-for="item in items"
66
:icon="item.icon"
7+
:tooltip="item.tooltip"
78
:selected="item === selectedItem"
89
@click="onItemClick(item)"
910
/>
@@ -26,7 +27,11 @@ import { markRaw, onMounted, onUnmounted, ref, watch } from "vue";
2627
2728
const items = ref([
2829
// { icon: "pi pi-map", component: markRaw(NodeDetailSideBarItem) },
29-
{ icon: "pi pi-history", component: markRaw(QueueSideBarItem) },
30+
{
31+
icon: "pi pi-history",
32+
tooltip: "Queue",
33+
component: markRaw(QueueSideBarItem),
34+
},
3035
]);
3136
const selectedItem = ref(null);
3237
const onItemClick = (item) => {

src/main.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Aura from "@primevue/themes/aura";
44
import { definePreset } from "@primevue/themes";
55
import ConfirmationService from "primevue/confirmationservice";
66
import ToastService from "primevue/toastservice";
7+
import Tooltip from "primevue/tooltip";
78
import "primeicons/primeicons.css";
89

910
import App from "./App.vue";
@@ -24,6 +25,7 @@ comfyApp.setup().then(() => {
2425
window["app"] = comfyApp;
2526
window["graph"] = comfyApp.graph;
2627

28+
app.directive("tooltip", Tooltip);
2729
app
2830
.use(PrimeVue, {
2931
theme: {

0 commit comments

Comments
 (0)