fltk-rs / fltk-theme

A theming crate for fltk-rs
MIT License
98 stars 8 forks source link

Use these themes with regular FLTK? #1

Closed robotogre closed 3 years ago

robotogre commented 3 years ago

Hello, is it possible to use these themes with regular FLTK? (C++ FLTK)

MoAlyousef commented 3 years ago

Hi Yes. There is no published C++ package, but this library is based on this: https://github.com/roukaour/viz-brain-visualizer

You can check here for a minimal setup: https://github.com/MoAlyousef/fltk_theme_demo

You just need to run: cmake -Bbin && cmake --build bin Or use whichever cmake generator.

The example just copies 5 files from viz-brain-visualizer (os-themes.h, os-themes.cpp, utils.h, algebra.h, algebra.cpp), and just include "os-themes.h" from main and calls OS::use_aero_theme();. I had to add a missing include in the os-themes.cpp source file, but that's it.

If you're not building for windows, replace gdiplus in the CMakeLists.txt file with the necessary frameworks (apple) or libs (linux/bsd).

gizlu commented 2 years ago

Hi Yes. There is no published C++ package, but this library is based on this: https://github.com/roukaour/viz-brain-visualizer You can check here for a minimal setup: https://github.com/MoAlyousef/fltk_theme_demo

The problem is that viz-brain-visualizer have very restrictive license (basically view-only). This afaik doesn't matter for fltk-rs/fltk-theme since it is complete rewrite, but it makes illegal to just copy paste their non-trivial code

MoAlyousef commented 2 years ago

I can add a C api to fltk-theme, but you'd have to link to the same version of FLTK that fltk-theme links to. I think offering svg styling to widgets can also be nice and doable in a single header c++ library.