Skip to content

Commit

Permalink
Menu option for hover method
Browse files Browse the repository at this point in the history
  • Loading branch information
fohristiwhirl committed Jul 5, 2019
1 parent ec2a7fd commit 0fab61d
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 3 deletions.
4 changes: 2 additions & 2 deletions 95_renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1041,9 +1041,9 @@ function NewRenderer() {
return false;
}

if (!config.hover_type || config.hover_type === 0) {
if (!config.hover_method || config.hover_method === 0) {
return this.hoverdraw_animate(div_index, info); // Sets this.hoverdraw_div
} else if (config.hover_type === 1) {
} else if (config.hover_method === 1) {
return this.hoverdraw_single(div_index, overlist); // Sets this.hoverdraw_div
} else {
return false; // Caller must set this.hoverdraw_div to -1
Expand Down
1 change: 1 addition & 0 deletions config.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"show_q_plus_u": false,
"searchmoves_buttons": true,
"hover_draw": false,
"hover_method": 0,
"serious_analysis_mode": false,
"update_delay": 170,
"animate_delay_multiplier": 4,
Expand Down
31 changes: 30 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ function menu_build() {
type: "separator"
},
{
label: "Draw when mouse over PV",
label: "Draw PV on mouseover",
accelerator: "CommandOrControl+D",
type: "checkbox",
checked: config.hover_draw,
Expand All @@ -883,6 +883,35 @@ function menu_build() {
});
}
},
{
label: "Draw PV method",
submenu: [
{
label: "Animate",
type: "checkbox",
checked: config.hover_method === 0,
click: () => {
set_checks(["Analysis", "Hover draw type"], 0);
win.webContents.send("set", {
key: "hover_method",
value: 0
});
}
},
{
label: "Single move",
type: "checkbox",
checked: config.hover_method === 1,
click: () => {
set_checks(["Analysis", "Hover draw type"], 1);
win.webContents.send("set", {
key: "hover_method",
value: 1
});
}
},
]
},
{
type: "separator"
},
Expand Down
1 change: 1 addition & 0 deletions modules/load_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const defaults = {
"show_q_plus_u": false,
"searchmoves_buttons": true,
"hover_draw": false,
"hover_method": 0,
"serious_analysis_mode": false,
"update_delay": 170,
"animate_delay_multiplier": 4,
Expand Down

0 comments on commit 0fab61d

Please sign in to comment.