Skip to content

Commit 017b764

Browse files
authored
feat: add tooltips for simulator sidebar buttons
- Added tooltip translations for 7 buttons in English, Hindi, and Bengali - Implemented tooltips on mobile UI buttons (Circuit Elements, Wiring Mode, Verilog Panel, Copy, Paste, Properties) - Added tooltip to Report Issue button - Enhanced tooltip styling with theme-aware colors and shadow effects - Tooltips display on hover without blocking UI functionality - Supports both browser native tooltips and custom CSS-based styling Fixes #841
1 parent 4aa55ad commit 017b764

File tree

6 files changed

+60
-3
lines changed

6 files changed

+60
-3
lines changed

src/components/Extra.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@
183183
@mousedown="simulatorMobileStore.showElementsPanel = !simulatorMobileStore.showElementsPanel"
184184
:style="{bottom: simulatorMobileStore.showElementsPanel ? '10rem' : '2rem'}"
185185
v-if="simulatorMobileStore.showMobileButtons && simulatorMobileStore.showMobileView && !simulatorMobileStore.isVerilog"
186+
:title="$t('simulator.tooltip.circuit_elements')"
186187
>
187188
<i class="fas fa-bezier-curve"></i>
188189
</v-btn>
@@ -202,6 +203,7 @@
202203
}"
203204
:style="{bottom: simulatorMobileStore.showElementsPanel ? '10rem' : '2rem', backgroundColor: selectMultiple ? 'var(--primary)' : 'var(--bg-toggle-btn-primary)'}"
204205
v-if="simulatorMobileStore.showMobileButtons && simulatorMobileStore.showMobileView && !simulatorMobileStore.isVerilog"
206+
:title="$t('simulator.tooltip.wiring_mode')"
205207
>
206208
<i class="fa-solid fa-vector-square"></i>
207209
</v-btn>
@@ -210,6 +212,7 @@
210212
class="cir-verilog-btn"
211213
@mousedown="simulatorMobileStore.showVerilogPanel = !simulatorMobileStore.showVerilogPanel"
212214
v-if="simulatorMobileStore.showMobileButtons && simulatorMobileStore.isVerilog && simulatorMobileStore.showMobileView"
215+
:title="$t('simulator.tooltip.verilog_panel')"
213216
>
214217
<i class="fa-solid fa-gears"></i>
215218
</v-btn>
@@ -219,6 +222,7 @@
219222
@mousedown="copyBtnClick()"
220223
:style="{bottom: simulatorMobileStore.showElementsPanel ? '16rem' : '8rem'}"
221224
v-if="simulatorMobileStore.showMobileButtons && simulatorMobileStore.showMobileView && !simulatorMobileStore.isCopy && !simulatorMobileStore.isVerilog"
225+
:title="$t('simulator.tooltip.copy')"
222226
>
223227
<i class="fa-solid fa-copy"></i>
224228
</v-btn>
@@ -228,6 +232,7 @@
228232
@mousedown="pasteBtnClick()"
229233
:style="{bottom: simulatorMobileStore.showElementsPanel ? '16rem' : '8rem'}"
230234
v-if="simulatorMobileStore.showMobileButtons && simulatorMobileStore.showMobileView && simulatorMobileStore.isCopy && !simulatorMobileStore.isVerilog"
235+
:title="$t('simulator.tooltip.paste')"
231236
>
232237
<i class="fa-solid fa-paste"></i>
233238
</v-btn>
@@ -237,6 +242,7 @@
237242
@mousedown="propertiesBtnClick()"
238243
:style="{bottom: simulatorMobileStore.showElementsPanel ? `${propertiesPanelPos.up}rem` : `${propertiesPanelPos.down}rem`}"
239244
v-if="simulatorMobileStore.showMobileButtons && simulatorMobileStore.showMobileView"
245+
:title="$t('simulator.tooltip.properties')"
240246
>
241247
<i class="fa-solid fa-sliders"></i>
242248
</v-btn>

