generated from PlexSheep/rs-base
feat(player): show some image
This commit is contained in:
parent
b4667faf5d
commit
66f70eea52
|
@ -23,7 +23,11 @@ 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"] }
|
egui_extras = { version = "0.28.1", features = ["image"] }
|
||||||
human-panic = "2.0.1"
|
human-panic = "2.0.1"
|
||||||
image = "0.25.2"
|
image = { version = "0.25.2", default-features = true, features = [
|
||||||
|
"jpeg",
|
||||||
|
"png",
|
||||||
|
] }
|
||||||
|
|
||||||
libpt = { version = "0.6.0", features = ["cli", "full"] }
|
libpt = { version = "0.6.0", features = ["cli", "full"] }
|
||||||
thiserror = "1.0.63"
|
thiserror = "1.0.63"
|
||||||
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
|
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
|
||||||
|
|
|
@ -46,8 +46,8 @@ impl Player {
|
||||||
|
|
||||||
app.gui_options = eframe::NativeOptions {
|
app.gui_options = eframe::NativeOptions {
|
||||||
viewport: egui::ViewportBuilder::default()
|
viewport: egui::ViewportBuilder::default()
|
||||||
.with_inner_size([400.0, 300.0])
|
.with_inner_size([900.0, 700.0])
|
||||||
.with_min_inner_size([300.0, 220.0])
|
.with_min_inner_size([500.0, 320.0])
|
||||||
.with_icon(Player::load_icon()),
|
.with_icon(Player::load_icon()),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use egui::{IconData, ScrollArea};
|
use egui::{include_image, IconData, ScrollArea};
|
||||||
use egui_extras::{Column, Table, TableBuilder};
|
use egui_extras::{Column, Table, TableBuilder};
|
||||||
use libpt::log::trace;
|
use libpt::log::trace;
|
||||||
|
|
||||||
|
@ -161,6 +161,8 @@ impl Player {
|
||||||
impl eframe::App for Player {
|
impl eframe::App for Player {
|
||||||
/// Called each time the UI needs repainting, which may be many times per second.
|
/// Called each time the UI needs repainting, which may be many times per second.
|
||||||
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
|
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
|
||||||
|
egui_extras::install_image_loaders(ctx); // apperently it's okay to have this every update
|
||||||
|
// as it's only done once? sus
|
||||||
egui::TopBottomPanel::top("top_panel").show(ctx, |ui| {
|
egui::TopBottomPanel::top("top_panel").show(ctx, |ui| {
|
||||||
self.top_panel(ui, ctx);
|
self.top_panel(ui, ctx);
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use egui::Color32;
|
use egui::{Color32, ImageSource};
|
||||||
|
|
||||||
use super::Entry;
|
use super::{Entry, ICON_RAW};
|
||||||
|
|
||||||
pub struct ShowBox {
|
pub struct ShowBox {
|
||||||
entry: Entry,
|
entry: Entry,
|
||||||
|
@ -19,7 +19,16 @@ impl ShowBox {
|
||||||
|
|
||||||
impl egui::Widget for ShowBox {
|
impl egui::Widget for ShowBox {
|
||||||
fn ui(mut self, ui: &mut egui::Ui) -> egui::Response {
|
fn ui(mut self, ui: &mut egui::Ui) -> egui::Response {
|
||||||
ui.vertical_centered(|ui| ui.button("i dont get it").union(ui.label("caption")))
|
ui.vertical_centered(|ui| {
|
||||||
.response
|
ui.add(
|
||||||
|
egui::Image::new(ImageSource::Bytes {
|
||||||
|
uri: std::borrow::Cow::Borrowed("fuck you"),
|
||||||
|
bytes: egui::load::Bytes::Static(ICON_RAW),
|
||||||
|
})
|
||||||
|
.rounding(5.0),
|
||||||
|
);
|
||||||
|
ui.button("i dont get it").union(ui.label("caption"))
|
||||||
|
})
|
||||||
|
.response
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue