10000 UI font update, CSS update, labels. · arduino/lab-micropython-editor@49d3ec8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 49d3ec8

Browse files
committed
UI font update, CSS update, labels.
Signed-off-by: ubi de feo <me@ubidefeo.com>
1 parent ea5b620 commit 49d3ec8

File tree

5 files changed

+35
-11
lines changed

5 files changed

+35
-11
lines changed

ui/arduino/main.css

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,18 @@
77
font-style: normal;
88
}
99

10+
@font-face {
11+
font-family: "OpenSans";
12+
src: url("media/open-sans_5.0.29_latin-wght-normal.woff2") format("woff2");
13+
font-weight: normal;
14+
font-style: normal;
15+
}
16+
1017
* {
1118
-moz-user-select: none;
1219
-webkit-user-select: none;
1320
user-select: none;
14-
font-family: "RobotoMono", monospace;
21+
font-family: "OpenSans", sans-serif;
1522
}
1623

1724
body, html {
@@ -78,14 +85,19 @@ button.small .icon {
7885
align-content: space-between;
7986
align-items: center;
8087
gap: 10px;
88+
width: 50px
89+
}
90+
.button.first{
91+
width:80px;
8192
}
8293
.button .label {
8394
text-align: center;
8495
color: #eee;
85-
opacity: 50%;
96+
opacity: 0.5;
97+
font-family: "OpenSans", sans-serif;
8698
}
8799
.button .label.active {
88-
opacity: 100%;
100+
opacity: 1;
89101
}
90102
.button .tooltip {
91103
opacity: 0;
@@ -147,6 +159,7 @@ button.small .icon {
147159
min-width: 1px;
148160
flex-basis: fit-content;
149161
background: #fff;
162+
opacity: 0.7;
150163
position: relative;
151164
margin-left: 0.5em;
152165
margin-right: 0.5em;
@@ -236,8 +249,12 @@ button.small .icon {
236249
font-size: 16px;
237250
height: 100%;
238251
overflow: hidden;
252+
239253
}
240254

255+
#code-editor * {
256+
font-family: "RobotoMono", monospace;
257+
}
241258
#code-editor .cm-editor {
242259
width: 100%;
243260
height: 100%;
@@ -411,9 +428,10 @@ button.small .icon {
411428
/* width: 100%; */
412429
}
413430

414-
.dialog .dialog-content input {
415-
font-size: 1.4em;
431+
.dialog .dialog-content #file-name {
432+
font-size: 1.1em;
416433
width:100%;
434+
font-family: "RobotoMono", monospace;
417435
}
418436

419437
.dialog .dialog-content input:focus {
@@ -439,18 +457,18 @@ button.small .icon {
439457
flex-direction: row;
440458
justify-content: center;
441459
width: 100%;
442-
gap: 20px;
460+
gap: 12px;
443461
}
444462
.dialog .buttons-horizontal .item {
445-
flex-basis: 40%;
463+
flex-basis: 50%;
446464
align-items: center;
447465
background-color: #eee;;
448466
}
449467

450468
.dialog-title{
451469
width: 100%;
452470
font-size: 0.8em;
453-
padding: 0.7em;
471+
padding: 0;
454472
margin: 0;
455473
flex-basis: max-content;
456474
}
Binary file not shown.

ui/arduino/store.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1567,7 +1567,10 @@ async function store(state, emitter) {
15671567
const confirmation = confirmDialog(`File ${newFile.fileName} already exists on ${source}. Please choose another name.`, 'OK')
15681568
return false
15691569
}
1570+
// LEAK > listeners keep getting added and not removed when tabs are closed
1571+
// additionally I found that closing a tab has actually added an extra listener
15701572
newFile.editor.onChange = function() {
1573+
console.log('editor has changes')
15711574
newFile.hasChanges = true
15721575
emitter.emit('render')
15731576
}

ui/arduino/views/components/elements/button.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ function Button(args) {
77
active = false,
88
label,
99
tooltip,
10-
background
10+
background,
11+
first
1112
} = args
1213
let tooltipEl = html``
1314
if (tooltip) {
@@ -16,8 +17,9 @@ function Button(args) {
1617
let activeClass = active ? 'active' : ''
1718
let backgroundClass = background ? 'inverted' : ''
1819
let labelActiveClass = disabled ? '' : 'active'
20+
let buttonFirstClass = first ? 'first' : ''
1921
return html`
20-
<div class="button">
22+
<div class="button ${buttonFirstClass}">
2123
<button class="${size} ${activeClass} ${backgroundClass}" onclick=${onClick} disabled=${disabled}>
2224
<img class="icon" src="media/${icon}" />
2325
</button>

ui/arduino/views/components/toolbar.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ function Toolbar(state, emit) {
1818
label: state.isConnected ? 'Disconnect' : 'Connect',
1919
tooltip: state.isConnected ? `Disconnect (${metaKeyString}+Shift+D)` : `Connect (${metaKeyString}+Shift+C)`,
2020
onClick: () => state.isConnected ? emit('disconnect') : emit('open-connection-dialog'),
21-
active: state.isConnected
21+
active: state.isConnected,
22+
first: true
2223
})}
2324
2425
<div class="separator"></div>

0 commit comments

Comments
 (0)
0