src/components/ReportIssue/ReportIssueButton.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
data-target=".issue"
88
:style="{ bottom: simulatorMobileStore.showElementsPanel ? '250px' : '120px' }"
99
@click="openReportingModal"
10+
:title="$t('simulator.tooltip.report_issue')"
1011
>
1112
<span class="fa fa-bug"></span>&nbsp;&nbsp;{{
1213
$t('simulator.report_issue')

src/locales/bn.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,14 @@
145145
"pause_timing_diagram": "টাইমিং ডায়াগ্রামকে বিরত রাখুন",
146146
"decrease_width": "প্রস্থ কমান",
147147
"increase_width": "প্রস্থ বাড়ান",
148-
"reset": "পুনরায় সেট করুন"
148+
"reset": "পুনরায় সেট করুন",
149+
"circuit_elements": "সার্কিট উপাদান",
150+
"wiring_mode": "ওয়্যারিং মোড",
151+
"verilog_panel": "ভেরিলগ প্যানেল",
152+
"copy": "কপি করুন",
153+
"paste": "পেস্ট করুন",
154+
"properties": "বৈশিষ্ট্য",
155+
"report_issue": "সমস্যার রিপোর্ট করুন"
149156
}
150157
}
151158
}

src/locales/en.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,14 @@
161161
"pause_timing_diagram": "Pause Timing Diagram",
162162
"decrease_width": "Decrease Width",
163163
"increase_width": "Increase Width",
164-
"reset": "Reset"
164+
"reset": "Reset",
165+
"circuit_elements": "Circuit Elements",
166+
"wiring_mode": "Wiring Mode",
167+
"verilog_panel": "Verilog Panel",
168+
"copy": "Copy",
169+
"paste": "Paste",
170+
"properties": "Properties",
171+
"report_issue": "Report an Issue"
165172
}
166173
}
167174
}

src/locales/hi.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,14 @@
161161
"pause_timing_diagram": "टाइमिंग डायग्राम को पॉज करें",
162162
"decrease_width": "चौड़ाई घटाएं",
163163
"increase_width": "चौड़ाई बढ़ाएँ",
164-
"reset": "रिसेट करें"
164+
"reset": "रिसेट करें",
165+
"circuit_elements": "सर्किट तत्व",
166+
"wiring_mode": "वायरिंग मोड",
167+
"verilog_panel": "वेरिलॉग पैनल",
168+
"copy": "कॉपी",
169+
"paste": "पेस्ट",
170+
"properties": "गुण",
171+
"report_issue": "समस्या की रिपोर्ट करें"
165172
}
166173
}
167174
}

src/styles/color_theme.scss

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,3 +553,32 @@ select {
553553
border: 1px solid var(--br-primary);
554554
color: var(--text-panel);
555555
}
556+
/* Enhanced tooltips for sidebar and floating buttons */
557+
.cir-btn[title],
558+
.cir-ele-btn[title],
559+
.cir-verilog-btn[title],
560+
.report-sidebar a[title] {
561+
position: relative;
562+
}
563+
564+
.cir-btn[title]:hover::after,
565+
.cir-ele-btn[title]:hover::after,
566+
.cir-verilog-btn[title]:hover::after,
567+
.report-sidebar a[title]:hover::after {
568+
content: attr(title);
569+
position: absolute;
570+
bottom: 110%;
571+
left: 50%;
572+
transform: translateX(-50%);
573+
background-color: var(--bg-icons);
574+
color: var(--text-panel);
575+
padding: 8px 12px;
576+
border-radius: 4px;
577+
font-size: 12px;
578+
white-space: nowrap;
579+
z-index: 1000;
580+
border: 1px solid var(--br-primary);
581+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
582+
font-weight: 500;
583+
pointer-events: none;
584+
}

0 commit comments

Comments
 (0)