Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MoAlyousef committed Apr 26, 2022
1 parent 8e792be commit 7a2e53c
Show file tree
Hide file tree
Showing 15 changed files with 436 additions and 429 deletions.
10 changes: 6 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fltk-theme"
version = "0.4.2"
version = "0.5.0"
authors = ["MoAlyousef <[email protected]>"]
edition = "2018"
description = "A theming crate for fltk-rs"
Expand All @@ -13,9 +13,11 @@ license = "MIT"
exclude = ["/screenshots", "./examples"]

[dependencies]
fltk = "1.2.7"
fltk = "1.3.6"
lazy_static = "1.4"
color-maps = "0.1"

[target.'cfg(target_os = "macos")'.dependencies]
cocoa-colors = "0.1.2"
cocoa-colors = { version = "0.1.2", optional = true }

[dev-dependencies]
color-maps = "0.1"
25 changes: 14 additions & 11 deletions examples/aqua_dark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,39 @@ use fltk_theme::colors::aqua::dark::*; // get all the dark aqua colors

fn main() {
let a = app::App::default();
let bg = windowBackgroundColor.to_rgb();
app::background(
windowBackgroundColor.0,
windowBackgroundColor.1,
windowBackgroundColor.2,
bg.0,
bg.1,
bg.2,
);
let ctrl = controlAccentColor.to_rgb();
app::background2(
controlAccentColor.0,
controlAccentColor.1,
controlAccentColor.2,
ctrl.0,
ctrl.1,
ctrl.2,
);
app::foreground(labelColor.0, labelColor.1, labelColor.2);
let lbl = labelColor.to_rgb();
app::foreground(lbl.0, lbl.1, lbl.2);
app::set_color(Color::Selection, 255, 255, 255);
let widget_scheme = WidgetScheme::new(SchemeType::Aqua);
widget_scheme.apply();
let mut win = window::Window::default().with_size(400, 300);
let mut choice = menu::Choice::new(100, 50, 200, 30, None);
choice.set_color(Color::from_rgba_tuple(*controlColor));
choice.set_color(*controlColor);
choice.add_choice("Opt1|Opt2|Opt3");
choice.set_value(2);
let mut inp = input::Input::new(50, 100, 300, 30, None);
inp.set_color(Color::from_rgba_tuple(*controlColor));
inp.set_color(*controlColor);
let mut check = button::CheckButton::new(160, 150, 80, 30, " Check");
check.set_value(true);
check.set_frame(enums::FrameType::FlatBox);
let mut round = button::RoundButton::new(160, 180, 80, 30, " Round");
round.set_value(true);
round.set_frame(enums::FrameType::FlatBox);
let mut btn = button::Button::new(160, 230, 80, 30, "Hello");
btn.set_color(Color::from_rgba_tuple(*controlColor));
btn.set_selection_color(Color::from_rgba_tuple(*controlAccentColor));
btn.set_color(*controlColor);
btn.set_selection_color(*controlAccentColor);
btn.set_frame(OS_DEFAULT_BUTTON_UP_BOX);
win.end();
win.make_resizable(true);
Expand Down
6 changes: 3 additions & 3 deletions examples/fluent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ fn main() {
choice.set_value(0);
choice.set_frame(FrameType::FlatBox);
choice.draw(|c| {
draw::set_draw_color(Color::BackGround);
draw::set_draw_color(Color::Background);
draw::draw_polygon(
c.x() + c.w() - 17,
c.x() + c.w() - 18,
(c.y() + c.h() / 2) - 6,
c.x() + c.w() - 12,
c.x() + c.w() - 13,
(c.y() + c.h() / 2) - 1,
c.x() + c.w() - 7,
(c.y() + c.h() / 2) - 6,
Expand Down
6 changes: 3 additions & 3 deletions examples/fluent_dark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ fn main() {
choice.set_value(0);
choice.set_frame(FrameType::FlatBox);
choice.draw(|c| {
draw::set_draw_color(Color::BackGround);
draw::set_draw_color(Color::Background);
draw::draw_polygon(
c.x() + c.w() - 17,
c.x() + c.w() - 18,
(c.y() + c.h() / 2) - 6,
c.x() + c.w() - 12,
c.x() + c.w() - 13,
(c.y() + c.h() / 2) - 1,
c.x() + c.w() - 7,
(c.y() + c.h() / 2) - 6,
Expand Down
5 changes: 3 additions & 2 deletions examples/html_colors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ fn main() {
let bg = SeaShell;

let a = app::App::default().with_scheme(app::Scheme::Gtk);
app::background(bg.0, bg.1, bg.2);
let col = bg.to_rgb();
app::background(col.0, col.1, col.2);

let mut win = window::Window::default().with_size(800, 600);
{
Expand All @@ -24,7 +25,7 @@ fn main() {
.center_of_parent();
pack.set_spacing(5);
{
for i in HTML_MAP.iter() {
for i in color_maps::html::HTML_MAP.iter() {
let mut frame = frame::Frame::default().with_size(0, 40).with_label(i.0);
frame.set_frame(FrameType::RFlatBox);
frame.set_color(col!(*i.1));
Expand Down
185 changes: 0 additions & 185 deletions src/colors/aqua.rs

This file was deleted.

Loading

0 comments on commit 7a2e53c

Please sign in to comment.