Skip to content

Commit 292cba9

Browse files
committed
Allow configuration of runtime style through settings.json .
1 parent 6270688 commit 292cba9

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

main.mm

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,17 @@ void create_browser()
3939
json_value* app_settings = Settings();
4040
CefBrowserSettings browser_settings;
4141
CefWindowInfo window_info;
42-
window_info.runtime_style = CEF_RUNTIME_STYLE_ALLOY;
42+
std::string runtime_style((*app_settings)["chrome"]["runtime_style"]);
43+
if (runtime_style == "alloy") {
44+
window_info.runtime_style = CEF_RUNTIME_STYLE_ALLOY;
45+
LOG(INFO) << "Runtime style: Alloy";
46+
} else if (runtime_style == "chrome") {
47+
window_info.runtime_style = CEF_RUNTIME_STYLE_CHROME;
48+
LOG(INFO) << "Runtime style: Chrome";
49+
} else {
50+
LOG(WARNING) << "Invalid runtime style in settings.json: " << runtime_style;
51+
window_info.runtime_style = CEF_RUNTIME_STYLE_ALLOY;
52+
}
4353
int default_width = static_cast<int>(
4454
(*app_settings)["main_window"]["default_size"][0]);
4555
int default_height = static_cast<int>(

settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"log_severity": "default",
2323
"cache_path": "webcache",
2424
"remote_debugging_port": 0,
25+
"runtime_style": "alloy",
2526
"command_line_switches": {
2627
"enable-media-stream": "",
2728
"enable-system-flash": "",

0 commit comments

Comments
 (0)