Skip to content

Commit 605ba90

Browse files
committed
more tweaks
1 parent 88d9a93 commit 605ba90

File tree

2 files changed

+63
-4
lines changed

2 files changed

+63
-4
lines changed

lib/debugger/debugger-pane.js

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { CompositeDisposable, TextEditor } from 'atom'
88
import PaneItem from '../util/pane-item'
99
import { open } from '../util/opener'
1010
import views from '../util/views'
11-
import { DebuggerToolbar } from './toolbar'
11+
import { DebuggerToolbar, buttonView } from './toolbar'
1212

1313
// pane for side-to-side view of compiled code and source code
1414
export default class DebuggerPane extends PaneItem {
@@ -23,7 +23,7 @@ export default class DebuggerPane extends PaneItem {
2323
DebuggerPane.subs.dispose()
2424
}
2525

26-
constructor (stepper, breakpointManager, buttons=[]) {
26+
constructor (stepper, breakpointManager, buttons=[], startButtons=[]) {
2727
super()
2828

2929
this.subs = new CompositeDisposable()
@@ -32,6 +32,7 @@ export default class DebuggerPane extends PaneItem {
3232
this.breakpointManager = breakpointManager
3333

3434
this.toolbar = new DebuggerToolbar(buttons)
35+
this.startButtons = startButtons
3536

3637
this.stepper.onStep(arg => this.updateStepper(arg))
3738
this.breakpointManager.onUpdate(arg => this.updateBreakpoints(arg))
@@ -107,8 +108,28 @@ export default class DebuggerPane extends PaneItem {
107108
toolbarView () {
108109
const expressionHidden = !this.info.text
109110

111+
let run = () => {
112+
const ed = atom.workspace.getActiveTextEditor()
113+
if (ed) {
114+
atom.commands.dispatch(atom.views.getView(ed), this.refs.runnerSelector.value)
115+
}
116+
}
117+
110118
return <div className="item toolbar">
111119
<div className="inner-toolbar">
120+
<div className="debugger-runner">
121+
<button className="btn icon icon-triangle-right btn-color-success" onclick={run}>
122+
</button>
123+
<select className="input-select" ref="runnerSelector">
124+
{
125+
this.startButtons.map(btn => {
126+
return <option value={btn.command}>
127+
{ btn.text || ''}
128+
</option>
129+
})
130+
}
131+
</select>
132+
</div>
112133
{toView(this.toolbar.view)}
113134
<Tip alt={this.compileModeTip}>
114135
<div className="flex-table-container">

styles/debugger.less

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,15 @@
3333
line-height: 2.6em;
3434
.ink-debug-toolbar {
3535
width: 100%;
36-
36+
3737
.ink-btn-group-variable-width {
3838
width: 100%;
39+
display: flex;
40+
flex-wrap: wrap;
41+
flex-direction: row;
3942

4043
.ink-btn-variable-width {
41-
width: 14%;
44+
flex: 1;
4245
min-width: 3em;
4346
}
4447
}
@@ -49,6 +52,41 @@
4952
flex-direction: row;
5053
flex-wrap: wrap;
5154

55+
.debugger-runner {
56+
width: ~"calc(100% + 2em + 10px)";
57+
margin: 0 -1em 0 -1em;
58+
padding: 0 ~"calc(1em + 5px)" 0 ~"calc(1em + 5px)";
59+
background-color: @button-background-color;
60+
border-bottom: 1px solid @pane-item-border-color;
61+
62+
display: flex;
63+
64+
.btn {
65+
background: @button-background-color;
66+
border: none;
67+
border-radius: 0;
68+
border-left: 1px solid @pane-item-border-color;
69+
&:focus {
70+
border: none;
71+
box-shadow: none;
72+
outline: none;
73+
}
74+
}
75+
select {
76+
background: @button-background-color;
77+
border: none;
78+
border-left: 1px solid @pane-item-border-color;
79+
padding-left: 1em;
80+
border-radius: 0;
81+
width: inherit;
82+
&:focus {
83+
border: none;
84+
box-shadow: none;
85+
border-left: 1px solid @pane-item-border-color;
86+
}
87+
}
88+
}
89+
5290
.flex-table-container {
5391
right: @component-padding;
5492
top: @component-padding;

0 commit comments

Comments
 (0)