mirror of
https://github.com/atom/atom.git
synced 2026-02-15 17:15:24 -05:00
Add support for requiring a platform-specific stylesheet
Add a getPlatform method to the native object that is used for requiring the platform stylesheet from within window.coffee after the atom.css is required. This is used to provide non-native scrollbars on Linux for an improved look and feel.
This commit is contained in:
@@ -33,7 +33,7 @@ void throwException(const CefRefPtr<CefV8Value>& global, CefRefPtr<CefV8Exceptio
|
||||
NativeHandler::NativeHandler() : CefV8Handler() {
|
||||
std::string extensionCode = "var $native = {}; (function() {";
|
||||
|
||||
const char *functionNames[] = {"exists", "alert", "read", "write", "absolute", "list", "isFile", "isDirectory", "remove", "asyncList", "open", "openDialog", "quit", "writeToPasteboard", "readFromPasteboard", "showDevTools", "toggleDevTools", "newWindow", "saveDialog", "exit", "watchPath", "unwatchPath", "makeDirectory", "move", "moveToTrash", "reload", "lastModified", "md5ForPath", "exec"};
|
||||
const char *functionNames[] = {"exists", "alert", "read", "write", "absolute", "list", "isFile", "isDirectory", "remove", "asyncList", "open", "openDialog", "quit", "writeToPasteboard", "readFromPasteboard", "showDevTools", "toggleDevTools", "newWindow", "saveDialog", "exit", "watchPath", "unwatchPath", "makeDirectory", "move", "moveToTrash", "reload", "lastModified", "md5ForPath", "exec", "getPlatform"};
|
||||
NSUInteger arrayLength = sizeof(functionNames) / sizeof(const char *);
|
||||
for (NSUInteger i = 0; i < arrayLength; i++) {
|
||||
std::string functionName = std::string(functionNames[i]);
|
||||
@@ -525,5 +525,11 @@ bool NativeHandler::Execute(const CefString& name,
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (name == "getPlatform") {
|
||||
NSString *platform = @"mac";
|
||||
retval = CefV8Value::CreateString([platform UTF8String]);
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
Reference in New Issue
Block a user