hardware_toolkit/src/ui/db_browser.rs
z_lenovo 21353af9e4 draw some ui
这个ui框架是真tm难用,但是界面也是真的挺好看,省去了后期美化的过程,就当吃屎了吧
2025-06-23 21:52:45 +08:00

36 lines
865 B
Rust

use iced::{Length, alignment::Horizontal, widget::Column};
use crate::ui::main_window::{MainWindowMsg, TabContent};
#[derive(Default)]
pub struct DbBrowser {}
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum DbBrowserMsg {
Nothing,
}
impl TabContent for DbBrowser {
type TabMessage = DbBrowserMsg;
fn update(&self, msg: Self::TabMessage) {
match msg {
DbBrowserMsg::Nothing => {
println!("This function not allowed");
}
}
}
fn content(&self) -> iced::Element<'_, MainWindowMsg> {
let btn = iced::widget::button("DbBrowser")
.on_press(MainWindowMsg::DbBrowser(DbBrowserMsg::Nothing));
Column::new()
.align_x(Horizontal::Left)
.width(Length::Fill)
.height(Length::Fill)
.push(btn)
.into()
}
}