generated from PlexSheep/rs-base
Compare commits
No commits in common. "b4667faf5d1da8d54fbe2e7869f9009c4edc0072" and "734b39945eaf803d0e6fb0c50af3f0e008a98954" have entirely different histories.
b4667faf5d
...
734b39945e
5 changed files with 7 additions and 86 deletions
|
@ -21,7 +21,6 @@ anyhow = "1.0.86"
|
|||
clap = { version = "4.5.16", features = ["derive"] }
|
||||
eframe = { 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"
|
||||
image = "0.25.2"
|
||||
libpt = { version = "0.6.0", features = ["cli", "full"] }
|
||||
|
|
|
@ -5,8 +5,6 @@ use libpt::log::{debug, info};
|
|||
|
||||
use crate::error::Error;
|
||||
|
||||
use self::ui::entry::Entry;
|
||||
|
||||
pub mod ui;
|
||||
|
||||
pub const TITLE: &str = "Beatbär";
|
||||
|
@ -58,13 +56,4 @@ impl Player {
|
|||
pub fn init(&mut self, _cc: &CreationContext) {
|
||||
// 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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,9 @@
|
|||
use egui::{IconData, ScrollArea};
|
||||
use egui_extras::{Column, Table, TableBuilder};
|
||||
use egui::IconData;
|
||||
use libpt::log::trace;
|
||||
|
||||
pub mod entry;
|
||||
pub mod showbox;
|
||||
|
||||
use self::showbox::ShowBox;
|
||||
|
||||
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 {
|
||||
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) {
|
||||
let mut 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());
|
||||
|
||||
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));
|
||||
});
|
||||
ui.vertical_centered(|ui| {
|
||||
for i in 0..100 {
|
||||
ui.horizontal_wrapped(|ui| {
|
||||
for j in 0..10 {
|
||||
ui.label(format!("foo-{i}-{j}"));
|
||||
}
|
||||
});
|
||||
}
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue