go-ultralight icon indicating copy to clipboard operation
go-ultralight copied to clipboard

Inspector View

Open Gurkengewuerz opened this issue 4 years ago • 2 comments

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. https://github.com/ultralight-ux/Ultralight/issues/252

Gurkengewuerz avatar May 17 '20 14:05 Gurkengewuerz