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; mod ui;
pub const APP_RESOURCE_PATH: &str = "/moe/celica/babylonia-terminal"; pub const APP_RESOURCE_PATH: &str = "/moe/celica/babylonia-terminal";
pub const IS_DEVEL: bool = cfg!(debug_assertions);
pub fn run() { pub fn run() {
debug!("Start GUI!"); debug!("Start GUI!");

View File

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