Crate fltk_theme[][src]

Expand description

fltk-theme

A theming crate for fltk-rs.

  • The widget themes are based on work by Remy Oukaour and Rangi42.
  • The color themes are based on work by Greg Ercolano.
  • Some of the widget schemes are based on work by the NTK GUI library, others are nouveau.

Usage

[dependencies]
fltk = "1.2"
fltk-theme = "0.2"

Example

Setting the color theme:

use fltk::{prelude::*, *};
use fltk_theme::{ColorTheme, color_themes};

let a = app::App::default().with_scheme(app::Scheme::Gtk);
let theme = ColorTheme::from_colormap(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:

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:

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();
}

Modules

Macros

Structs

Color map struct. (index, r, g, b)

A theme is just a Vec of colormaps

A widget scheme sets the style of drawing a widget without interfering with coloring

A widget theme is a scheme + a set of default colors

Enums

Lists supported schemes

Lists supported themes

Traits