Skip to content

Commit b7512b0

Browse files
authored
Merge pull request #41 from arduino/bugfix/ui-updates
Update UI elements and renamed button component file
2 parents e6509b6 + f6fe20f commit b7512b0

File tree

5 files changed

+21
-12
lines changed

5 files changed

+21
-12
lines changed

ui/arduino/components/toolbar_button.js renamed to ui/arduino/components/button.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ function Button(param) {
88
selected = false
99
} = param || {}
1010
return html`
11-
<div class="toolbar-button-wrapper ${disabled ? 'disabled' : ''} ${selected ? 'selected' : ''}">
11+
<div
12+
class="toolbar-button-wrapper ${disabled ? 'disabled' : ''} ${selected ? 'selected' : ''}"
13+
onclick=${onclick}
14+
>
1215
<button
1316
class="toolbar-button"
14-
onclick=${onclick}
1517
disabled=${disabled}
1618
>
1719
${Icon(icon)}

ui/arduino/components/panel_terminal.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ class XTerm extends Component {
2626
}
2727

2828
resizeTerm() {
29-
let handleSize = 2 * 0.0225 * window.innerHeight
29+
let handleSize = 36
3030
const parentStyle = window.getComputedStyle(document.querySelector('#panel'))
3131
const parentWidth = parseInt(parentStyle.getPropertyValue('width'))
3232
const parentHeight = parseInt(parentStyle.getPropertyValue('height'))
3333
const cols = Math.floor(parentWidth / this.term._core._renderService.dimensions.actualCellWidth)
34-
const rows = Math.floor((parentHeight-handleSize) / this.term._core._renderService.dimensions.actualCellHeight)
34+
const rows = Math.floor((parentHeight-handleSize) / this.term._core._renderService.dimensions.actualCellHeight) - 1
3535
this.term.resize(cols, rows)
3636
}
3737
}

ui/arduino/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
<!-- Components -->
1919
<script type="text/javascript" src="components/icon.js" charset="utf-8"></script>
20-
<script type="text/javascript" src="components/toolbar_button.js" charset="utf-8"></script>
20+
<script type="text/javascript" src="components/button.js" charset="utf-8"></script>
2121
<script type="text/javascript" src="components/toolbar.js" charset="utf-8"></script>
2222
<script type="text/javascript" src="components/filename.js" charset="utf-8"></script>
2323
<script type="text/javascript" src="components/editor.js" charset="utf-8"></script>

ui/arduino/store.js

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ function store(state, emitter) {
6969
state.isTerminalOpen = false
7070
state.serialFiles = []
7171
emitter.emit('render')
72+
resizeEditor(state)
7273
})
7374
emitter.on('connect', async (path) => {
7475
log('connect')

ui/arduino/theme.css

+13-7
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ img {
5959
justify-content: center;
6060
align-items: center;
6161
margin: 0 0.2rem;
62+
cursor: pointer;
6263
}
6364

6465
.toolbar-button-wrapper.selected .toolbar-button {
@@ -184,7 +185,7 @@ img {
184185
}
185186
#panel #handle {
186187
position: relative;
187-
height: 2rem;
188+
height: 2.5rem;
188189
background: var(--teal);
189190
cursor: n-resize;
190191
display: flex;
@@ -205,7 +206,8 @@ img {
205206
user-select: none;
206207
width: 1.5rem;
207208
height: 1.5rem;
208-
line-height: 1rem;
209+
border-radius: 100%;
210+
line-height: 1.75rem;
209211
background: var(--white-faded);
210212
margin: 0 0.25rem;
211213
}
@@ -215,6 +217,7 @@ img {
215217
width: 100vw;
216218
height: 100%;
217219
background: black;
220+
padding: 0 0.5rem;
218221
}
219222

220223
#files {
@@ -223,24 +226,26 @@ img {
223226
background: var(--white);
224227
display: flex;
225228
flex-direction: row;
226-
padding: 1rem;
229+
padding: 0.5rem 1rem 1rem 1rem;
227230
overflow: hidden;
228231
}
229232

230233
#files .file-list {
231234
width: 100%;
232235
display: flex;
233236
flex-direction: column;
234-
padding: 1rem;
237+
padding: 0 1rem 1rem 1rem;
235238
width: 45%;
236239
}
237240

238241
#files .file-list .path {
239-
height: 2.5rem;
242+
/* height: 2.5rem; */
240243
color: var(--black);
241244
overflow: hidden;
242245
white-space: nowrap;
243246
text-overflow: ellipsis;
247+
font-size: 0.5rem;
248+
padding: 0.25rem 0;
244249
}
245250

246251
#files .toolbar-label {
@@ -279,8 +284,9 @@ img {
279284
}
280285

281286
#files .file-controls .toolbar-button {
282-
width: 1.5rem;
283-
height: 1.5rem;
287+
width: 1.25rem;
288+
height: 1.25rem;
289+
padding: 0;
284290
}
285291

286292
#message {

0 commit comments

Comments
 (0)