mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-16 23:34:11 +00:00
Move character counter up above editor in feedback modal
This commit is contained in:
parent
4596e7a68a
commit
63cc9e5068
1 changed files with 23 additions and 23 deletions
|
@ -301,6 +301,29 @@ impl Render for FeedbackModal {
|
||||||
// TODO: Add Headline component to `ui2`
|
// TODO: Add Headline component to `ui2`
|
||||||
div().text_xl().child("Share Feedback"),
|
div().text_xl().child("Share Feedback"),
|
||||||
))
|
))
|
||||||
|
.child(
|
||||||
|
Label::new(if self.character_count < *FEEDBACK_CHAR_LIMIT.start() {
|
||||||
|
format!(
|
||||||
|
"Feedback must be at least {} characters.",
|
||||||
|
FEEDBACK_CHAR_LIMIT.start()
|
||||||
|
)
|
||||||
|
} else if self.character_count > *FEEDBACK_CHAR_LIMIT.end() {
|
||||||
|
format!(
|
||||||
|
"Feedback must be less than {} characters.",
|
||||||
|
FEEDBACK_CHAR_LIMIT.end()
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
format!(
|
||||||
|
"Characters: {}",
|
||||||
|
*FEEDBACK_CHAR_LIMIT.end() - self.character_count
|
||||||
|
)
|
||||||
|
})
|
||||||
|
.color(if valid_character_count {
|
||||||
|
Color::Success
|
||||||
|
} else {
|
||||||
|
Color::Error
|
||||||
|
}),
|
||||||
|
)
|
||||||
.child(
|
.child(
|
||||||
div()
|
div()
|
||||||
.flex_1()
|
.flex_1()
|
||||||
|
@ -313,29 +336,6 @@ impl Render for FeedbackModal {
|
||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
div()
|
div()
|
||||||
.child(
|
|
||||||
Label::new(if self.character_count < *FEEDBACK_CHAR_LIMIT.start() {
|
|
||||||
format!(
|
|
||||||
"Feedback must be at least {} characters.",
|
|
||||||
FEEDBACK_CHAR_LIMIT.start()
|
|
||||||
)
|
|
||||||
} else if self.character_count > *FEEDBACK_CHAR_LIMIT.end() {
|
|
||||||
format!(
|
|
||||||
"Feedback must be less than {} characters.",
|
|
||||||
FEEDBACK_CHAR_LIMIT.end()
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
format!(
|
|
||||||
"Characters: {}",
|
|
||||||
*FEEDBACK_CHAR_LIMIT.end() - self.character_count
|
|
||||||
)
|
|
||||||
})
|
|
||||||
.color(if valid_character_count {
|
|
||||||
Color::Success
|
|
||||||
} else {
|
|
||||||
Color::Error
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
.child(
|
.child(
|
||||||
h_stack()
|
h_stack()
|
||||||
.bg(cx.theme().colors().editor_background)
|
.bg(cx.theme().colors().editor_background)
|
||||||
|
|
Loading…
Reference in a new issue