Modernize application scrollbars
This commit is contained in:
@@ -335,8 +335,9 @@ fn table<'a>(surface: &'a InlineSurface, locale: UiLocale) -> Element<'a, Messag
|
||||
}
|
||||
scrollable(iced::widget::Column::with_children(body).spacing(6))
|
||||
.direction(scrollable::Direction::Horizontal(
|
||||
scrollable::Scrollbar::default(),
|
||||
inputs::compact_scrollbar(),
|
||||
))
|
||||
.style(inputs::scrollable_style)
|
||||
.into()
|
||||
}
|
||||
|
||||
|
||||
@@ -339,6 +339,8 @@ pub fn view<'a>(
|
||||
.spacing(10)
|
||||
.width(Length::Fill),
|
||||
)
|
||||
.direction(scrollable::Direction::Vertical(inputs::compact_scrollbar()))
|
||||
.style(inputs::scrollable_style)
|
||||
.anchor_bottom()
|
||||
.height(Length::Fill);
|
||||
|
||||
|
||||
@@ -174,6 +174,8 @@ pub fn view<'a>(state: &'a DashboardState, locale: UiLocale) -> Element<'a, Mess
|
||||
}
|
||||
|
||||
scrollable(container(content.padding(24).width(Length::Fill)))
|
||||
.direction(scrollable::Direction::Vertical(inputs::compact_scrollbar()))
|
||||
.style(inputs::scrollable_style)
|
||||
.width(Length::Fill)
|
||||
.height(Length::Fill)
|
||||
.into()
|
||||
|
||||
@@ -200,6 +200,8 @@ pub fn view(state: &DocumentationState, locale: UiLocale) -> Element<'_, Message
|
||||
});
|
||||
}
|
||||
scrollable(container(content).padding(2))
|
||||
.direction(scrollable::Direction::Vertical(inputs::compact_scrollbar()))
|
||||
.style(inputs::scrollable_style)
|
||||
.id(scroll_id(state.kind))
|
||||
.height(Length::Fill)
|
||||
.into()
|
||||
|
||||
@@ -170,6 +170,8 @@ pub fn view(state: &DuplicatesState, locale: UiLocale) -> Element<'_, Message> {
|
||||
);
|
||||
}
|
||||
scrollable(container(pairs).padding(2))
|
||||
.direction(scrollable::Direction::Vertical(inputs::compact_scrollbar()))
|
||||
.style(inputs::scrollable_style)
|
||||
.height(Length::Fill)
|
||||
.into()
|
||||
};
|
||||
|
||||
@@ -458,11 +458,15 @@ pub fn diff_view(
|
||||
} else {
|
||||
sections.push(muted_text(t(locale, "git.noDiff")));
|
||||
}
|
||||
container(scrollable(
|
||||
iced::widget::Column::with_children(sections)
|
||||
.spacing(12)
|
||||
.padding(16),
|
||||
))
|
||||
container(
|
||||
scrollable(
|
||||
iced::widget::Column::with_children(sections)
|
||||
.spacing(12)
|
||||
.padding(16),
|
||||
)
|
||||
.direction(scrollable::Direction::Vertical(inputs::compact_scrollbar()))
|
||||
.style(inputs::scrollable_style),
|
||||
)
|
||||
.width(Length::Fill)
|
||||
.height(Length::Fill)
|
||||
.into()
|
||||
@@ -480,6 +484,8 @@ fn code_card(label: String, contents: String, wrapping: Wrapping) -> Element<'st
|
||||
.font(Font::MONOSPACE)
|
||||
.wrapping(wrapping)
|
||||
)
|
||||
.direction(scrollable::Direction::Vertical(inputs::compact_scrollbar()))
|
||||
.style(inputs::scrollable_style)
|
||||
.height(Length::Fill),
|
||||
]
|
||||
.spacing(8)
|
||||
|
||||
@@ -259,6 +259,8 @@ pub fn view<'a>(state: &'a ImportEditorState, locale: UiLocale) -> Element<'a, M
|
||||
.padding(16)
|
||||
.width(Length::Fill),
|
||||
)
|
||||
.direction(scrollable::Direction::Vertical(inputs::compact_scrollbar()))
|
||||
.style(inputs::scrollable_style)
|
||||
.height(Length::Fill)
|
||||
.into()
|
||||
}
|
||||
|
||||
@@ -540,7 +540,9 @@ pub fn view<'a>(
|
||||
.spacing(12)
|
||||
.padding(16)
|
||||
.width(Length::Fill),
|
||||
);
|
||||
)
|
||||
.direction(scrollable::Direction::Vertical(inputs::compact_scrollbar()))
|
||||
.style(inputs::scrollable_style);
|
||||
|
||||
container(body)
|
||||
.width(Length::Fill)
|
||||
|
||||
@@ -777,6 +777,8 @@ pub fn view(state: &MenuEditorState, locale: UiLocale) -> Element<'_, Message> {
|
||||
centered_status(locale, "menuEditor.empty")
|
||||
} else {
|
||||
scrollable(tree_view(state, locale))
|
||||
.direction(scrollable::Direction::Vertical(inputs::compact_scrollbar()))
|
||||
.style(inputs::scrollable_style)
|
||||
.height(Length::Fill)
|
||||
.into()
|
||||
}
|
||||
|
||||
@@ -136,11 +136,15 @@ pub fn view<'a>(state: &'a MetadataDiffState, locale: UiLocale) -> Element<'a, M
|
||||
content = content.push(message_card(t(locale, "metadataDiff.idle")));
|
||||
}
|
||||
|
||||
container(scrollable(content))
|
||||
.width(Length::Fill)
|
||||
.height(Length::Fill)
|
||||
.padding(24)
|
||||
.into()
|
||||
container(
|
||||
scrollable(content)
|
||||
.direction(scrollable::Direction::Vertical(inputs::compact_scrollbar()))
|
||||
.style(inputs::scrollable_style),
|
||||
)
|
||||
.width(Length::Fill)
|
||||
.height(Length::Fill)
|
||||
.padding(24)
|
||||
.into()
|
||||
}
|
||||
|
||||
fn message_card(value: String) -> Element<'static, Message> {
|
||||
|
||||
@@ -1196,7 +1196,10 @@ pub fn view(
|
||||
let content = column![
|
||||
title,
|
||||
Space::with_height(12.0),
|
||||
scrollable(column(rows).spacing(8)).height(Length::Fixed(320.0)),
|
||||
scrollable(column(rows).spacing(8))
|
||||
.direction(scrollable::Direction::Vertical(inputs::compact_scrollbar()))
|
||||
.style(inputs::scrollable_style)
|
||||
.height(Length::Fixed(320.0)),
|
||||
Space::with_height(16.0),
|
||||
buttons,
|
||||
]
|
||||
|
||||
@@ -256,6 +256,8 @@ pub fn view(
|
||||
.spacing(4)
|
||||
.padding(8),
|
||||
)
|
||||
.direction(scrollable::Direction::Vertical(inputs::compact_scrollbar()))
|
||||
.style(inputs::scrollable_style)
|
||||
.into()
|
||||
}
|
||||
}
|
||||
@@ -285,6 +287,8 @@ pub fn view(
|
||||
.spacing(2)
|
||||
.padding(8),
|
||||
)
|
||||
.direction(scrollable::Direction::Vertical(inputs::compact_scrollbar()))
|
||||
.style(inputs::scrollable_style)
|
||||
.into()
|
||||
}
|
||||
}
|
||||
@@ -347,6 +351,8 @@ pub fn view(
|
||||
.spacing(4)
|
||||
.padding(8),
|
||||
)
|
||||
.direction(scrollable::Direction::Vertical(inputs::compact_scrollbar()))
|
||||
.style(inputs::scrollable_style)
|
||||
.into()
|
||||
}
|
||||
}
|
||||
@@ -388,6 +394,8 @@ pub fn view(
|
||||
.spacing(2)
|
||||
.padding(8),
|
||||
)
|
||||
.direction(scrollable::Direction::Vertical(inputs::compact_scrollbar()))
|
||||
.style(inputs::scrollable_style)
|
||||
.into()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -969,6 +969,8 @@ pub fn view<'a>(
|
||||
.spacing(8)
|
||||
.width(Length::Fill),
|
||||
)
|
||||
.direction(scrollable::Direction::Vertical(inputs::compact_scrollbar()))
|
||||
.style(inputs::scrollable_style)
|
||||
.height(Length::Shrink);
|
||||
|
||||
// ── Full layout: top pane (shrink), editor (fill), footer (shrink) ──
|
||||
|
||||
@@ -260,6 +260,8 @@ pub fn view<'a>(state: &'a ScriptEditorState, locale: UiLocale) -> Element<'a, M
|
||||
.width(Length::Fill),
|
||||
);
|
||||
let top_pane = scrollable(column![header, metadata].spacing(12).width(Length::Fill))
|
||||
.direction(scrollable::Direction::Vertical(inputs::compact_scrollbar()))
|
||||
.style(inputs::scrollable_style)
|
||||
.height(Length::Shrink);
|
||||
|
||||
// Full layout: top pane (shrink), content (fill), validation + footer (shrink)
|
||||
|
||||
@@ -421,6 +421,8 @@ pub fn view<'a>(state: &'a SettingsViewState, locale: UiLocale) -> Element<'a, M
|
||||
.padding(16)
|
||||
.width(Length::Fill),
|
||||
)
|
||||
.direction(scrollable::Direction::Vertical(inputs::compact_scrollbar()))
|
||||
.style(inputs::scrollable_style)
|
||||
.width(Length::Fill)
|
||||
.height(Length::Fill);
|
||||
|
||||
|
||||
@@ -1254,11 +1254,15 @@ pub fn view(
|
||||
.padding(12);
|
||||
|
||||
// layout.allium: sidebar width is resizable, passed as parameter
|
||||
container(scrollable(content))
|
||||
.width(Length::Fixed(width))
|
||||
.height(Length::Fill)
|
||||
.style(sidebar_style)
|
||||
.into()
|
||||
container(
|
||||
scrollable(content)
|
||||
.direction(scrollable::Direction::Vertical(inputs::compact_scrollbar()))
|
||||
.style(inputs::scrollable_style),
|
||||
)
|
||||
.width(Length::Fixed(width))
|
||||
.height(Length::Fill)
|
||||
.style(sidebar_style)
|
||||
.into()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -131,15 +131,19 @@ pub fn view<'a>(state: &'a SiteValidationState, locale: UiLocale) -> Element<'a,
|
||||
}
|
||||
}
|
||||
|
||||
container(scrollable(content))
|
||||
.width(Length::Fill)
|
||||
.height(Length::Fill)
|
||||
.padding(24)
|
||||
.style(|_theme: &Theme| container::Style {
|
||||
background: Some(Background::Color(Color::from_rgb(0.11, 0.11, 0.14))),
|
||||
..container::Style::default()
|
||||
})
|
||||
.into()
|
||||
container(
|
||||
scrollable(content)
|
||||
.direction(scrollable::Direction::Vertical(inputs::compact_scrollbar()))
|
||||
.style(inputs::scrollable_style),
|
||||
)
|
||||
.width(Length::Fill)
|
||||
.height(Length::Fill)
|
||||
.padding(24)
|
||||
.style(|_theme: &Theme| container::Style {
|
||||
background: Some(Background::Color(Color::from_rgb(0.11, 0.11, 0.14))),
|
||||
..container::Style::default()
|
||||
})
|
||||
.into()
|
||||
}
|
||||
|
||||
fn help_text<'a>(value: String) -> Element<'a, Message> {
|
||||
|
||||
@@ -287,6 +287,8 @@ fn view_cloud<'a>(state: &'a TagsViewState, locale: UiLocale) -> Element<'a, Mes
|
||||
)]
|
||||
.padding(16),
|
||||
)
|
||||
.direction(scrollable::Direction::Vertical(inputs::compact_scrollbar()))
|
||||
.style(inputs::scrollable_style)
|
||||
.width(Length::Fill)
|
||||
.height(Length::Fill)
|
||||
.into()
|
||||
@@ -457,6 +459,8 @@ fn view_manage<'a>(state: &'a TagsViewState, locale: UiLocale) -> Element<'a, Me
|
||||
.padding(16)
|
||||
.width(Length::Fill),
|
||||
)
|
||||
.direction(scrollable::Direction::Vertical(inputs::compact_scrollbar()))
|
||||
.style(inputs::scrollable_style)
|
||||
.width(Length::Fill)
|
||||
.height(Length::Fill)
|
||||
.into()
|
||||
|
||||
@@ -224,6 +224,8 @@ pub fn view<'a>(state: &'a TemplateEditorState, locale: UiLocale) -> Element<'a,
|
||||
.width(Length::Fill),
|
||||
);
|
||||
let top_pane = scrollable(column![header, metadata].spacing(12).width(Length::Fill))
|
||||
.direction(scrollable::Direction::Vertical(inputs::compact_scrollbar()))
|
||||
.style(inputs::scrollable_style)
|
||||
.height(Length::Shrink);
|
||||
|
||||
// Full layout: top pane (shrink), content (fill), validation + footer (shrink)
|
||||
|
||||
@@ -59,11 +59,15 @@ pub fn view<'a>(state: &'a TranslationValidationState, locale: UiLocale) -> Elem
|
||||
content = content.push(message_card(t(locale, "translationValidation.idle")));
|
||||
}
|
||||
|
||||
container(scrollable(content))
|
||||
.width(Length::Fill)
|
||||
.height(Length::Fill)
|
||||
.padding(24)
|
||||
.into()
|
||||
container(
|
||||
scrollable(content)
|
||||
.direction(scrollable::Direction::Vertical(inputs::compact_scrollbar()))
|
||||
.style(inputs::scrollable_style),
|
||||
)
|
||||
.width(Length::Fill)
|
||||
.height(Length::Fill)
|
||||
.padding(24)
|
||||
.into()
|
||||
}
|
||||
|
||||
fn issue_section<'a>(
|
||||
|
||||
Reference in New Issue
Block a user