mirror of
https://github.com/project-gauntlet/gauntlet.git
synced 2025-12-23 10:35:53 +00:00
Fix padding on grid component after dependency updates
This commit is contained in:
parent
29b1a4ab36
commit
2afecf3b80
3 changed files with 19 additions and 6 deletions
|
|
@ -61,6 +61,7 @@ pub enum ContainerStyle {
|
|||
RootTopPanel,
|
||||
Grid,
|
||||
GridInner,
|
||||
GridSection,
|
||||
List,
|
||||
ListInner,
|
||||
TextAccessory,
|
||||
|
|
@ -377,6 +378,7 @@ impl<'a, Message: 'a> ThemableWidget<'a, Message> for Container<'a, Message, Gau
|
|||
ContainerStyle::FormInner => self.padding(theme.form_inner.padding.to_iced()),
|
||||
ContainerStyle::GridInner => self.padding(theme.grid_inner.padding.to_iced()),
|
||||
ContainerStyle::Grid => self.padding(theme.grid.padding.to_iced()),
|
||||
ContainerStyle::GridSection => self.padding(theme.grid_section.padding.to_iced()),
|
||||
ContainerStyle::List => self.padding(theme.list.padding.to_iced()),
|
||||
ContainerStyle::ListInner => self.padding(theme.list_inner.padding.to_iced()),
|
||||
ContainerStyle::RootBottomPanelActionToggleText => {
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ pub struct GauntletComplexTheme {
|
|||
grid_item: ThemeButton,
|
||||
grid_item_title: ThemePaddingTextColor,
|
||||
grid_item_subtitle: ThemeTextColor,
|
||||
grid_section: ThemePaddingOnly,
|
||||
grid_section_title: ThemePaddingTextColorSpacing,
|
||||
grid_section_subtitle: ThemeTextColor,
|
||||
inline: ThemePaddingOnly,
|
||||
|
|
@ -438,8 +439,11 @@ impl GauntletComplexTheme {
|
|||
spacing: 8.0,
|
||||
},
|
||||
list_section_subtitle: ThemeTextColor { text_color: text_300 },
|
||||
grid_section: ThemePaddingOnly {
|
||||
padding: padding(0.0, 0.0, 16.0, 0.0),
|
||||
},
|
||||
grid_section_title: ThemePaddingTextColorSpacing {
|
||||
padding: padding(12.0, 0.0, 4.0, 0.0),
|
||||
padding: padding(4.0, 0.0, 4.0, 0.0),
|
||||
text_color: text_200,
|
||||
spacing: 8.0,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -64,8 +64,12 @@ impl<'b> ComponentWidgets<'b> {
|
|||
}
|
||||
GridWidgetOrderedMembers::GridSection(widget) => {
|
||||
if !pending.is_empty() {
|
||||
let content =
|
||||
self.render_grid(&pending, &grid_widget.columns, focused_item.index, index_counter);
|
||||
let content = self.render_grid_section(
|
||||
&pending,
|
||||
&grid_widget.columns,
|
||||
focused_item.index,
|
||||
index_counter,
|
||||
);
|
||||
|
||||
items.push(content);
|
||||
|
||||
|
|
@ -85,7 +89,8 @@ impl<'b> ComponentWidgets<'b> {
|
|||
}
|
||||
|
||||
if !pending.is_empty() {
|
||||
let content = self.render_grid(&pending, &grid_widget.columns, focused_item.index, index_counter);
|
||||
let content =
|
||||
self.render_grid_section(&pending, &grid_widget.columns, focused_item.index, index_counter);
|
||||
|
||||
items.push(content);
|
||||
}
|
||||
|
|
@ -138,7 +143,7 @@ impl<'b> ComponentWidgets<'b> {
|
|||
})
|
||||
.collect();
|
||||
|
||||
let content = self.render_grid(&items, &widget.columns, item_focus_index, index_counter);
|
||||
let content = self.render_grid_section(&items, &widget.columns, item_focus_index, index_counter);
|
||||
|
||||
let section_title_style = if first_section {
|
||||
RowStyle::GridFirstSectionTitle
|
||||
|
|
@ -240,7 +245,7 @@ impl<'b> ComponentWidgets<'b> {
|
|||
content
|
||||
}
|
||||
|
||||
fn render_grid<'a>(
|
||||
fn render_grid_section<'a>(
|
||||
&self,
|
||||
items: &[&GridItemWidget],
|
||||
/*aspect_ratio: Option<&str>,*/
|
||||
|
|
@ -273,6 +278,8 @@ impl<'b> ComponentWidgets<'b> {
|
|||
|
||||
let grid = grid(rows).columns(columns).themed(GridStyle::Default);
|
||||
|
||||
let grid = container(grid).themed(ContainerStyle::GridSection);
|
||||
|
||||
grid
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue