Skip to content

Commit

Permalink
update pics
Browse files Browse the repository at this point in the history
  • Loading branch information
MoAlyousef committed Jan 10, 2025
1 parent b8e0f50 commit f923b7f
Show file tree
Hide file tree
Showing 29 changed files with 108 additions and 97 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ These provide schemes for widgets without color theming. Currently there are 6 s

- Fluent: Tries to mimic Window's 10 styles.
- ![alt_test](screenshots/fluent.jpg)
- ![alt_test](screenshots/fluent2.jpg)
- ![alt_test](screenshots/fluent_dark.jpg)

- SvgBased: This overrides FLTK's Base scheme round/rounded/oval FrameTypes which are drawn using scalable vector graphics.
- ![alt_test](screenshots/svgbased.jpg)
Expand Down
22 changes: 16 additions & 6 deletions examples/aqua_dark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use fltk_theme::colors::aqua::dark::*; // get all the dark aqua colors

fn main() {
let a = app::App::default();
app::set_font_size(12);
let bg = windowBackgroundColor.to_rgb();
app::background(bg.0, bg.1, bg.2);
let ctrl = controlAccentColor.to_rgb();
Expand All @@ -19,23 +20,32 @@ fn main() {
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);
let mut win = window::Window::default()
.with_size(400, 300)
.with_label("Aqua Dark");
let mut col = group::Flex::default()
.with_size(340, 240)
.center_of_parent()
.column();
col.set_frame(FrameType::EngravedBox);
col.set_margins(100, 40, 100, 40);
let mut choice = menu::Choice::default();
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);
let mut inp = input::Input::default();
inp.set_color(*controlColor);
let mut check = button::CheckButton::new(160, 150, 80, 30, " Check");
let mut check = button::CheckButton::default().with_label(" Check");
check.set_value(true);
check.set_frame(enums::FrameType::FlatBox);
let mut round = button::RoundButton::new(160, 180, 80, 30, " Round");
let mut round = button::RoundButton::default().with_label(" Round");
round.set_value(true);
round.set_frame(enums::FrameType::FlatBox);
let mut btn = button::Button::new(160, 230, 80, 30, "Hello");
let mut btn = button::Button::default().with_label("Hello");
btn.set_color(*controlColor);
btn.set_selection_color(*controlAccentColor);
btn.set_frame(OS_DEFAULT_BUTTON_UP_BOX);
col.end();
win.end();
win.make_resizable(true);
win.show();
Expand Down
22 changes: 16 additions & 6 deletions examples/fluent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use fltk_theme::{SchemeType, WidgetScheme};

fn main() {
let a = app::App::default();
app::set_font_size(12);
app::background(0xFC, 0xFC, 0xFC);
app::background2(0xFF, 0xFF, 0xFF);
app::foreground(0x00, 0x00, 0x00);
Expand All @@ -16,22 +17,30 @@ fn main() {
);
let theme = WidgetScheme::new(SchemeType::Fluent);
theme.apply();
let mut win = window::SingleWindow::default().with_size(400, 300);
let mut choice = menu::Choice::new(100, 100, 200, 30, None);
let mut win = window::SingleWindow::default()
.with_size(400, 300)
.with_label("Fluent");
let mut col = group::Flex::default()
.with_size(340, 240)
.center_of_parent()
.column();
col.set_frame(FrameType::EngravedBox);
col.set_margins(100, 60, 100, 60);
let mut choice = menu::Choice::default();
choice.add_choice("Fluent");
choice.set_value(0);
choice.set_frame(FrameType::FlatBox);
let mut check = button::CheckButton::new(160, 150, 80, 30, " Check");
let mut check = button::CheckButton::default().with_label(" Check");
check.set_value(true);
check.set_frame(FrameType::FlatBox);
let mut round = button::RoundButton::new(160, 180, 80, 30, " Round");
let mut round = button::RoundButton::default().with_label(" Round");
round.set_value(true);
round.set_frame(FrameType::FlatBox);
let mut toggle = button::ToggleButton::new(100, 220, 80, 30, "Toggle");
let mut toggle = button::ToggleButton::default().with_label("Toggle");
toggle.set_color(Color::from_rgba_tuple(ACCENT_COLOR));
toggle.set_label_color(Color::White);
toggle.set_selection_color(toggle.color().darker());
let mut btn = button::Button::new(220, 220, 80, 30, "Hello");
let mut btn = button::Button::default().with_label("Hello");
btn.set_frame(OS_DEFAULT_BUTTON_UP_BOX);
btn.set_down_frame(OS_DEFAULT_DEPRESSED_DOWN_BOX);
// handle hover
Expand All @@ -48,6 +57,7 @@ fn main() {
}
_ => false,
});
col.end();
win.end();
win.make_resizable(true);
win.show();
Expand Down
46 changes: 28 additions & 18 deletions examples/fluent_dark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use fltk_theme::{SchemeType, WidgetScheme};

fn main() {
let a = app::App::default();
app::set_font_size(12);
app::background(0x00, 0x00, 0x00);
app::background2(0x00, 0x00, 0x00);
app::foreground(0xff, 0xff, 0xff);
Expand All @@ -16,34 +17,42 @@ fn main() {
);
let theme = WidgetScheme::new(SchemeType::Fluent);
theme.apply();
let mut win = window::Window::default().with_size(400, 300);
let mut choice = menu::Choice::new(100, 100, 200, 30, None);
let mut win = window::Window::default()
.with_size(400, 300)
.with_label("Fluent Dark");
let mut col = group::Flex::default()
.with_size(340, 240)
.center_of_parent()
.column();
col.set_frame(FrameType::EngravedBox);
col.set_margins(100, 60, 100, 60);
let mut choice = menu::Choice::default();
choice.add_choice("Fluent");
choice.set_value(0);
choice.set_frame(FrameType::FlatBox);
choice.draw(|c| {
draw::set_draw_color(Color::Background);
draw::draw_polygon(
c.x() + c.w() - 18,
(c.y() + c.h() / 2) - 6,
c.x() + c.w() - 13,
(c.y() + c.h() / 2) - 1,
c.x() + c.w() - 7,
(c.y() + c.h() / 2) - 6,
);
draw::end_polygon();
});
let mut check = button::CheckButton::new(160, 150, 80, 30, " Check");
// choice.draw(|c| {
// draw::set_draw_color(Color::Background);
// draw::draw_polygon(
// c.x() + c.w() - 18,
// (c.y() + c.h() / 2) - 6,
// c.x() + c.w() - 13,
// (c.y() + c.h() / 2) - 1,
// c.x() + c.w() - 7,
// (c.y() + c.h() / 2) - 6,
// );
// draw::end_polygon();
// });
let mut check = button::CheckButton::default().with_label(" Check");
check.set_value(true);
check.set_frame(FrameType::FlatBox);
let mut round = button::RoundButton::new(160, 180, 80, 30, " Round");
let mut round = button::RoundButton::default().with_label(" Round");
round.set_value(true);
round.set_frame(FrameType::FlatBox);
let mut toggle = button::ToggleButton::new(100, 220, 80, 30, "Toggle");
let mut toggle = button::ToggleButton::default().with_label("Toggle");
toggle.set_color(Color::from_rgba_tuple(ACCENT_COLOR));
toggle.set_label_color(Color::White);
toggle.set_selection_color(toggle.color().darker());
let mut btn = button::Button::new(220, 220, 80, 30, "Hello");
let mut btn = button::Button::default().with_label("Hello");
btn.set_frame(OS_DEFAULT_BUTTON_UP_BOX);
btn.set_down_frame(OS_DEFAULT_DEPRESSED_DOWN_BOX);
// handle hover
Expand All @@ -60,6 +69,7 @@ fn main() {
}
_ => false,
});
col.end();
win.end();
win.make_resizable(true);
win.show();
Expand Down
24 changes: 16 additions & 8 deletions examples/predef_color.rs
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
use fltk::{prelude::*, *};
use fltk_theme::{reset_color_map, color_themes, ColorTheme};
use fltk::{enums::*, prelude::*, *};
use fltk_theme::{color_themes, reset_color_map, ColorTheme};

fn main() {
let a = app::App::default().with_scheme(app::Scheme::Gtk);
app::set_visible_focus(false);

let color_theme = ColorTheme::new(color_themes::BLACK_THEME);
color_theme.apply();
let mut win = window::Window::default().with_size(400, 300);
let mut choice = menu::Choice::new(100, 100, 200, 30, None);
let mut win = window::Window::default()
.with_size(400, 300)
.with_label("Color Theme");
let mut col = group::Flex::default()
.with_size(340, 240)
.center_of_parent()
.column();
col.set_frame(FrameType::EngravedBox);
col.set_margins(100, 60, 100, 60);
let mut choice = menu::Choice::default();
choice.add_choice("Black|Dark|Gray|Shake|Tan");
choice.set_value(0);
let mut check = button::CheckButton::new(160, 150, 80, 30, " Check");
let mut check = button::CheckButton::default().with_label(" Check");
check.set_value(true);
check.set_frame(enums::FrameType::FlatBox);
let mut round = button::RoundButton::new(160, 180, 80, 30, " Round");
let mut round = button::RoundButton::default().with_label(" Round");
round.set_value(true);
round.set_frame(enums::FrameType::FlatBox);
let mut button = button::Button::new(160, 220, 80, 30, "Hello");
let mut button = button::Button::default().with_label("Hello");
button.set_callback(|_| reset_color_map());
col.end();
win.end();
win.show();
choice.set_callback(|c| {
Expand Down
45 changes: 0 additions & 45 deletions examples/tabs.rs

This file was deleted.

21 changes: 15 additions & 6 deletions examples/widget_scheme.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
use fltk::{prelude::*, *};
use fltk::{enums::*, prelude::*, *};
use fltk_theme::{SchemeType, WidgetScheme};

fn main() {
let a = app::App::default();
let scheme = WidgetScheme::new(SchemeType::Clean);
scheme.apply();
let mut win = window::Window::default().with_size(400, 300);
let mut choice = menu::Choice::new(100, 100, 200, 30, None);
let mut win = window::Window::default()
.with_size(400, 300)
.with_label("Widget Scheme");
let mut col = group::Flex::default()
.with_size(340, 240)
.center_of_parent()
.column();
col.set_frame(FrameType::EngravedBox);
col.set_margins(100, 60, 100, 60);
let mut choice = menu::Choice::default();
choice.add_choice("Clean|Crystal|Gleam");
choice.set_value(3);
let mut check = button::CheckButton::new(160, 150, 80, 30, "Check");
let mut check = button::CheckButton::default().with_label("Check");
check.set_value(true);
let mut round = button::RoundButton::new(160, 180, 80, 30, "Round");
let mut round = button::RoundButton::default().with_label("Round");
round.set_value(true);
let mut _btn = button::Button::new(160, 220, 80, 30, "Hello");
let mut _btn = button::Button::default().with_label("Hello");
col.end();
win.end();
win.show();
choice.set_callback(|c| {
Expand Down
21 changes: 15 additions & 6 deletions examples/widget_theme.rs
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
use fltk::{prelude::*, *};
use fltk::{enums::*, prelude::*, *};
use fltk_theme::{widget_themes, ThemeType, WidgetTheme};

fn main() {
let a = app::App::default();
let theme = WidgetTheme::new(ThemeType::AquaClassic);
theme.apply();
let mut win = window::Window::default().with_size(400, 300);
let mut choice = menu::Choice::new(100, 100, 200, 30, None);
let mut win = window::Window::default()
.with_size(400, 300)
.with_label("Widget Theme");
let mut col = group::Flex::default()
.with_size(340, 240)
.center_of_parent()
.column();
col.set_frame(FrameType::EngravedBox);
col.set_margins(100, 60, 100, 60);
let mut choice = menu::Choice::default();
choice.add_choice("Classic|Aero|Metro|AquaClassic|Greybird|Blue|HighContrast|Dark");
choice.set_value(3);
choice.set_frame(widget_themes::OS_PANEL_THIN_UP_BOX);
let mut check = button::CheckButton::new(160, 150, 80, 30, " Check");
let mut check = button::CheckButton::default().with_label(" Check");
check.set_value(true);
check.set_frame(enums::FrameType::FlatBox);
let mut round = button::RoundButton::new(160, 180, 80, 30, " Round");
let mut round = button::RoundButton::default().with_label(" Round");
round.set_value(true);
round.set_frame(enums::FrameType::FlatBox);
let mut btn = button::Button::new(160, 220, 80, 30, "Hello");
let mut btn = button::Button::default().with_label("Hello");
btn.set_frame(widget_themes::OS_DEFAULT_BUTTON_UP_BOX);
col.end();
win.end();
win.show();
choice.set_callback(|c| {
Expand Down
Binary file modified screenshots/aero.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/aqua_classic.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/black.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/blue.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/classic.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/clean.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/crystal.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/dark.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/dark_color.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/fluent.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed screenshots/fluent2.jpg
Binary file not shown.
Binary file added screenshots/fluent_dark.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/gleam.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/greybird.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/high_contrast.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/metro.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/plain-gray.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/shake.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/svgbased.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/tan.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl ColorTheme {
let mut default_map = Vec::with_capacity(256);
for index in 0..=255 {
let (r, g, b) = Color::by_index(index).to_rgb();
default_map.push(ColorMap {index, r, g, b });
default_map.push(ColorMap { index, r, g, b });
}
DEFAULT_COLOR_MAP.set(default_map).unwrap();
}
Expand Down

0 comments on commit f923b7f

Please sign in to comment.