Skip to content

Commit

Permalink
時計機能を追加、メニューの文言を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
TETSUAKI BABA committed Oct 30, 2023
1 parent a6b2eb1 commit 2809957
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
12 changes: 11 additions & 1 deletion electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: () => {
Expand Down Expand Up @@ -318,7 +328,7 @@ app.whenReady().then(() => {
}
},
{
label: 'クリップボードをコードスニペットに送信',
label: 'クリップボード内容を配布資料欄に送信',
accelerator: process.platform === 'darwin' ? 'Command+Shift+V' : 'Control+Shift+V',
click: () => {
sendClipText2CodeSnippet();
Expand Down
2 changes: 1 addition & 1 deletion electron/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "commentable-desktop",
"version": "1.4.1",
"version": "1.4.2",
"description": "コメンタブルの表示をデスクトップ上に投影するアプリケーション.終了する場合はタスクバーから終了を選択してください.",
"main": "main.js",
"scripts": {
Expand Down
24 changes: 22 additions & 2 deletions electron/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 2809957

Please sign in to comment.