From 2809957b19ad696cb6502ff1e51beed32b700437 Mon Sep 17 00:00:00 2001 From: TETSUAKI BABA Date: Mon, 30 Oct 2023 22:34:39 +0900 Subject: [PATCH] =?UTF-8?q?=E6=99=82=E8=A8=88=E6=A9=9F=E8=83=BD=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=80=81=E3=83=A1=E3=83=8B=E3=83=A5=E3=83=BC?= =?UTF-8?q?=E3=81=AE=E6=96=87=E8=A8=80=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- electron/main.js | 12 +++++++++++- electron/package.json | 2 +- electron/sketch.js | 24 ++++++++++++++++++++++-- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/electron/main.js b/electron/main.js index 8c0b31d..d027fd2 100644 --- a/electron/main.js +++ b/electron/main.js @@ -272,6 +272,16 @@ app.whenReady().then(() => { } } }, + { + label: '時計を表示', type: 'checkbox', + click(item, focusedWindow) { + + win.webContents.executeJavaScript(`toggleClock(${item.checked});`, true) + .then(result => { + }).catch(console.error) + + } + }, { label: '効果音ツールを開く', click: () => { @@ -318,7 +328,7 @@ app.whenReady().then(() => { } }, { - label: 'クリップボードをコードスニペットに送信', + label: 'クリップボード内容を配布資料欄に送信', accelerator: process.platform === 'darwin' ? 'Command+Shift+V' : 'Control+Shift+V', click: () => { sendClipText2CodeSnippet(); diff --git a/electron/package.json b/electron/package.json index c551131..5a9e54e 100644 --- a/electron/package.json +++ b/electron/package.json @@ -1,6 +1,6 @@ { "name": "commentable-desktop", - "version": "1.4.1", + "version": "1.4.2", "description": "コメンタブルの表示をデスクトップ上に投影するアプリケーション.終了する場合はタスクバーから終了を選択してください.", "main": "main.js", "scripts": { diff --git a/electron/sketch.js b/electron/sketch.js index df1e790..282c483 100644 --- a/electron/sketch.js +++ b/electron/sketch.js @@ -456,9 +456,25 @@ function setup() { function draw() { clear(); - background(0, 0, 0, 0); - + //background(0, 0, 0, 0); + + if (flg_clock == true) { + let now = new Date(); + let hour = now.getHours(); + let minute = now.getMinutes(); + let second = now.getSeconds(); + + let time = `${hour.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')}`; + textStyle(BOLD); + strokeWeight(5.0); + stroke("#000"); + fill("#ffffff"); + textSize(height / 15); + textAlign(LEFT, TOP); + text(time, 20, 10); + } + textStyle(NORMAL); for (var i = 0; i < max_number_of_comment; i++) { if (comments[i].getLife() > 0) { comments[i].update(); @@ -612,6 +628,10 @@ function toggleSoundMute() { flg_sound_mute = !flg_sound_mute; } +var flg_clock = false; +function toggleClock(checked) { + flg_clock = checked; +} function toggleSpeech() { flg_speech = this.checked();