Skip to content

Commit 3590585

Browse files
authored
Merge pull request #262 from JunoLab/sp/betterbuttons
allow svg in buttons
2 parents cc33d14 + 8ee7062 commit 3590585

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/debugger/toolbar.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,14 @@ export class DebuggerToolbar {
1616
this.view.appendChild(group)
1717
}
1818

19-
buttonView ({icon, text, tooltip, command, color}) {
19+
buttonView ({icon, text, tooltip, command, color, svg}) {
2020
let btn = document.createElement('button')
2121
btn.classList.add('btn', 'ink-btn-variable-width')
2222
if (text) btn.innerText = text
23+
if (svg) {
24+
btn.innerHTML = svg
25+
btn.classList.add(`custom-svg-icon`)
26+
}
2327
if (icon) btn.classList.add(`icon-${icon}`)
2428
if (color) btn.classList.add(`btn-color-${color}`)
2529
btn.onclick = () => atom.commands.dispatch(atom.views.getView(atom.workspace), command)

styles/debugger.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
background: @syntax-background-color;
66
color: @syntax-text-color;
77

8+
button::before {
9+
line-height: inherit!important;
10+
}
11+
812
hr {
913
border-top: 1px solid @base-border-color;
1014
}

0 commit comments

Comments
 (0)