Merge branch 'upstream' into simplify-native-core
This commit is contained in:
commit
fb0c6c1b62
26 files changed
+609
-253
No files matched your search
@@ -1,6 +1,8 @@
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use dioxus_native_core::layout_attributes::apply_layout_attributes;
|
||||
use dioxus_native_core::layout_attributes::{
|
||||
apply_layout_attributes_cfg, BorderWidths, LayoutConfigeration,
|
||||
};
|
||||
use dioxus_native_core::node::OwnedAttributeView;
|
||||
use dioxus_native_core::node_ref::{AttributeMask, NodeMask, NodeView};
|
||||
use dioxus_native_core::{Pass, SendAnyMap};
|
||||
@@ -101,7 +103,18 @@ impl Pass for TaffyLayout {
|
||||
.binary_search(&attribute.name.as_ref())
|
||||
.is_ok());
|
||||
if let Some(text) = value.as_text() {
|
||||
apply_layout_attributes(&attribute.name, text, &mut style);
|
||||
apply_layout_attributes_cfg(
|
||||
&attribute.name,
|
||||
text,
|
||||
&mut style,
|
||||
&LayoutConfigeration {
|
||||
border_widths: BorderWidths {
|
||||
thin: 1.0,
|
||||
medium: 1.0,
|
||||
thick: 1.0,
|
||||
},
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,8 +40,8 @@ pub(crate) fn NumbericInput<'a>(cx: Scope<'a, NumbericInputProps>) -> Element<'a
|
||||
let dragging = use_state(cx, || false);
|
||||
|
||||
let text = text_ref.read().clone();
|
||||
let start_highlight = cursor.read().first().idx(&text);
|
||||
let end_highlight = cursor.read().last().idx(&text);
|
||||
let start_highlight = cursor.read().first().idx(&*text);
|
||||
let end_highlight = cursor.read().last().idx(&*text);
|
||||
let (text_before_first_cursor, text_after_first_cursor) = text.split_at(start_highlight);
|
||||
let (text_highlighted, text_after_second_cursor) =
|
||||
text_after_first_cursor.split_at(end_highlight - start_highlight);
|
||||
@@ -113,7 +113,7 @@ pub(crate) fn NumbericInput<'a>(cx: Scope<'a, NumbericInputProps>) -> Element<'a
|
||||
};
|
||||
if is_text{
|
||||
let mut text = text_ref.write();
|
||||
cursor.write().handle_input(&k, &mut text, max_len);
|
||||
cursor.write().handle_input(&k, &mut *text, max_len);
|
||||
update(text.clone());
|
||||
|
||||
let node = tui_query.get(get_root_id(cx).unwrap());
|
||||
@@ -165,7 +165,7 @@ pub(crate) fn NumbericInput<'a>(cx: Scope<'a, NumbericInputProps>) -> Element<'a
|
||||
}
|
||||
new.row = 0;
|
||||
|
||||
new.realize_col(&text_ref.read());
|
||||
new.realize_col(text_ref.read().as_str());
|
||||
cursor.set(Cursor::from_start(new));
|
||||
dragging.set(true);
|
||||
let node = tui_query_clone.get(get_root_id(cx).unwrap());
|
||||
|
||||
@@ -40,8 +40,8 @@ pub(crate) fn Password<'a>(cx: Scope<'a, PasswordProps>) -> Element<'a> {
|
||||
let dragging = use_state(cx, || false);
|
||||
|
||||
let text = text_ref.read().clone();
|
||||
let start_highlight = cursor.read().first().idx(&text);
|
||||
let end_highlight = cursor.read().last().idx(&text);
|
||||
let start_highlight = cursor.read().first().idx(&*text);
|
||||
let end_highlight = cursor.read().last().idx(&*text);
|
||||
let (text_before_first_cursor, text_after_first_cursor) = text.split_at(start_highlight);
|
||||
let (text_highlighted, text_after_second_cursor) =
|
||||
text_after_first_cursor.split_at(end_highlight - start_highlight);
|
||||
@@ -88,7 +88,7 @@ pub(crate) fn Password<'a>(cx: Scope<'a, PasswordProps>) -> Element<'a> {
|
||||
return;
|
||||
}
|
||||
let mut text = text_ref.write();
|
||||
cursor.write().handle_input(&k, &mut text, max_len);
|
||||
cursor.write().handle_input(&k, &mut *text, max_len);
|
||||
if let Some(input_handler) = &cx.props.raw_oninput {
|
||||
input_handler.call(FormData {
|
||||
value: text.clone(),
|
||||
@@ -147,7 +147,7 @@ pub(crate) fn Password<'a>(cx: Scope<'a, PasswordProps>) -> Element<'a> {
|
||||
// textboxs are only one line tall
|
||||
new.row = 0;
|
||||
|
||||
new.realize_col(&text_ref.read());
|
||||
new.realize_col(text_ref.read().as_str());
|
||||
cursor.set(Cursor::from_start(new));
|
||||
dragging.set(true);
|
||||
let node = tui_query_clone.get(get_root_id(cx).unwrap());
|
||||
|
||||
@@ -40,8 +40,8 @@ pub(crate) fn TextBox<'a>(cx: Scope<'a, TextBoxProps>) -> Element<'a> {
|
||||
let dragging = use_state(cx, || false);
|
||||
|
||||
let text = text_ref.read().clone();
|
||||
let start_highlight = cursor.read().first().idx(&text);
|
||||
let end_highlight = cursor.read().last().idx(&text);
|
||||
let start_highlight = cursor.read().first().idx(&*text);
|
||||
let end_highlight = cursor.read().last().idx(&*text);
|
||||
let (text_before_first_cursor, text_after_first_cursor) = text.split_at(start_highlight);
|
||||
let (text_highlighted, text_after_second_cursor) =
|
||||
text_after_first_cursor.split_at(end_highlight - start_highlight);
|
||||
@@ -90,7 +90,7 @@ pub(crate) fn TextBox<'a>(cx: Scope<'a, TextBoxProps>) -> Element<'a> {
|
||||
return;
|
||||
}
|
||||
let mut text = text_ref.write();
|
||||
cursor.write().handle_input(&k, &mut text, max_len);
|
||||
cursor.write().handle_input(&k, &mut *text, max_len);
|
||||
if let Some(input_handler) = &cx.props.raw_oninput{
|
||||
input_handler.call(FormData{
|
||||
value: text.clone(),
|
||||
@@ -138,7 +138,7 @@ pub(crate) fn TextBox<'a>(cx: Scope<'a, TextBoxProps>) -> Element<'a> {
|
||||
// textboxs are only one line tall
|
||||
new.row = 0;
|
||||
|
||||
new.realize_col(&text_ref.read());
|
||||
new.realize_col(text_ref.read().as_str());
|
||||
cursor.set(Cursor::from_start(new));
|
||||
dragging.set(true);
|
||||
let node = tui_query_clone.get(get_root_id(cx).unwrap());
|
||||
|
||||
Reference in new issue
Block a user