Rework so project has a license, more natural crate structure, dedicated examples folder, less confusing lib heirarchy
This commit is contained in:
parent
0c503a549a
commit
994d31ac3f
21 changed files with 85 additions and 115 deletions
7
examples/layout/Cargo.toml
Normal file
7
examples/layout/Cargo.toml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[package]
|
||||
name = "layout"
|
||||
version = "0.1.0"
|
||||
authors = ["Ryan McGrath <ryan@rymc.io>"]
|
||||
|
||||
[dependencies]
|
||||
shinekit = { path = "../.." }
|
||||
22
examples/layout/src/main.rs
Normal file
22
examples/layout/src/main.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
//! App
|
||||
//!
|
||||
//! An "App" in Rust, which is really just wrapping a lot of platform-specific
|
||||
//! logic. Attempts to do as much as possible in Rust, however the GUI story in
|
||||
//! Rust is the worst thing at the moment, so a lot of this is glorified message
|
||||
//! passing to Objective C and co. ObjC is also one of the best languages ever
|
||||
//! created and you can fight me on this if you so choose.
|
||||
//!
|
||||
//! @author Ryan McGrath <ryan@rymc.io>
|
||||
//! @created 05/30/2018
|
||||
|
||||
extern crate shinekit;
|
||||
use shinekit::*;
|
||||
|
||||
fn main() {
|
||||
shinekit::run(vec![
|
||||
StyleSheet::default(include_str!("styles/default.json"))
|
||||
], App::new("eSports Calendar", View::named("root").subviews(vec![
|
||||
View::named("sidebar"),
|
||||
View::named("content")
|
||||
])));
|
||||
}
|
||||
5
examples/layout/src/styles/dark.json
Normal file
5
examples/layout/src/styles/dark.json
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"calendar": {
|
||||
"backgroundColor": "blue"
|
||||
}
|
||||
}
|
||||
27
examples/layout/src/styles/default.json
Normal file
27
examples/layout/src/styles/default.json
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"window": {
|
||||
"backgroundColor": {"r": 35, "g": 108, "b": 218},
|
||||
"defaultWidth": 800,
|
||||
"defaultHeight": 600
|
||||
},
|
||||
|
||||
"root": {
|
||||
"backgroundColor": {"r": 35, "g": 108, "b": 218}
|
||||
},
|
||||
|
||||
"sidebar": {
|
||||
"backgroundColor": {"r": 5, "g": 5, "b": 5},
|
||||
"width": 200,
|
||||
"top": "root.top",
|
||||
"left": "root.left",
|
||||
"bottom": "root.bottom"
|
||||
},
|
||||
|
||||
"content": {
|
||||
"backgroundColor": {"r": 35, "g": 108, "b": 218},
|
||||
"top": "root.top",
|
||||
"left": "sidebar.right",
|
||||
"right": "root.right",
|
||||
"bottom": "root.bottom"
|
||||
}
|
||||
}
|
||||
Reference in a new issue