mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-24 05:58:08 +00:00
Merge pull request #552 from olexs/electron-zoom-factor
Option to scale the whole display using Electron's zoom factor
This commit is contained in:
@@ -29,6 +29,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
- Added option `address` to set bind address.
|
- Added option `address` to set bind address.
|
||||||
- Added option `onlyTemp` for currentweather module to show show only current temperature and weather icon.
|
- Added option `onlyTemp` for currentweather module to show show only current temperature and weather icon.
|
||||||
- Added option `remoteFile` to compliments module to load compliment array from filesystem.
|
- Added option `remoteFile` to compliments module to load compliment array from filesystem.
|
||||||
|
- Added option `zoom` to scale the whole mirror display with a given factor.
|
||||||
- Added option `roundTemp` for currentweather and weatherforecast modules to display temperatures rounded to nearest integer.
|
- Added option `roundTemp` for currentweather and weatherforecast modules to display temperatures rounded to nearest integer.
|
||||||
|
|
||||||
### Updated
|
### Updated
|
||||||
|
@@ -79,6 +79,7 @@ The following properties can be configured:
|
|||||||
| `address` | The ip address the accept connections. The default open bind `::` is IPv6 is available or `0.0.0.0` IPv4 run on. Example config: `192.168.10.100`. |
|
| `address` | The ip address the accept connections. The default open bind `::` is IPv6 is available or `0.0.0.0` IPv4 run on. Example config: `192.168.10.100`. |
|
||||||
| `ipWhitelist` | The list of IPs from which you are allowed to access the MagicMirror². The default value is `["127.0.0.1", "::ffff:127.0.0.1", "::1"]`. It is possible to specify IPs with subnet masks (`["127.0.0.1", "127.0.0.1/24"]`) or define ip ranges (`["127.0.0.1", ["192.168.0.1", "192.168.0.100"]]`).|
|
| `ipWhitelist` | The list of IPs from which you are allowed to access the MagicMirror². The default value is `["127.0.0.1", "::ffff:127.0.0.1", "::1"]`. It is possible to specify IPs with subnet masks (`["127.0.0.1", "127.0.0.1/24"]`) or define ip ranges (`["127.0.0.1", ["192.168.0.1", "192.168.0.100"]]`).|
|
||||||
| `kioskmode` | This allows MagicMirror² to run in Kiosk Mode. It protects from other programs popping on top of your screen. The default value is `false`|
|
| `kioskmode` | This allows MagicMirror² to run in Kiosk Mode. It protects from other programs popping on top of your screen. The default value is `false`|
|
||||||
|
| `zoom` | This allows to scale the mirror contents with a given zoom factor. The default value is `1.0`|
|
||||||
| `language` | The language of the interface. (Note: Not all elements will be localized.) Possible values are `en`, `nl`, `ru`, `fr`, etc., but the default value is `en`. |
|
| `language` | The language of the interface. (Note: Not all elements will be localized.) Possible values are `en`, `nl`, `ru`, `fr`, etc., but the default value is `en`. |
|
||||||
| `timeFormat` | The form of time notation that will be used. Possible values are `12` or `24`. The default is `24`. |
|
| `timeFormat` | The form of time notation that will be used. Possible values are `12` or `24`. The default is `24`. |
|
||||||
| `units` | The units that will be used in the default weather modules. Possible values are `metric` or `imperial`. The default is `metric`. |
|
| `units` | The units that will be used in the default weather modules. Possible values are `metric` or `imperial`. The default is `metric`. |
|
||||||
|
@@ -15,6 +15,7 @@ var defaults = {
|
|||||||
language: "en",
|
language: "en",
|
||||||
timeFormat: 24,
|
timeFormat: 24,
|
||||||
units: "metric",
|
units: "metric",
|
||||||
|
zoom: 1,
|
||||||
|
|
||||||
modules: [
|
modules: [
|
||||||
{
|
{
|
||||||
|
@@ -18,13 +18,29 @@ const BrowserWindow = electron.BrowserWindow;
|
|||||||
let mainWindow;
|
let mainWindow;
|
||||||
|
|
||||||
function createWindow() {
|
function createWindow() {
|
||||||
// Create the browser window.
|
|
||||||
if (config.kioskmode) {
|
var electronOptions = {
|
||||||
mainWindow = new BrowserWindow({width: 800, height: 600, x: 0, y: 0, kiosk:true, darkTheme: true, webPreferences: {nodeIntegration: false}});
|
width: 800,
|
||||||
} else {
|
height: 600,
|
||||||
mainWindow = new BrowserWindow({width: 800, height: 600, x: 0, y: 0, fullscreen: true, autoHideMenuBar: true, darkTheme: true, webPreferences: {nodeIntegration: false}});
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
darkTheme: true,
|
||||||
|
webPreferences: {
|
||||||
|
nodeIntegration: false,
|
||||||
|
zoomFactor: config.zoom
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config.kioskmode) {
|
||||||
|
electronOptions.kiosk = true;
|
||||||
|
} else {
|
||||||
|
electronOptions.fullscreen = true;
|
||||||
|
electronOptions.autoHideMenuBar = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create the browser window.
|
||||||
|
mainWindow = new BrowserWindow(electronOptions);
|
||||||
|
|
||||||
// and load the index.html of the app.
|
// and load the index.html of the app.
|
||||||
//mainWindow.loadURL('file://' + __dirname + '../../index.html');
|
//mainWindow.loadURL('file://' + __dirname + '../../index.html');
|
||||||
mainWindow.loadURL("http://localhost:" + config.port);
|
mainWindow.loadURL("http://localhost:" + config.port);
|
||||||
|
Reference in New Issue
Block a user