Open RangerMauve opened 1 year ago
Hi
You can try FLTK's app::get_system_colors()
, which will attempt to get X11 colormap settings, usually set by the DE.
This will only affect the colors though.
The shape of widgets follows the app::scheme, or in fltk-theme, is custom drawn by overriding some drawing functions.
Hmm, it doesn't seem to have changed anything. I tried calling that API before creating any UI elements and just before calling app.run()
and neither option had a visible effect. It just had the default grey theme.
I’m interested to know what environment you’re using.
I tried it on a kubuntu machine on X11, the color becomes nearly white.
Are you perhaps using KDE on wayland?
This is with KDE Plasma 5.26.4 with X11 on Manjaro Linux.
It's on a 10th generation Intel core if that makes a difference. 🤔
use fltk_theme::{ColorTheme, color_themes};
use fltk::{app, button::Button, frame::Frame, prelude::*, window::Window};
fn main() -> Result<(), Box<dyn Error>> {
let app = app::App::default();
app::get_system_colors();
let mut wind = Window::new(100, 100, 400, 300, "Hello from rust");
let mut frame = Frame::new(0, 0, 400, 200, "");
let mut but = Button::new(160, 210, 80, 40, "Click me!");
wind.end();
wind.show();
println!("Wow OK we exited!");
Ok(())
}
This is what my GTK theme should look like according to the preview thingie in Plasma:
It seems KDE plasma stores themes in $HOME/.local/share/plasma/desktoptheme/
Hey, is there a way to get the app to use the OS's theming in KDE (or even in GTK?).
It seems that out of the box it's using the default GTK theme rather than the one configured by the user. As a result any apps built with fltk will look off.