Compare commits

..

No commits in common. "b4667faf5d1da8d54fbe2e7869f9009c4edc0072" and "734b39945eaf803d0e6fb0c50af3f0e008a98954" have entirely different histories.

5 changed files with 7 additions and 86 deletions

View file

@ -21,7 +21,6 @@ anyhow = "1.0.86"
clap = { version = "4.5.16", features = ["derive"] } clap = { version = "4.5.16", features = ["derive"] }
eframe = { version = "0.28.1", optional = false } eframe = { version = "0.28.1", optional = false }
egui = { version = "0.28.1", optional = false } egui = { version = "0.28.1", optional = false }
egui_extras = { version = "0.28.1", features = ["image"] }
human-panic = "2.0.1" human-panic = "2.0.1"
image = "0.25.2" image = "0.25.2"
libpt = { version = "0.6.0", features = ["cli", "full"] } libpt = { version = "0.6.0", features = ["cli", "full"] }

View file

@ -5,8 +5,6 @@ use libpt::log::{debug, info};
use crate::error::Error; use crate::error::Error;
use self::ui::entry::Entry;
pub mod ui; pub mod ui;
pub const TITLE: &str = "Beatbär"; pub const TITLE: &str = "Beatbär";
@ -58,13 +56,4 @@ impl Player {
pub fn init(&mut self, _cc: &CreationContext) { pub fn init(&mut self, _cc: &CreationContext) {
// we can use the creation context to do some customizing, but idc right now // we can use the creation context to do some customizing, but idc right now
} }
fn entries(&self) -> Vec<Entry> {
let e = Entry::new(ui::entry::Kind::Album, "boom boom boom.", None);
let mut v = vec![e.clone()];
for _ in 0..100 {
v.push(e.clone());
}
v
}
} }

View file

@ -1,15 +1,9 @@
use egui::{IconData, ScrollArea}; use egui::IconData;
use egui_extras::{Column, Table, TableBuilder};
use libpt::log::trace; use libpt::log::trace;
pub mod entry;
pub mod showbox;
use self::showbox::ShowBox;
use super::*; use super::*;
const ICON_RAW: &[u8; 36525] = include_bytes!("../../../assets/img/icon-512.jpg"); const ICON_RAW: &[u8; 36525] = include_bytes!("../../assets/img/icon-512.jpg");
impl Player { impl Player {
fn top_panel(&mut self, ui: &mut egui::Ui, ctx: &egui::Context) { fn top_panel(&mut self, ui: &mut egui::Ui, ctx: &egui::Context) {
@ -101,23 +95,11 @@ impl Player {
} }
fn main_panel(&mut self, ui: &mut egui::Ui, ctx: &egui::Context) { fn main_panel(&mut self, ui: &mut egui::Ui, ctx: &egui::Context) {
let mut tb = TableBuilder::new(ui) ui.vertical_centered(|ui| {
.column(Column::remainder()) for i in 0..100 {
.column(Column::remainder()) ui.horizontal_wrapped(|ui| {
.column(Column::remainder()) for j in 0..10 {
.column(Column::remainder()) ui.label(format!("foo-{i}-{j}"));
.column(Column::remainder())
.column(Column::remainder())
.column(Column::remainder())
.column(Column::remainder());
tb.body(|mut body| {
for line in self.entries().chunks(8) {
body.row(30.0, |mut row| {
for e in line {
row.col(|ui| {
ui.add(ShowBox::new(e));
});
} }
}); });
} }

View file

@ -1,24 +0,0 @@
#[derive(Hash, Clone, PartialEq, Eq)]
pub enum Kind {
Playlist,
Album,
Song,
Artist,
}
#[derive(Hash, Clone, PartialEq, Eq)]
pub struct Entry {
kind: Kind,
title: String,
image: Option<()>,
}
impl Entry {
pub fn new(kind: Kind, title: &str, img: Option<()>) -> Self {
Self {
kind,
title: title.to_owned(),
image: img,
}
}
}

View file

@ -1,25 +0,0 @@
use egui::Color32;
use super::Entry;
pub struct ShowBox {
entry: Entry,
frame: egui::Frame,
}
impl ShowBox {
pub fn new(entry: &Entry) -> Self {
let frame = egui::Frame::none();
Self {
entry: entry.to_owned(),
frame,
}
}
}
impl egui::Widget for ShowBox {
fn ui(mut self, ui: &mut egui::Ui) -> egui::Response {
ui.vertical_centered(|ui| ui.button("i dont get it").union(ui.label("caption")))
.response
}
}