chore: Rename outline styled method to focused_border. (#635)
This change to avoid conflict with `outline` method in Button. ## Break changes: - The `outline` method in `StyledExt` now renamed to `focused_border`.
This commit is contained in:
parent
d96b4b44d2
commit
4c554580c9
5 changed files with 6 additions and 6 deletions
|
|
@ -658,7 +658,7 @@ where
|
||||||
Length::Definite(l) => this.flex_none().w(l),
|
Length::Definite(l) => this.flex_none().w(l),
|
||||||
Length::Auto => this.w_full(),
|
Length::Auto => this.w_full(),
|
||||||
})
|
})
|
||||||
.when(outline_visible, |this| this.outline(cx))
|
.when(outline_visible, |this| this.focusd_border(cx))
|
||||||
.input_size(self.size)
|
.input_size(self.size)
|
||||||
.when(allow_open, |this| {
|
.when(allow_open, |this| {
|
||||||
this.on_click(cx.listener(Self::toggle_menu))
|
this.on_click(cx.listener(Self::toggle_menu))
|
||||||
|
|
|
||||||
|
|
@ -1649,7 +1649,7 @@ impl Render for TextInput {
|
||||||
.border_1()
|
.border_1()
|
||||||
.rounded(cx.theme().radius)
|
.rounded(cx.theme().radius)
|
||||||
.when(cx.theme().shadow, |this| this.shadow_sm())
|
.when(cx.theme().shadow, |this| this.shadow_sm())
|
||||||
.when(focused, |this| this.outline(cx))
|
.when(focused, |this| this.focusd_border(cx))
|
||||||
})
|
})
|
||||||
.when(prefix.is_none(), |this| this.input_pl(self.size))
|
.when(prefix.is_none(), |this| this.input_pl(self.size))
|
||||||
.when(suffix.is_none(), |this| this.input_pr(self.size))
|
.when(suffix.is_none(), |this| this.input_pr(self.size))
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ use crate::{
|
||||||
button::{Button, ButtonVariants as _},
|
button::{Button, ButtonVariants as _},
|
||||||
h_flex,
|
h_flex,
|
||||||
input::{InputEvent, TextInput},
|
input::{InputEvent, TextInput},
|
||||||
ActiveTheme, IconName, Sizable, Size, StyleSized, StyledExt,
|
ActiveTheme, IconName, Sizable, Size, StyleSized, StyledExt as _,
|
||||||
};
|
};
|
||||||
|
|
||||||
actions!(number_input, [Increment, Decrement]);
|
actions!(number_input, [Increment, Decrement]);
|
||||||
|
|
@ -182,7 +182,7 @@ impl Render for NumberInput {
|
||||||
.border_color(cx.theme().input)
|
.border_color(cx.theme().input)
|
||||||
.border_1()
|
.border_1()
|
||||||
.rounded(cx.theme().radius)
|
.rounded(cx.theme().radius)
|
||||||
.when(focused, |this| this.outline(cx))
|
.when(focused, |this| this.focusd_border(cx))
|
||||||
.child(
|
.child(
|
||||||
Button::new("minus")
|
Button::new("minus")
|
||||||
.ghost()
|
.ghost()
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ pub trait StyledExt: Styled + Sized {
|
||||||
|
|
||||||
/// Render a border with a width of 1px, color ring color
|
/// Render a border with a width of 1px, color ring color
|
||||||
#[inline]
|
#[inline]
|
||||||
fn outline(self, cx: &App) -> Self {
|
fn focusd_border(self, cx: &App) -> Self {
|
||||||
self.border_color(cx.theme().ring)
|
self.border_color(cx.theme().ring)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -325,7 +325,7 @@ impl Render for DatePicker {
|
||||||
.cursor_pointer()
|
.cursor_pointer()
|
||||||
.overflow_hidden()
|
.overflow_hidden()
|
||||||
.input_text_size(self.size)
|
.input_text_size(self.size)
|
||||||
.when(is_focused, |this| this.outline(cx))
|
.when(is_focused, |this| this.focusd_border(cx))
|
||||||
.input_size(self.size)
|
.input_size(self.size)
|
||||||
.when(!self.open, |this| {
|
.when(!self.open, |this| {
|
||||||
this.on_click(cx.listener(Self::toggle_calendar))
|
this.on_click(cx.listener(Self::toggle_calendar))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue