Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for Electron App #113

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix for Electron App #113

wants to merge 1 commit into from

Conversation

ellerbrock
Copy link

Problems:

1.) running npm start in template-app throws an error that Module app can't be found.

Versions: - Node: 6.2.2 - npm: 3.10.3

Output:

template-app#> npm start
template-app#> electron .

App threw an error during load
Error: Cannot find module 'app'
    at Module._resolveFilename (module.js:438:15)

2.) Window Setting: `'title-bar-style': 'hidden' not working. Also the Window content doesn't fit properly.

[window bug]

More Details can be found here: frameless-window.

Bugfix 1:

Run Electron in a frameless window and add Drag Support to class toolbar-header.

app.js:

app.on('ready', function() {
  // Create the browser window.
  mainWindow = new BrowserWindow({
    frame: false,
    width: 740,
    height: 470
  });

index.html:

add: style="-webkit-app-region: drag"

<header class="toolbar toolbar-header" style="-webkit-app-region: drag">
  <h1 class="title">Photon</h1>
</header>

Problem: In this case we can move the Window but the close, minimize and maximize buttons are missing and need to be implemented later on.

Bugfix 2:

Start Electron in a normal Window and delete the HTML toolbar.

app.js:

app.on('ready', function() {
  // Create the browser window.
  mainWindow = new BrowserWindow({
    width: 740,
    height: 470
  });

index.html:

delete:

<header class="toolbar toolbar-header">
  <h1 class="title">Photon</h1>
</header>

Hope this help you guys. And thanks for the awesome Framework for Electron, love it! Keep up with the great work.

Cheers Maik Ellerbrock

@trufae
Copy link

trufae commented Apr 23, 2017

please rebase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants