summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2013-07-08 17:55:29 +0200
committerRobin Gareus <robin@gareus.org>2013-07-10 15:27:14 +0200
commit40bc6f5b83e5946a213311e8e504632bec0c978a (patch)
tree3f2f71c6388c13820a43198b8b1a96585b97bee8
parent7121e194374ca6687b38b1dfaaa2bd2b8c555d2b (diff)
Task Force Viking: operation green line
-rw-r--r--gtk2_ardour/ardour3_styles.rc.in6
-rw-r--r--libs/gtkmm2ext/pixfader.cc62
2 files changed, 52 insertions, 16 deletions
diff --git a/gtk2_ardour/ardour3_styles.rc.in b/gtk2_ardour/ardour3_styles.rc.in
index 3743d1db49..53de49fe58 100644
--- a/gtk2_ardour/ardour3_styles.rc.in
+++ b/gtk2_ardour/ardour3_styles.rc.in
@@ -72,9 +72,9 @@ style "gain_fader"
bg[ACTIVE] = shade (0.705, @@COLPREFIX@_bg)
bg[INSENSITIVE] = shade (0.705, @@COLPREFIX@_bg)
- fg[INSENSITIVE] = { 0.525, 0.521, 0.568 }
- fg[NORMAL] = { 0.525, 0.521, 0.568 }
- fg[ACTIVE] = { 0.525, 0.521, 0.568 }
+ fg[INSENSITIVE] = shade(1.4, @@COLPREFIX@_bg)
+ fg[NORMAL] = shade(1.4, @@COLPREFIX@_bg)
+ fg[ACTIVE] = shade(1.4, @@COLPREFIX@_bg)
}
#MSR and related buttons
diff --git a/libs/gtkmm2ext/pixfader.cc b/libs/gtkmm2ext/pixfader.cc
index f4e362bca1..dab7503c77 100644
--- a/libs/gtkmm2ext/pixfader.cc
+++ b/libs/gtkmm2ext/pixfader.cc
@@ -264,21 +264,57 @@ PixFader::on_expose_event (GdkEventExpose* ev)
/* draw the unity-position line if it's not at either end*/
if (unity_loc > 0) {
- if ( _orien == VERT) {
- if (unity_loc < h ) {
- context->set_line_width (1);
- context->set_source_rgb (0.0, 1.0, 0.0);
- context->move_to (1, unity_loc);
- context->line_to (girth - 2.0, unity_loc);
+ context->set_line_width (1);
+ if (girth <= 10) { // Line
+ context->set_source_rgb (0.0, 1.0, 0.0);
+ if ( _orien == VERT) {
+ if (unity_loc < h ) {
+ context->move_to (1, unity_loc + .5);
+ context->line_to (girth - 2.0, unity_loc + .5);
context->stroke ();
+ }
+ } else {
+ if ( unity_loc < w ){
+ context->move_to (unity_loc + .5, 1);
+ context->line_to (unity_loc + .5, girth - 2.0);
+ context->stroke ();
+ }
}
- } else {
- if ( unity_loc < w ){
- context->set_line_width (1);
- context->set_source_rgb (0.0, 1.0, 0.0);
- context->move_to (unity_loc, 1);
- context->line_to (unity_loc, girth - 2.0);
- context->stroke ();
+ } else { // triangle
+ Gdk::Color c = get_style()->get_fg (Gtk::STATE_ACTIVE);
+ context->set_source_rgba (c.get_red_p()*1.25, c.get_green_p()*1.25, c.get_blue_p()*1.25, 0.85);
+ if ( _orien == VERT) {
+ if (unity_loc < h ) {
+ context->move_to (1, unity_loc - 1.0);
+ context->line_to (1, unity_loc + 2.0);
+ context->line_to (5.0, unity_loc + 0.5);
+ cairo_close_path(cr);
+ context->fill_preserve ();
+ context->stroke ();
+
+ context->move_to (girth - 1, unity_loc - 1.0);
+ context->line_to (girth - 1, unity_loc + 2.0);
+ context->line_to (girth - 5, unity_loc + 0.5);
+ cairo_close_path(cr);
+ context->fill_preserve ();
+ context->stroke ();
+ }
+ } else {
+ if ( unity_loc < w ){
+ context->move_to (unity_loc + 1.0, 1);
+ context->line_to (unity_loc - 2.0, 1);
+ context->line_to (unity_loc - 0.5, 5);
+ cairo_close_path(cr);
+ context->fill_preserve ();
+ context->stroke ();
+
+ context->move_to (unity_loc + 1.0, girth - 1);
+ context->line_to (unity_loc - 2.0, girth - 1);
+ context->line_to (unity_loc - 0.5, girth - 5);
+ cairo_close_path(cr);
+ context->fill_preserve ();
+ context->stroke ();
+ }
}
}
}