ui: change font, wip

This commit is contained in:
jean-emmanuel 2017-07-12 19:43:43 +02:00
parent 7bba3d0d21
commit 4a63c6b8c3
18 changed files with 67 additions and 43 deletions

View file

@ -58,7 +58,7 @@ var editObject = function(container, data, refresh){
input = $(`<select class="input" data-type="${type}" title="${i}"/>`)
for (let c in categories) {
input.append(`<optgroup label="${c}">`)
input.append(`<optgroup label="> ${c}">`)
for (let t of categories[c]) {
input.append(`<option ${t==value?'selected=':''} value="${t}">${t}</option>`)
}

View file

@ -75,7 +75,8 @@ module.exports = class _canvas_base extends _widgets_base {
}
this.fontSize = parseFloat(style.getPropertyValue("font-size"))
this.ctx.font = this.fontSize + 'px ' + this.fontFamily
this.fontWeight = parseFloat(style.getPropertyValue("font-weight"))
this.ctx.font = this.fontWeight + ' ' + this.fontSize + 'px ' + this.fontFamily
this.ctx.textBaseline = "middle"
this.ctx.textAlign = this.textAlign

View file

@ -249,7 +249,7 @@ module.exports = class Fader extends _sliders_base {
this.ctx.stroke()
this.ctx.beginPath()
this.ctx.globalAlpha = 1
this.ctx.globalAlpha = 0.7
this.ctx.strokeStyle = this.colors.gauge
this.ctx.moveTo(m, o)
this.ctx.lineTo(m, d)

View file

@ -148,7 +148,7 @@ module.exports = class Knob extends _sliders_base {
pipsWidth = this.getProp('pips') ? 3 * PXSCALE : 0,
pipsRadius = this.minDimension / 2 - pipsWidth / 2 - margin,
gaugeWidth = 7 * PXSCALE,
gaugeRadius = pipsRadius - gaugeWidth / 2 - pipsWidth / 2,
gaugeRadius = pipsRadius - gaugeWidth / 2 - pipsWidth * 1.5,
knobRadius = gaugeRadius - gaugeWidth
@ -166,7 +166,7 @@ module.exports = class Knob extends _sliders_base {
this.ctx.beginPath()
for (var pip of this.rangeKeys.concat(this.valueToPercent(this.originValue))) {
let r1 = pipsRadius - pipsWidth / 2,
r2 = pipsRadius + pipsWidth / 2 + PXSCALE,
r2 = pipsRadius + pipsWidth / 2,
a = 2 * Math.PI - this.percentToAngle(pip)
if (pip == 0) a += 1.5 * PXSCALE / pipsRadius
@ -176,10 +176,15 @@ module.exports = class Knob extends _sliders_base {
this.ctx.lineTo(r2 * Math.cos(a) + this.width / 2, this.height / 2 - r2 * Math.sin(a))
}
this.ctx.lineWidth = PXSCALE
this.ctx.lineWidth = PXSCALE * 7
this.ctx.strokeStyle = this.colors.fg
this.ctx.stroke()
this.ctx.lineWidth = PXSCALE * 3
this.ctx.strokeStyle = this.colors.pips
this.ctx.stroke()
}
if (!tiny) {
@ -206,6 +211,7 @@ module.exports = class Knob extends _sliders_base {
this.ctx.arc(this.width / 2, this.height / 2, gaugeRadius, min, max)
this.ctx.stroke()
this.ctx.globalAlpha = 0.7
this.ctx.strokeStyle = this.colors.gauge
this.ctx.lineWidth = gaugeWidth - 4.5 * PXSCALE
this.ctx.beginPath()