Start, I ... am stuck on UI design again I'm quitting for now
This commit is contained in:
Generated
+5257
File diff suppressed because it is too large
Load Diff
+17
@@ -0,0 +1,17 @@
|
||||
[package]
|
||||
name = "prt-ews"
|
||||
authors = ["inorishio"]
|
||||
version = "0.0.1"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
eframe = "0.34.1"
|
||||
egui = "0.34.1"
|
||||
reqwest = "0.13.2"
|
||||
open = "5.3.3"
|
||||
tokio = "1.52.0"
|
||||
serde = "1.0.228"
|
||||
serde_json = "1.0.149"
|
||||
indicatif = "0.18.4"
|
||||
directories = "6.0.0"
|
||||
anyhow = "1.0.102"
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
use crate::printers::printers;
|
||||
use eframe::egui;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct Shell {}
|
||||
|
||||
impl Shell {
|
||||
pub fn new(cc: &eframe::CreationContext<'_>) -> Self {
|
||||
let mut visuals = egui::Visuals::dark();
|
||||
visuals.panel_fill = egui::Color32::from_rgba_unmultiplied(163, 136, 219, 80);
|
||||
cc.egui_ctx.set_visuals(visuals);
|
||||
Self::default()
|
||||
}
|
||||
}
|
||||
|
||||
impl eframe::App for Shell {
|
||||
fn ui(&mut self, ui: &mut egui::Ui, _frame: &mut eframe::Frame) {
|
||||
egui::Panel::left("sidebar")
|
||||
.resizable(false)
|
||||
.show_separator_line(false)
|
||||
.show_inside(ui, |ui| {
|
||||
ui.label(
|
||||
egui::RichText::new("PRT EWS")
|
||||
.size(28.0)
|
||||
.color(egui::Color32::BLACK),
|
||||
);
|
||||
if ui.button("Printers").clicked() {
|
||||
printers;
|
||||
}
|
||||
if ui.button("Scripts").clicked() {
|
||||
println!("Library button clicked");
|
||||
}
|
||||
if ui.button("Status").clicked() {
|
||||
println!("Settings button clicked");
|
||||
}
|
||||
if ui.button("Settings").clicked() {
|
||||
println!("Settings button clicked");
|
||||
}
|
||||
});
|
||||
egui::CentralPanel::default().show_inside(ui, |ui| {
|
||||
// ui.horizontal(|ui| {
|
||||
// let response = egui::TextEdit::singleline(&mut self.search_query)
|
||||
// .hint_text("Search...")
|
||||
// .show(ui)
|
||||
// .response;
|
||||
// });
|
||||
});
|
||||
}
|
||||
fn clear_color(&self, _visuals: &egui::Visuals) -> [f32; 4] {
|
||||
egui::Color32::from_rgba_unmultiplied(163, 136, 219, 80).to_normalized_gamma_f32()
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
mod app;
|
||||
mod printers;
|
||||
|
||||
use app::Shell;
|
||||
use eframe::egui;
|
||||
|
||||
fn main() -> eframe::Result {
|
||||
let mut window = eframe::NativeOptions::default();
|
||||
window.viewport = egui::ViewportBuilder::default()
|
||||
.with_title("PRT-EWS")
|
||||
.with_app_id("prt-ews")
|
||||
.with_inner_size([400.0, 300.0])
|
||||
.with_min_inner_size([400.0, 300.0])
|
||||
.with_resizable(true)
|
||||
.with_transparent(false);
|
||||
|
||||
eframe::run_native("Shell", window, Box::new(|cc| Ok(Box::new(Shell::new(cc)))))
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
mod app;
|
||||
mod printers;
|
||||
|
||||
use app::Shell;
|
||||
use eframe::egui;
|
||||
|
||||
pub fn printers() -> eframe::Result {
|
||||
let mut window = eframe::NativeOptions::default();
|
||||
window.viewport = egui::ViewportBuilder::default()
|
||||
.with_title("Printers")
|
||||
.with_app_id("printers")
|
||||
.with_inner_size([400.0, 300.0])
|
||||
.with_min_inner_size([400.0, 300.0])
|
||||
.with_resizable(true)
|
||||
.with_transparent(false);
|
||||
|
||||
eframe::run_native("Test", window, Box::new(|cc| Ok(Box::new(Shell::new(cc)))))
|
||||
}
|
||||
Reference in New Issue
Block a user