fix: use rules instead of borders

This commit is contained in:
ByteAtATime 2025-11-30 21:35:45 -08:00
parent 7f53f27d1c
commit c32a05fd1f
No known key found for this signature in database
2 changed files with 23 additions and 23 deletions

View file

@ -1,6 +1,6 @@
use chrono::{Local, TimeZone};
use iced::widget::text::LineHeight;
use iced::widget::{column, container, image, row, scrollable, space, text};
use iced::widget::{column, container, image, row, rule, scrollable, space, text};
use iced::{Alignment, Color, Element, Length};
use crate::clipboard_history::{ClipboardContent, ClipboardEntry};
@ -56,17 +56,17 @@ pub fn render_preview_pane<'a>(
let metadata_section = container(metadata_column)
.width(Length::Fill)
.height(Length::FillPortion(2))
.padding(15)
.style(|_| container::Style {
border: iced::Border {
color: Color::from_rgba(1.0, 1.0, 1.0, 0.1),
width: 1.0,
..Default::default()
},
..Default::default()
});
.padding(15);
column![preview_section, metadata_section].into()
column![
preview_section,
rule::horizontal(1).style(|iced_theme| rule::Style {
color: theme.colors.border_10,
..rule::default(iced_theme)
}),
metadata_section
]
.into()
} else {
column![
container(text("No item selected").color(secondary_text_color))

View file

@ -1,8 +1,8 @@
use chrono::{Local, TimeZone};
use iced::keyboard::{Key, Modifiers, key::Named};
use iced::widget::scrollable::Viewport;
use iced::widget::{container, row, scrollable, text};
use iced::{Color, Element, Length, Padding, Task};
use iced::widget::{container, row, rule, scrollable, text};
use iced::{Element, Length, Padding, Task};
use std::time::{Duration, Instant};
use crate::clipboard_history::{ClipboardContent, ClipboardEntry, get_history};
@ -283,15 +283,7 @@ impl ClipboardHistoryScreen {
)
.width(Length::FillPortion(1))
.height(Length::Fill)
.padding(10)
.style(|_| container::Style {
border: iced::Border {
color: Color::from_rgba(1.0, 1.0, 1.0, 0.1),
width: 1.0,
..Default::default()
},
..Default::default()
});
.padding(10);
let right_pane_content = render_preview_pane(
self.state.selected_item(),
@ -305,7 +297,15 @@ impl ClipboardHistoryScreen {
.width(Length::FillPortion(2))
.height(Length::Fill);
row![left_pane, right_pane].into()
row![
left_pane,
rule::vertical(1).style(|iced_theme| rule::Style {
color: theme.colors.border_10,
..rule::default(iced_theme)
}),
right_pane
]
.into()
}
}