-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
700d632
commit e9a57e5
Showing
10 changed files
with
552 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
| File | Purpose | | ||
|--------------|---------| | ||
| app.rs | Main data & loop for the GUI | ||
| constants.rs | General constants for the GUI | ||
| tab.rs | (Left) Tab buttons | ||
| album.rs | Album tab | ||
| artist.rs | Artist tab | ||
| queue.rs | Queue tab | ||
| search.rs | Search tab | ||
| settings.rs | Settings tab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
//---------------------------------------------------------------------------------------------------- Use | ||
//use anyhow::{bail,ensure,Error}; | ||
//use log::{info,error,warn,trace,debug}; | ||
//use serde::{Serialize,Deserialize}; | ||
use egui::{ | ||
Rounding,Vec2,Color32,Stroke, | ||
ScrollArea,Frame, | ||
SelectableLabel,Label, | ||
}; | ||
|
||
//---------------------------------------------------------------------------------------------------- | ||
//#[derive(Copy,Clone,Debug,Default,Hash,PartialEq,Eq,PartialOrd,Ord,Serialize,Deserialize)] | ||
impl super::app::App { | ||
#[inline(always)] | ||
pub fn show_tab_album(&mut self, ui: &mut egui::Ui, ctx: &egui::Context, frame: &mut eframe::Frame, width: f32, height: f32) { | ||
ui.vertical_centered(|ui| { | ||
ui.add_space(height/40.0); | ||
ui.set_max_width(height/3.0); | ||
Frame::window(&ctx.style()).rounding(Rounding::none()).inner_margin(1.0).show(ui, |ui| { | ||
self.img.vec[2].1.show_size(ui, Vec2::new(height/3.0, height/3.0)); | ||
}); | ||
|
||
ui.heading("祝祭"); | ||
ui.heading("カネコアヤノ"); | ||
ui.heading("2021"); | ||
ui.heading("10/10"); | ||
|
||
}); | ||
|
||
ui.separator(); | ||
ui.visuals_mut().selection.bg_fill = Color32::from_rgb(200, 100, 100); | ||
ui.visuals_mut().selection.stroke = Stroke { width: 5.0, color: Color32::from_rgb(255, 255, 255) }; | ||
ScrollArea::vertical().max_width(f32::INFINITY).max_height(f32::INFINITY).auto_shrink([false; 2]).show_viewport(ui, |ui, _| { | ||
for (i, time, name) in &self.list { | ||
let mut rect = ui.cursor(); | ||
rect.max.y = rect.min.y + 35.0; | ||
if ui.put(rect, SelectableLabel::new(*i == self.s, "")).clicked() { self.s = *i; }; | ||
rect.max.x = rect.min.x; | ||
ui.allocate_ui_at_rect(rect, |ui| { | ||
ui.horizontal_centered(|ui| { | ||
ui.add(Label::new(format!("{: >6}{: >10} {}", i, time, name)).wrap(false)); | ||
}); | ||
}); | ||
} | ||
}); | ||
} | ||
} | ||
|
||
//---------------------------------------------------------------------------------------------------- TESTS | ||
//#[cfg(test)] | ||
//mod test { | ||
// #[test] | ||
// fn _() { | ||
// } | ||
//} |
Oops, something went wrong.