mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-13 08:44:12 +03:00
A hack to get DevTools showing properly
This commit is contained in:
parent
e9532ff01a
commit
4b8b4ef91c
@ -106,13 +106,19 @@
|
||||
_devToolsView = [[NSView alloc] initWithFrame:_splitView.bounds];
|
||||
[_splitView addSubview:_devToolsView];
|
||||
[_splitView adjustSubviews];
|
||||
|
||||
_cefDevToolsClient = new AtomCefClient();
|
||||
std::string devtools_url = _cefClient->GetBrowser()->GetHost()->GetDevToolsURL(true);
|
||||
[self addBrowserToView:_devToolsView url:devtools_url.c_str() cefHandler:_cefDevToolsClient];
|
||||
[self performSelector:@selector(attachDevTools) withObject:nil afterDelay:0];
|
||||
}
|
||||
}
|
||||
|
||||
// If this is run directly after adding _devToolsView to _splitView, the
|
||||
// devtools don't resize properly.
|
||||
// HACK: I hate this and want to place this code directly in showDevTools
|
||||
- (void)attachDevTools {
|
||||
_cefDevToolsClient = new AtomCefClient();
|
||||
std::string devtools_url = _cefClient->GetBrowser()->GetHost()->GetDevToolsURL(true);
|
||||
[self addBrowserToView:_devToolsView url:devtools_url.c_str() cefHandler:_cefDevToolsClient];
|
||||
}
|
||||
|
||||
- (void)hideDevTools {
|
||||
[_devToolsView removeFromSuperview];
|
||||
[_splitView adjustSubviews];
|
||||
|
Loading…
Reference in New Issue
Block a user