mirror of
https://github.com/arabianq/pipewire-soundpad.git
synced 2026-06-19 12:13:32 +00:00
f2dcf2e0fe
Replaced the monolithic `src/gui/draw.rs` with a new `src/gui/views` directory module. The GUI drawing logic is now cleanly separated into distinct files: - `body.rs` - `footer.rs` - `header.rs` - `hotkey_capture.rs` - `hotkeys.rs` - `settings.rs` - `waiting_for_daemon.rs` This organization vastly improves readability and maintainability without altering functionality. All shared helpers are centralized in `src/gui/views/mod.rs` and imports are strictly managed. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
33 lines
711 B
Rust
33 lines
711 B
Rust
use crate::gui::SoundpadGui;
|
|
use egui::Ui;
|
|
use egui_material_icons::icons::*;
|
|
|
|
mod body;
|
|
mod footer;
|
|
mod header;
|
|
mod hotkey_capture;
|
|
mod hotkeys;
|
|
mod settings;
|
|
mod waiting_for_daemon;
|
|
|
|
impl SoundpadGui {
|
|
pub(crate) fn get_volume_icon(volume: f32) -> &'static str {
|
|
if volume > 0.7 {
|
|
ICON_VOLUME_UP.codepoint
|
|
} else if volume <= 0.0 {
|
|
ICON_VOLUME_OFF.codepoint
|
|
} else if volume < 0.3 {
|
|
ICON_VOLUME_MUTE.codepoint
|
|
} else {
|
|
ICON_VOLUME_DOWN.codepoint
|
|
}
|
|
}
|
|
|
|
pub fn draw(&mut self, ui: &mut Ui) {
|
|
self.draw_header(ui);
|
|
self.draw_body(ui);
|
|
ui.separator();
|
|
self.draw_footer(ui);
|
|
}
|
|
}
|