From 0e4ba39fbf8af5c4579dd6bb0232acba592afcff Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Thu, 24 Jan 2019 21:59:06 +0700 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B4=D0=B5=D0=BB=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Reader/TextPage/DrawHelper.js | 25 +++++++---- .../components/Reader/TextPage/TextPage.vue | 43 ++++--------------- 2 files changed, 25 insertions(+), 43 deletions(-) diff --git a/client/components/Reader/TextPage/DrawHelper.js b/client/components/Reader/TextPage/DrawHelper.js index b1920189..36e81590 100644 --- a/client/components/Reader/TextPage/DrawHelper.js +++ b/client/components/Reader/TextPage/DrawHelper.js @@ -21,8 +21,8 @@ export default class DrawHelper { if (w1 + w2 + w3 <= w && w3 > (10 + fh2)) { const barWidth = w - w1 - w2 - fh2; - out += this.strokeRect(x + w1, y + pad - 2, barWidth, fh - 4, this.statusBarColor); - out += this.fillRect(x + w1 + 2, y + pad, (barWidth - 4)*read, fh - 6, this.statusBarColor); + out += this.strokeRect(x + w1, y + pad, barWidth, fh - 2, this.statusBarColor); + out += this.fillRect(x + w1 + 2, y + pad + 2, (barWidth - 4)*read, fh - 6, this.statusBarColor); } if (w1 <= w) @@ -37,10 +37,10 @@ export default class DrawHelper { `width: ${this.realWidth}px; height: ${statusBarHeight}px; ` + `color: ${this.statusBarColor}; background-color: ${this.backgroundColor}">`; - const fontSize = statusBarHeight - 6; + const fontSize = statusBarHeight*0.75; const font = 'bold ' + this.fontBySize(fontSize); - out += this.fillRect(0, (statusBarTop ? statusBarHeight : 1), this.realWidth, 1, this.statusBarColor); + out += this.fillRect(0, (statusBarTop ? statusBarHeight : 0), this.realWidth, 1, this.statusBarColor); const date = new Date(); const time = `${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`; @@ -55,6 +55,12 @@ export default class DrawHelper { return out; } + statusBarClickable(statusBarTop, statusBarHeight) { + return `
`; + } + fittingString(str, maxWidth, font) { let w = this.measureTextFont(str, font); const ellipsis = '…'; @@ -71,12 +77,13 @@ export default class DrawHelper { } } - fillTextShift(text, x, y, font, size) { - return this.fillText(text, x, y + size*this.fontShift, font); + fillTextShift(text, x, y, font, size, css) { + return this.fillText(text, x, y + size*this.fontShift, font, css); } - fillText(text, x, y, font) { - return `
${text}
`; + fillText(text, x, y, font, css) { + css = (css ? css : ''); + return `
${text}
`; } fillRect(x, y, w, h, color) { @@ -86,6 +93,6 @@ export default class DrawHelper { strokeRect(x, y, w, h, color) { return `
`; + `width: ${w}px; height: ${h}px; box-sizing: border-box; border: 1px solid ${color}">`; } } \ No newline at end of file diff --git a/client/components/Reader/TextPage/TextPage.vue b/client/components/Reader/TextPage/TextPage.vue index a6db2504..49acec3b 100644 --- a/client/components/Reader/TextPage/TextPage.vue +++ b/client/components/Reader/TextPage/TextPage.vue @@ -1,5 +1,5 @@