Skip to content

Commit

Permalink
add hint for file size filter
Browse files Browse the repository at this point in the history
  • Loading branch information
B0ney committed Nov 5, 2023
1 parent f3abd6e commit 6190bc5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions data/src/config/filters/size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ impl std::fmt::Display for Modifier {
f,
"{}",
match self {
Modifier::B => "Bytes",
Modifier::KB => "KiloBytes",
Modifier::MB => "MegaBytes",
Modifier::B => "bytes",
Modifier::KB => "KB",
Modifier::MB => "MB",
}
)
}
Expand Down
10 changes: 6 additions & 4 deletions src/screen/config/custom_filters/file_size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::widget::helpers::control;
use crate::theme::TextInputStyle;
use crate::widget::Element;
use data::config::filters::{size::Modifier, Size};
use iced::widget::{column, pick_list, row, slider, text_input};
use iced::widget::{column, pick_list, row, slider, text_input, text, horizontal_rule};

#[derive(Debug, Clone, Copy)]
pub enum Message {
Expand All @@ -18,7 +18,7 @@ pub enum Message {
pub fn view<'a>(filter: &Size) -> Element<'a, Message> {
let settings = column![
row![
"MIN:",
"Min:",
text_input("", &format!("{}", filter.min)).on_input(|input| {
if input.is_empty() {
return Message::SetMin(0);
Expand All @@ -34,7 +34,7 @@ pub fn view<'a>(filter: &Size) -> Element<'a, Message> {
.spacing(8)
.align_items(iced::Alignment::Center),
row![
"MAX:",
"Max:",
text_input("", &format!("{}", filter.max)).on_input(|input| {
if input.is_empty() {
return Message::SetMax(0);
Expand All @@ -49,7 +49,9 @@ pub fn view<'a>(filter: &Size) -> Element<'a, Message> {
pick_list(Modifier::ALL, Some(filter.max_modifier), Message::SetMaxModifier)
]
.spacing(8)
.align_items(iced::Alignment::Center)
.align_items(iced::Alignment::Center),
horizontal_rule(1),
text("Hint: 1000 bytes = 1 KB, 1000 KB = 1 MB"),
]
.spacing(8);
control("File Size", settings).into()
Expand Down

0 comments on commit 6190bc5

Please sign in to comment.