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

Add zoom options #137

Merged
merged 1 commit into from
Mar 5, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 83 additions & 22 deletions app/scripts/menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { remote } from 'electron';
import { servers } from './servers';
import { sidebar } from './sidebar';
import { webview } from './webview';
import webFrame from 'web-frame';
import config from './config';
import '../branding/branding.js';

Expand Down Expand Up @@ -105,26 +106,37 @@ if (process.platform === 'darwin') {
label: 'View',
submenu: [
{
label: 'Reload current server',
accelerator: 'Command+R',
label: 'Original Zoom',
accelerator: 'Command+0',
click: function() {
const activeWebview = webview.getActive();
if (activeWebview) {
activeWebview.reload();
}
webFrame.setZoomLevel(0);
}
},
{
label: 'Reload application',
accelerator: 'Command+Shift+R',
label: 'Zoom In',
accelerator: 'Command+=',
tassoevan marked this conversation as resolved.
Show resolved Hide resolved
click: function() {
remote.getCurrentWindow().reload();
webFrame.setZoomLevel(webFrame.getZoomLevel()+1);
}
},
{
label: 'Toggle server list',
label: 'Zoom Out',
accelerator: 'Command+-',
click: function() {
sidebar.toggle();
webFrame.setZoomLevel(webFrame.getZoomLevel()-1);
}
},
{
type: 'separator'
},
{
label: 'Reload - current server',
accelerator: 'Command+R',
click: function() {
const activeWebview = webview.getActive();
if (activeWebview) {
activeWebview.reload();
}
}
},
{
Expand All @@ -137,11 +149,30 @@ if (process.platform === 'darwin') {
}
}
},
{
type: 'separator'
},
{
label: 'Reload - application',
accelerator: 'Command+Shift+R',
click: function() {
remote.getCurrentWindow().reload();
}
},
{
label: 'Toggle DevTools - application',
click: function() {
remote.getCurrentWindow().toggleDevTools();
}
},
{
type: 'separator'
},
{
label: 'Toggle server list',
click: function() {
sidebar.toggle();
}
}
]
},
Expand Down Expand Up @@ -237,26 +268,37 @@ if (process.platform === 'darwin') {
label: 'View',
submenu: [
{
label: 'Reload current server',
accelerator: 'Ctrl+R',
label: 'Original Zoom',
accelerator: 'Command+0',
click: function() {
const activeWebview = webview.getActive();
if (activeWebview) {
activeWebview.reload();
}
webFrame.setZoomLevel(0);
}
},
{
label: 'Reload application',
accelerator: 'Ctrl+Shift+R',
label: 'Zoom In',
accelerator: 'Command+=',
click: function() {
remote.getCurrentWindow().reload();
webFrame.setZoomLevel(webFrame.getZoomLevel()+1);
}
},
{
label: 'Toggle server list',
label: 'Zoom Out',
accelerator: 'Command+-',
click: function() {
sidebar.toggle();
webFrame.setZoomLevel(webFrame.getZoomLevel()-1);
}
},
{
type: 'separator'
},
{
label: 'Reload - current server',
accelerator: 'Ctrl+R',
click: function() {
const activeWebview = webview.getActive();
if (activeWebview) {
activeWebview.reload();
}
}
},
{
Expand All @@ -269,11 +311,30 @@ if (process.platform === 'darwin') {
}
}
},
{
type: 'separator'
},
{
label: 'Reload - application',
accelerator: 'Ctrl+Shift+R',
click: function() {
remote.getCurrentWindow().reload();
}
},
{
label: 'Toggle DevTools - application',
click: function() {
remote.getCurrentWindow().toggleDevTools();
}
},
{
type: 'separator'
},
{
label: 'Toggle server list',
click: function() {
sidebar.toggle();
}
}
]
},
Expand Down