From 77359fb5bbcae309275ac3a21de3238edf2732a3 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Sat, 30 Jan 2010 01:03:35 -0600 Subject: [PATCH] Properly set default color scheme. This fixes a bug where the default color scheme setting doesn't take effect until the second program run. --- Timeline/TLE.fl | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Timeline/TLE.fl b/Timeline/TLE.fl index 0f05a4c..51ec783 100644 --- a/Timeline/TLE.fl +++ b/Timeline/TLE.fl @@ -157,6 +157,8 @@ system_colors[ 0 ] = (Fl_Color)Fl::get_color( FL_BACKGROUND_COLOR ); system_colors[ 1 ] = (Fl_Color)Fl::get_color( FL_FOREGROUND_COLOR ); system_colors[ 2 ] = (Fl_Color)Fl::get_color( FL_BACKGROUND2_COLOR ); +set_theme_dark(); + // constrain window to size of screen. { int sx, sy, sw, sh; @@ -555,11 +557,9 @@ Fl::scheme( Fl::scheme() );} } MenuItem {} { label Dark - callback {Fl::background2( 100, 100, 100 ); -Fl::background( 50, 50, 50 ); -Fl::foreground( 255, 255, 255 ); + callback { -Fl::scheme( Fl::scheme() );} + set_theme_dark(); } xywh {20 20 40 25} type Radio value 1 } MenuItem {} { @@ -942,6 +942,15 @@ write_line( user_config_dir, "default_path", o->value() );} } } +Function {set_theme_dark()} {C return_type void +} { + code { Fl::background2( 100, 100, 100 ); + Fl::background( 50, 50, 50 ); + Fl::foreground( 255, 255, 255 ); + + Fl::scheme( Fl::scheme() ); } {} +} + Function {new_project_chooser()} {C return_type void } { code {New_Project_Dialog nsd;