mirror of
https://github.com/ALEZ-DEV/Babylonia-terminal.git
synced 2025-12-16 09:28:53 +00:00
improve the menu
This commit is contained in:
parent
d2e8f5f818
commit
9246d3a36f
@ -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!");
|
||||||
|
|||||||
@ -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 = >k::Box {
|
set_sidebar = >k::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 = >k::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 = >k::Button {
|
gtk::Button {
|
||||||
set_margin_vertical: 5,
|
set_margin_vertical: 5,
|
||||||
set_label: "Item 2"
|
set_label: "Item 1",
|
||||||
},
|
},
|
||||||
|
|
||||||
append = >k::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",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user