add hover to show, remove scrollbars

This commit is contained in:
Marvin
2020-05-17 01:05:18 +02:00
parent d17d8a14a2
commit 5bfe0ab1e4
4 changed files with 45 additions and 13 deletions

35
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,35 @@
name: Build/release
on: push
jobs:
release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest]
steps:
- name: Check out Git repository
uses: actions/checkout@v1
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 10
- name: Build/release Electron app
uses: samuelmeuli/action-electron-builder@v1
with:
skip_build: true
# GitHub token, automatically provided to the action
# (No need to define this secret in the repo settings)
github_token: ${{ secrets.github_token }}
mac_certs: ${{ secrets.mac_certs }}
mac_certs_password: ${{ secrets.mac_certs_password }}
# If the commit is tagged with a version (e.g. "v1.0.0"),
# release the app after building
release: ${{ startsWith(github.ref, 'refs/tags/v') }}

21
app.js
View File

@@ -90,16 +90,6 @@ const getMenu = () => {
createMainWindow(store.get('detachedMode')) createMainWindow(store.get('detachedMode'))
} }
}, },
{
label: 'Hide Window Bar',
type: 'checkbox',
enabled: store.get('detachedMode'),
checked: store.get('hideWindowBar'),
click: () => {
store.set('hideWindowBar', !store.get('hideWindowBar'));
createMainWindow(true)
}
},
{ {
type: 'separator' type: 'separator'
}, },
@@ -155,7 +145,7 @@ const createMainWindow = (show = false) => {
show: false, show: false,
skipTaskbar: true, skipTaskbar: true,
autoHideMenuBar: true, autoHideMenuBar: true,
frame: !!store.get('detachedMode') && !store.get('hideWindowBar'), frame: false,
webPreferences: { webPreferences: {
nodeIntegration: true nodeIntegration: true
} }
@@ -168,7 +158,14 @@ const createMainWindow = (show = false) => {
if (!store.has('windowSize')) store.set('windowSize', window.getSize()) if (!store.has('windowSize')) store.set('windowSize', window.getSize())
} }
window.loadURL(`file://${__dirname}/web/index.html`); window.loadURL(`file://${__dirname}/web/index.html`)
window.webContents.on('did-finish-load', function() {
window.webContents.insertCSS('::-webkit-scrollbar { display: none; } body { -webkit-user-select: none; }');
if (store.get('detachedMode')) {
window.webContents.insertCSS('body { -webkit-app-region: drag; }');
}
});
if (store.get('detachedMode')) { if (store.get('detachedMode')) {
window.setSize(...store.get('windowSizeDetached')); window.setSize(...store.get('windowSizeDetached'));

BIN
media/video1.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

View File

@@ -9,7 +9,7 @@
"main": "app.js", "main": "app.js",
"scripts": { "scripts": {
"start": "electron .", "start": "electron .",
"build": "electron-builder build --mac --win --publish never", "build-local": "electron-builder build --mac --win --publish never",
"deploy": "electron-builder build --mac --win --publish always", "deploy": "electron-builder build --mac --win --publish always",
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },