Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
MoAlyousef committed Jun 27, 2023
1 parent 1e0f08a commit dfd1e97
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 74 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -48,7 +48,7 @@ fn main() {

Setting the widget theme:

```rust
```rust,no_run
use fltk::{prelude::*, *};
use fltk_theme::{widget_themes, WidgetTheme, ThemeType};
Expand All @@ -66,7 +66,7 @@ fn main() {
```

Setting the widget scheme:
```rust
```rust,no_run
use fltk::{prelude::*, *};
use fltk_theme::{WidgetScheme, SchemeType};
Expand Down Expand Up @@ -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
Expand Down
69 changes: 1 addition & 68 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down

0 comments on commit dfd1e97

Please sign in to comment.