Skip to content

Commit

Permalink
Allow opening of child windows
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusTomlinson committed Jun 16, 2024
1 parent 8a391b0 commit b77a97c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "subprojects/choc"]
path = subprojects/choc
url = https://github.com/cross-platform/choc.git
branch = fork
branch = chip
1 change: 1 addition & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"preLaunchTask": "Build",
"program": "${workspaceFolder}/build/icloud-for-linux",
"args": ["notes", "Notes"],
"environment": [{"name":"TMPDIR","value":"${workspaceFolder}/build"}],
"cwd": "${workspaceFolder}",
"request": "launch",
"type": "cppdbg",
Expand Down
3 changes: 2 additions & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: icloud-for-linux
version: '0.15'
version: '0.16'
summary: iCloud for Linux
description: iCloud for Linux

Expand Down Expand Up @@ -28,6 +28,7 @@ apps:
- network-status
- opengl
- screen-inhibit-control
- wayland
- x11
environment: &environment
TMPDIR: $XDG_RUNTIME_DIR
Expand Down
15 changes: 15 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,21 @@ int main(int, char **argv)
appWin.setContent(webView.getViewHandle());
appWin.toFront();

webView.onNewWindow( [&](const std::string& url)
{
choc::ui::DesktopWindow appWin(choc::ui::Bounds{0, 0, 0, 0});
appWin.centreWithSize(1000, 600);
appWin.setWindowTitle( "iCloud " + std::string(argv[2]) + "" );

choc::ui::WebView webView;
webView.navigate(url);

appWin.setContent(webView.getViewHandle());
appWin.toFront();

return appWin.getWindowHandle();
});

choc::messageloop::run();
return 0;
}
2 changes: 1 addition & 1 deletion subprojects/choc
Submodule choc updated 1 files
+25 −0 gui/choc_WebView.h

0 comments on commit b77a97c

Please sign in to comment.