change appearance of panner data popup slightly (fixed width font so it doesn't bounce around during edits), and make dbl-clicks to set pos to max-L or max-R work even if width is reversed

git-svn-id: svn://localhost/ardour2/branches/3.0@8746 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2011-02-07 17:28:37 +00:00
parent bf476d4a58
commit 9b17f35576
3 changed files with 14 additions and 11 deletions

View file

@ -84,12 +84,12 @@ style "medium_bold_text"
style "medium_text" style "medium_text"
{ {
font_name = "@FONT_NORMAL" font_name = "@FONT_NORMAL@"
} }
style "medium_monospace_text" style "medium_monospace_text"
{ {
#font_name = "monospace @FONT_NORMAL@" font_name = "monospace @FONT_NORMAL@"
} }
style "red_medium_text" = "medium_text" style "red_medium_text" = "medium_text"
@ -292,7 +292,7 @@ style "default" = "medium_text"
} }
} }
style "contrasting_popup" = "medium_text" style "contrasting_popup" = "medium_monospace_text"
{ {
bg[NORMAL] = @A_lightest bg[NORMAL] = @A_lightest
fg[NORMAL] = @A_darkest fg[NORMAL] = @A_darkest

View file

@ -105,9 +105,11 @@ MonoPanner::set_drag_data ()
the center of the USA isn't Kansas, its (50LA, 50NY) and it will all make sense. the center of the USA isn't Kansas, its (50LA, 50NY) and it will all make sense.
*/ */
drag_data_label->set_markup (string_compose (_("L:%1 R:%2"), char buf[64];
snprintf (buf, sizeof (buf), "L:%3d R:%3d",
(int) rint (100.0 * (1.0 - pos)), (int) rint (100.0 * (1.0 - pos)),
(int) rint (100.0 * pos))); (int) rint (100.0 * pos));
drag_data_label->set_markup (buf);
} }
void void

View file

@ -114,10 +114,11 @@ StereoPanner::set_drag_data ()
the center of the USA isn't Kansas, its (50LA, 50NY) and it will all make sense. the center of the USA isn't Kansas, its (50LA, 50NY) and it will all make sense.
*/ */
drag_data_label->set_markup (string_compose (_("L:%1 R:%2 Width: %3%%"), char buf[64];
(int) rint (100.0 * (1.0 - pos)), snprintf (buf, sizeof (buf), "L:%3d R:%3d Width:%d%%", (int) rint (100.0 * (1.0 - pos)),
(int) rint (100.0 * pos), (int) rint (100.0 * pos),
(int) floor (100.0 * width_control->get_value()))); (int) floor (100.0 * width_control->get_value()));
drag_data_label->set_markup (buf);
} }
void void
@ -312,7 +313,7 @@ StereoPanner::on_button_press_event (GdkEventButton* ev)
/* upper section: adjusts position, constrained by width */ /* upper section: adjusts position, constrained by width */
const double w = width_control->get_value (); const double w = fabs (width_control->get_value ());
const double max_pos = 1.0 - (w/2.0); const double max_pos = 1.0 - (w/2.0);
const double min_pos = w/2.0; const double min_pos = w/2.0;