improve the menu

This commit is contained in:
ALEZ-DEV 2025-01-16 21:07:19 +01:00
parent d2e8f5f818
commit 9246d3a36f
2 changed files with 32 additions and 16 deletions

View File

@ -8,6 +8,7 @@ mod manager;
mod ui;
pub const APP_RESOURCE_PATH: &str = "/moe/celica/babylonia-terminal";
pub const IS_DEVEL: bool = cfg!(debug_assertions);
pub fn run() {
debug!("Start GUI!");

View File

@ -1,6 +1,6 @@
use std::convert::identity;
use crate::manager;
use crate::{manager, IS_DEVEL};
use babylonia_terminal_sdk::game_state::GameState;
use log::debug;
@ -68,6 +68,8 @@ impl SimpleAsyncComponent for MainWindow {
view! {
#[root]
adw::ApplicationWindow {
add_css_class?: IS_DEVEL.then_some("devel"),
gtk::Box {
set_orientation: gtk::Orientation::Vertical,
@ -131,28 +133,41 @@ impl SimpleAsyncComponent for MainWindow {
#[wrap(Some)]
set_sidebar = &gtk::Box {
set_orientation: gtk::Orientation::Vertical,
gtk::ListBox {
set_width_request: 250,
set_margin_all: 10,
append = &gtk::Button {
gtk::Picture {
set_resource: Some(&format!("{APP_RESOURCE_PATH}/icons/hicolor/scalable/apps/icon.png")),
set_hexpand: true,
set_margin_horizontal: 30,
set_margin_top: 30,
set_margin_bottom: 10,
},
gtk::Label {
set_label: "Babylonia Terminal",
set_margin_top: 12,
add_css_class: "title-1",
set_margin_horizontal: 30,
set_margin_bottom: 10,
},
gtk::Button {
set_margin_vertical: 5,
set_label: "Item 1",
},
append = &gtk::Button {
gtk::Button {
set_margin_vertical: 5,
set_label: "Item 2"
},
append = &gtk::Button {
gtk::Button {
set_margin_vertical: 5,
set_label: "Item 3",
},
},
},
},
//adw::Flap {
// #[watch]