Add an input example to gpui (#13534)
Add a single-line text input example to gpui (I'm hoping to be able to debug keyboard issues without rebuilding the whole app every time) Release Notes: - N/A
This commit is contained in:
parent
eb914682b3
commit
b43df6048b
5 changed files with 503 additions and 3 deletions
|
@ -1672,9 +1672,13 @@ extern "C" fn first_rect_for_character_range(
|
|||
range: NSRange,
|
||||
_: id,
|
||||
) -> NSRect {
|
||||
let frame = unsafe {
|
||||
let window = get_window_state(this).lock().native_window;
|
||||
NSView::frame(window)
|
||||
let frame: NSRect = unsafe {
|
||||
let state = get_window_state(this);
|
||||
let lock = state.lock();
|
||||
let mut frame = NSWindow::frame(lock.native_window);
|
||||
let content_layout_rect: CGRect = msg_send![lock.native_window, contentLayoutRect];
|
||||
frame.origin.y -= frame.size.height - content_layout_rect.size.height;
|
||||
frame
|
||||
};
|
||||
with_input_handler(this, |input_handler| {
|
||||
input_handler.bounds_for_range(range.to_range()?)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue