diff --git a/FL/focus_frame.C b/FL/focus_frame.C index 73ed0e8..0cabb7e 100644 --- a/FL/focus_frame.C +++ b/FL/focus_frame.C @@ -56,6 +56,42 @@ draw_focus_frame ( int x, int y, int w, int h, Fl_Color c ) fl_pop_clip(); } +void +draw_selection_frame ( int x, int y, int w, int h, Fl_Color c ) +{ + fl_push_clip( x, y, w, h ); + + fl_color( fl_color_average( FL_GRAY, c, 0.50 ) ); + +/// fl_color( fl_color_add_alpha( c, 100 ) ); + + fl_line_style( FL_DASH, 2 ); + + fl_rect( x, y, w, h ); + + fl_line_style( FL_SOLID, 3 ); + + fl_color( c ); + + int l = 15; + + fl_line( x, y, x + l, y ); + fl_line( x, y + l, x, y ); + + fl_line( x + w - 1, y, x + w - l - 1, y ); + fl_line( x + w - 1, y, x + w - 1, y + l - 1 ); + + fl_line( x, y + h - 1, x, y + h - l - 1); + fl_line( x, y + h - 1, x + l, y + h - 1 ); + + fl_line( x + w - 1, y + h - 1, x + w - 1, y + h - l - 1 ); + fl_line( x + w - 1, y + h - 1, x + w - l, y + h - 1 ); + + fl_line_style( FL_SOLID, 0 ); + + fl_pop_clip(); +} + bool focused_r ( Fl_Widget *w ) { diff --git a/FL/focus_frame.H b/FL/focus_frame.H index 9ed1788..e48e540 100644 --- a/FL/focus_frame.H +++ b/FL/focus_frame.H @@ -17,6 +17,6 @@ /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*******************************************************************************/ -void -draw_focus_frame ( int x, int y, int w, int h, Fl_Color c ); +void draw_focus_frame ( int x, int y, int w, int h, Fl_Color c ); +void draw_selection_frame ( int x, int y, int w, int h, Fl_Color c ); bool focused_r ( Fl_Widget *w ); diff --git a/lib/ntk b/lib/ntk index 1238f91..127328b 160000 --- a/lib/ntk +++ b/lib/ntk @@ -1 +1 @@ -Subproject commit 1238f916dc30c018d333859513f63da9ab8bcb7b +Subproject commit 127328b00c3ceddebeeff6fac59f207a8469f6dc diff --git a/timeline/src/Audio_Region.C b/timeline/src/Audio_Region.C index 8a0d3a2..65a2d06 100644 --- a/timeline/src/Audio_Region.C +++ b/timeline/src/Audio_Region.C @@ -34,6 +34,7 @@ #include "Transport.H" #include "const.h" #include "debug.h" +#include #include using std::min; @@ -50,7 +51,7 @@ extern Transport *transport; bool Audio_Region::inherit_track_color = true; bool Audio_Region::show_box = true; -Fl_Boxtype Audio_Region::_box = FL_FLAT_BOX; +Fl_Boxtype Audio_Region::_box = FL_BORDER_BOX; Fl_Color Audio_Region::_selection_color = FL_MAGENTA; @@ -436,7 +437,7 @@ Audio_Region::actual_box_color ( void ) const void Audio_Region::draw_box( void ) { - fl_push_clip( x(), y(), w(), h() ); +// fl_push_clip( x(), y(), w(), h() ); Fl_Color selection_color = _selection_color; @@ -455,7 +456,7 @@ Audio_Region::draw_box( void ) } Fl_Boxtype b; - Fl_Color c = selected() ? selection_color : color; + Fl_Color c = selected() ? fl_color_average( color, fl_rgb_color(10,10,10), 0.4f ) : color; if ( Audio_Region::show_box ) { @@ -466,9 +467,10 @@ Audio_Region::draw_box( void ) b = FL_DOWN_FRAME; } - fl_draw_box( b, x(), y(), w(), h(), c ); + fl_draw_box( b, line_x(), y(), abs_w(), h(), c ); + - fl_pop_clip(); +// fl_pop_clip(); } void @@ -688,6 +690,13 @@ Audio_Region::draw ( void ) fl_line_style( FL_SOLID, 0 ); } + if ( selected() ) + draw_selection_frame( line_x() + Fl::box_dx(box()), + y() + Fl::box_dy(box()), + abs_w() - Fl::box_dw(box()), + h() - Fl::box_dh(box()), + selection_color() ); + /* if ( current() ) */ /* { */ /* /\* draw length bubble *\/ */