Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Inspector View #4

Open
Gurkengewuerz opened this issue May 17, 2020 · 2 comments
Open

Inspector View #4

Gurkengewuerz opened this issue May 17, 2020 · 2 comments

Comments

@Gurkengewuerz
Copy link

Hey, i was trying to create a PR for the inspector view but my problem is, as far as I understand the Ultralight API, that I cannot replace a view or create an overlay with a view using the C API.
Do you have any ideas? My idea would be to replace a pointer, but with ulOverlayGetView there is only one structure copy.

Current approach:

func (view *View) GetInspectorView() *View {
	return &View{
		v: C.ulViewCreateInspectorView(view.v),
	}
}

From the browser Example:

void Tab::ToggleInspector() {
  if (!inspector_overlay_) {
    inspector_overlay_ = Overlay::Create(ui_->window_, *view()->inspector(), 0, 0);
  } else {
    if (inspector_overlay_->is_hidden())
      inspector_overlay_->Show();
    else
      inspector_overlay_->Hide();
  }

  // Force resize to update layout
  Resize(container_width_, container_height_);
}

If there isn't any approach i already created an issue for the CAPI. ultralight-ux/Ultralight#252

@maneac
Copy link
Owner

maneac commented May 17, 2020

Hi,

Your understanding is correct. Unfortunately, as it is not currently possible to create an overlay from a view using the CAPI, there is no way to display the inspector view.

For this reason, I have omitted the creation of inspector views from this wrapper for the time being, aiming to add in the functionality when it becomes available.

@Gurkengewuerz
Copy link
Author

Alright. Lets hope @adamjs will implement this to the CAPI. 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants