Bind ctrl-meta-f to toggle full screen

Refs #134
This commit is contained in:
Kevin Sawicki
2013-02-05 09:35:39 -08:00
parent 9011d62351
commit 1b2c7faed9
6 changed files with 13 additions and 0 deletions

View File

@@ -80,6 +80,9 @@ bool AtomCefClient::OnProcessMessageReceived(CefRefPtr<CefBrowser> browser,
else if (name == "show") {
Show(browser);
}
else if (name == "toggleFullScreen") {
ToggleFullScreen(browser);
}
else {
return false;
}

View File

@@ -124,6 +124,7 @@ class AtomCefClient : public CefClient,
void Exit(int status);
void Log(const char *message);
void Show(CefRefPtr<CefBrowser> browser);
void ToggleFullScreen(CefRefPtr<CefBrowser> browser);
IMPLEMENT_REFCOUNTING(AtomCefClient);
IMPLEMENT_LOCKING(AtomCefClient);

View File

@@ -118,6 +118,10 @@ void AtomCefClient::Show(CefRefPtr<CefBrowser> browser) {
[windowController.webView setHidden:NO];
}
void AtomCefClient::ToggleFullScreen(CefRefPtr<CefBrowser> browser) {
[[browser->GetHost()->GetWindowHandle() window] toggleFullScreen:nil];
}
void AtomCefClient::ShowSaveDialog(int replyId, CefRefPtr<CefBrowser> browser) {
CefRefPtr<CefProcessMessage> replyMessage = CefProcessMessage::Create("reply");
CefRefPtr<CefListValue> replyArguments = replyMessage->GetArgumentList();

View File

@@ -111,6 +111,9 @@ _.extend atom,
endTracing: ->
@sendMessageToBrowserProcess('endTracing')
toggleFullScreen: ->
@sendMessageToBrowserProcess('toggleFullScreen')
getRootViewStateForPath: (path) ->
if json = localStorage[path]
JSON.parse(json)

View File

@@ -28,6 +28,7 @@
'meta--': 'window:decrease-font-size'
'ctrl-w w': 'window:focus-next-pane'
'ctrl-tab': 'window:focus-next-pane'
'ctrl-meta-f': 'window:toggle-full-screen'
'alt-meta-i': 'toggle-dev-tools'

View File

@@ -28,6 +28,7 @@ windowAdditions =
$(window).on 'core:close', => @close()
$(window).command 'window:close', => @close()
$(window).command 'window:toggle-full-screen', => atom.toggleFullScreen()
$(window).on 'focus', -> $("body").removeClass('is-blurred')
$(window).on 'blur', -> $("body").addClass('is-blurred')