Browse Source

Timeline: Tweak region appearance.

tags/non-daw-v1.2.0
Jonathan Moore Liles 9 years ago
parent
commit
51bce6124e
4 changed files with 53 additions and 8 deletions
  1. +36
    -0
      FL/focus_frame.C
  2. +2
    -2
      FL/focus_frame.H
  3. +1
    -1
      lib/ntk
  4. +14
    -5
      timeline/src/Audio_Region.C

+ 36
- 0
FL/focus_frame.C View File

@@ -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 )
{


+ 2
- 2
FL/focus_frame.H View File

@@ -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 );

+ 1
- 1
lib/ntk

@@ -1 +1 @@
Subproject commit 1238f916dc30c018d333859513f63da9ab8bcb7b
Subproject commit 127328b00c3ceddebeeff6fac59f207a8469f6dc

+ 14
- 5
timeline/src/Audio_Region.C View File

@@ -34,6 +34,7 @@
#include "Transport.H"
#include "const.h"
#include "debug.h"
#include <FL/focus_frame.H>

#include <algorithm>
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 *\/ */


Loading…
Cancel
Save