generated from PlexSheep/rs-base
feat(player): somewhat of a album view
This commit is contained in:
parent
1e38e17f36
commit
22dbfdd193
|
@ -101,19 +101,17 @@ impl Player {
|
|||
}
|
||||
|
||||
fn main_panel(&mut self, ui: &mut egui::Ui, ctx: &egui::Context) {
|
||||
let tb = TableBuilder::new(ui)
|
||||
.column(Column::remainder())
|
||||
.column(Column::remainder())
|
||||
.column(Column::remainder())
|
||||
.column(Column::remainder())
|
||||
.column(Column::remainder())
|
||||
.column(Column::remainder())
|
||||
.column(Column::remainder())
|
||||
.column(Column::remainder());
|
||||
let mut tb = TableBuilder::new(ui);
|
||||
|
||||
let entries_per_line: usize = ctx.screen_rect().width() as usize / 256;
|
||||
|
||||
for _ in 0..entries_per_line {
|
||||
tb = tb.column(Column::remainder());
|
||||
}
|
||||
|
||||
tb.body(|mut body| {
|
||||
for line in self.entries().chunks(8) {
|
||||
body.row(30.0, |mut row| {
|
||||
for line in self.entries().chunks(entries_per_line) {
|
||||
body.row(240.0, |mut row| {
|
||||
for e in line {
|
||||
row.col(|ui| {
|
||||
ui.add(ShowBox::new(e));
|
||||
|
|
|
@ -19,16 +19,24 @@ impl ShowBox {
|
|||
|
||||
impl egui::Widget for ShowBox {
|
||||
fn ui(mut self, ui: &mut egui::Ui) -> egui::Response {
|
||||
ui.vertical_centered(|ui| {
|
||||
ui.add(
|
||||
egui::Image::new(ImageSource::Bytes {
|
||||
uri: std::borrow::Cow::Borrowed("fuck you"),
|
||||
bytes: egui::load::Bytes::Static(ICON_RAW),
|
||||
egui::Frame::none()
|
||||
.fill(Color32::GRAY)
|
||||
.show(ui, |ui| {
|
||||
ui.label("Label with red background");
|
||||
ui.vertical_centered(|ui| {
|
||||
ui.add(
|
||||
egui::Image::new(ImageSource::Bytes {
|
||||
uri: std::borrow::Cow::Borrowed("fuck you"),
|
||||
bytes: egui::load::Bytes::Static(ICON_RAW),
|
||||
})
|
||||
.rounding(5.0)
|
||||
.bg_fill(Color32::DARK_GRAY)
|
||||
.shrink_to_fit()
|
||||
.maintain_aspect_ratio(true),
|
||||
);
|
||||
ui.button("i dont get it").union(ui.label("caption"))
|
||||
})
|
||||
.rounding(5.0),
|
||||
);
|
||||
ui.button("i dont get it").union(ui.label("caption"))
|
||||
})
|
||||
.response
|
||||
})
|
||||
.response
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue