瀏覽代碼

added mode tool tip

Dimitri Korsch 3 年之前
父節點
當前提交
66a07e8208
共有 1 個文件被更改,包括 41 次插入0 次删除
  1. 41 0
      webui/src/components/media/annotated-image.vue

+ 41 - 0
webui/src/components/media/annotated-image.vue

@@ -18,6 +18,7 @@
 
       <div class="media">
         <h3>{{current.path}}</h3>
+        <div class="mode-tooltip">{{modeTooltip()}}</div>
 
         <!-- image -->
         <img v-if="current.type === 'image'"
@@ -187,6 +188,39 @@ export default {
     }
   },
   methods: {
+
+    modeTooltip: function(){
+      let tip = "Selected mode";
+      switch (this.interaction) {
+        case "draw-box":
+          return `${tip}: draw bounding-box`;
+
+        case "estimate-box":
+          return `${tip}: estimate bounding-box`;
+
+        case "extreme-clicking":
+          return `${tip}: extreme clicking`;
+
+        case "move-box":
+          return `${tip}: move or resize bounding-box`;
+
+        case "label-box":
+          return `${tip}: label bounding-box as "${this.label.name}"`;
+
+        case "confirm-box":
+          return `${tip}: confirm bounding-box`;
+
+        case "remove-box":
+          return `${tip}: remove bounding-box`;
+
+        case "info-box":
+          return `${tip}: bounding-box info`;
+
+        default:
+          return "";
+      }
+    },
+
     resize: function () {
       const rect = this.$refs.root.getBoundingClientRect();
 
@@ -374,4 +408,11 @@ h3 {
   max-height: 5%;
   margin: 0.5em;
 }
+
+.mode-tooltip {
+  max-width: 100%;
+  max-height: 5%;
+  margin: 0.5em;
+}
+
 </style>