Add nocursor setting and --nocursor flag

This commit is contained in:
Gabriel SAILLARD (GitSquared) 2019-04-06 18:49:12 +02:00
parent 8cc25908fe
commit 18b9aa4345
No known key found for this signature in database
GPG Key ID: 4F615B5FE436611A
3 changed files with 16 additions and 1 deletions

1
.gitignore vendored
View File

@ -42,3 +42,4 @@ jspm_packages
dist
prebuild-src
file-icons
src/node_modules

View File

@ -47,6 +47,11 @@ if (electron.remote.process.argv.includes("--nointro")) {
} else {
window.settings.nointroOverride = false;
}
if (electron.remote.process.argv.includes("--nocursor")) {
window.settings.nocursorOverride = true;
} else {
window.settings.nocursorOverride = false;
}
// Retrieve theme override (hotswitch)
ipc.once("getThemeOverride", (e, theme) => {
@ -101,6 +106,7 @@ window._loadTheme = theme => {
body {
font-family: var(--font_main), sans-serif;
cursor: ${(window.nocursorOverride || window.settings.nocursor) ? "none" : "default"} !important;
}
${window._purifyCSS(theme.injectCSS || "")}
@ -655,6 +661,14 @@ window.openSettings = async () => {
<option>${!window.settings.nointro}</option>
</select></td>
</tr>
<tr>
<td>nocursor</td>
<td>Hide the mouse cursor${(window.settings.nocursorOverride) ? " (Currently overridden by CLI flag)" : ""}</td>
<td><select id="settingsEditor-nocursor">
<option>${window.settings.nocursor}</option>
<option>${!window.settings.nocursor}</option>
</select></td>
</tr>
<tr>
<td>iface</td>
<td>Override the interface used for network monitoring</td>
@ -735,6 +749,7 @@ window.writeSettingsFile = () => {
port: Number(document.getElementById("settingsEditor-port").value),
monitor: Number(document.getElementById("settingsEditor-monitor").value),
nointro: (document.getElementById("settingsEditor-nointro").value === "true"),
nocursor: (document.getElementById("settingsEditor-nocursor").value === "true"),
iface: document.getElementById("settingsEditor-iface").value,
allowWindowed: (document.getElementById("settingsEditor-allowWindowed").value === "true"),
excludeSelfFromToplist: (document.getElementById("settingsEditor-excludeSelfFromToplist").value === "true"),

View File

@ -6,7 +6,6 @@ html, body {
overflow: hidden;
}
body {
cursor: default !important;
user-select: none !important;
padding-top: 1.85vh;
color: rgb(var(--color_r), var(--color_g), var(--color_b));