mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -111,6 +111,9 @@ _.extend atom,
|
||||
endTracing: ->
|
||||
@sendMessageToBrowserProcess('endTracing')
|
||||
|
||||
toggleFullScreen: ->
|
||||
@sendMessageToBrowserProcess('toggleFullScreen')
|
||||
|
||||
getRootViewStateForPath: (path) ->
|
||||
if json = localStorage[path]
|
||||
JSON.parse(json)
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
@@ -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')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user