generated from PlexSheep/rs-base
Compare commits
2 commits
23640a3fdf
...
1e38e17f36
Author | SHA1 | Date | |
---|---|---|---|
1e38e17f36 | |||
66f70eea52 |
4 changed files with 24 additions and 7 deletions
|
@ -23,7 +23,11 @@ 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"
|
||||
image = { version = "0.25.2", default-features = true, features = [
|
||||
"jpeg",
|
||||
"png",
|
||||
] }
|
||||
|
||||
libpt = { version = "0.6.0", features = ["cli", "full"] }
|
||||
thiserror = "1.0.63"
|
||||
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
|
||||
|
|
|
@ -46,8 +46,8 @@ impl Player {
|
|||
|
||||
app.gui_options = eframe::NativeOptions {
|
||||
viewport: egui::ViewportBuilder::default()
|
||||
.with_inner_size([400.0, 300.0])
|
||||
.with_min_inner_size([300.0, 220.0])
|
||||
.with_inner_size([900.0, 700.0])
|
||||
.with_min_inner_size([500.0, 320.0])
|
||||
.with_icon(Player::load_icon()),
|
||||
..Default::default()
|
||||
};
|
||||
|
|
|
@ -161,6 +161,8 @@ impl Player {
|
|||
impl eframe::App for Player {
|
||||
/// 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) {
|
||||
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| {
|
||||
self.top_panel(ui, ctx);
|
||||
});
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
use super::Entry;
|
||||
use egui::{Color32, ImageSource};
|
||||
|
||||
use super::{Entry, ICON_RAW};
|
||||
|
||||
pub struct ShowBox {
|
||||
entry: Entry,
|
||||
|
@ -16,8 +18,17 @@ impl ShowBox {
|
|||
}
|
||||
|
||||
impl egui::Widget for ShowBox {
|
||||
fn ui(self, ui: &mut egui::Ui) -> egui::Response {
|
||||
ui.vertical_centered(|ui| ui.button("i dont get it").union(ui.label("caption")))
|
||||
.response
|
||||
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),
|
||||
})
|
||||
.rounding(5.0),
|
||||
);
|
||||
ui.button("i dont get it").union(ui.label("caption"))
|
||||
})
|
||||
.response
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue