diff --git a/README.md b/README.md index 39e4169..77c7bf5 100644 --- a/README.md +++ b/README.md @@ -21,15 +21,15 @@ As such, color themes can be combined with widget schemes. Widget schemes also e ## Usage ```toml [dependencies] -fltk = "1.2" -fltk-theme = "0.4" +fltk = "1.4" +fltk-theme = "0.7" ``` ## Example Setting the color theme: -```rust +```rust,no_run use fltk::{prelude::*, *}; use fltk_theme::{ColorTheme, color_themes}; @@ -48,7 +48,7 @@ fn main() { Setting the widget theme: -```rust +```rust,no_run use fltk::{prelude::*, *}; use fltk_theme::{widget_themes, WidgetTheme, ThemeType}; @@ -66,7 +66,7 @@ fn main() { ``` Setting the widget scheme: -```rust +```rust,no_run use fltk::{prelude::*, *}; use fltk_theme::{WidgetScheme, SchemeType}; @@ -111,7 +111,7 @@ fn main() { ## Theme FrameTypes Choosing a WidgetTheme will also define a set of FrameTypes which can be used for your widgets. -``` +```ignore OS_BUTTON_UP_BOX OS_CHECK_DOWN_BOX OS_BUTTON_UP_FRAME diff --git a/src/lib.rs b/src/lib.rs index 63b4e84..e8f5031 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,71 +1,4 @@ -/*! -# fltk-theme - -A theming crate for fltk-rs. -- The widget themes are based on work by [Remy Oukaour](https://github.com/roukaour/viz-brain-visualizer) and [Rangi42](https://github.com/Rangi42/tilemap-studio). -- The color themes are based on work by [Greg Ercolano](https://groups.google.com/g/fltkgeneral/c/3A5VC_854ok/m/sDpJsmuLBAAJ). -- Some of the widget schemes are based on work by the NTK GUI library, others are nouveau. - -## Usage -```toml -[dependencies] -fltk = "1.2" -fltk-theme = "0.4" -``` - -## Example - -Setting the color theme: - -```rust -use fltk::{prelude::*, *}; -use fltk_theme::{ColorTheme, color_themes}; - -let a = app::App::default().with_scheme(app::Scheme::Gtk); -let theme = ColorTheme::new(color_themes::BLACK_THEME); -theme.apply(); -let mut win = window::Window::default().with_size(400, 300); -let mut btn = button::Button::new(160, 200, 80, 40, "Hello"); -btn.set_color(btn.color().lighter()); -win.end(); -win.show(); -a.run().unwrap(); -``` - -Setting the widget theme: - -```rust -use fltk::{prelude::*, *}; -use fltk_theme::{widget_themes, WidgetTheme, ThemeType}; - -let a = app::App::default(); -let widget_theme = WidgetTheme::new(ThemeType::AquaClassic); -widget_theme.apply(); -let mut win = window::Window::default().with_size(400, 300); -let mut btn = button::Button::new(160, 200, 80, 30, "Hello"); -btn.set_frame(widget_themes::OS_DEFAULT_BUTTON_UP_BOX); -win.end(); -win.show(); -a.run().unwrap(); -``` - -Setting the widget scheme: -```rust -use fltk::{prelude::*, *}; -use fltk_theme::{WidgetScheme, SchemeType}; - -fn main() { - let a = app::App::default(); - let widget_scheme = WidgetScheme::new(SchemeType::Clean); - widget_scheme.apply(); - let mut win = window::Window::default().with_size(400, 300); - let mut btn = button::Button::new(160, 200, 80, 30, "Hello"); - win.end(); - win.show(); - a.run().unwrap(); -} -``` -*/ +#![doc = include_str!("../README.md")] #![allow(clippy::needless_doctest_main)] use fltk::{app, enums::Color};