From 03c4b8da3cbfe6c290ebc8486c39d31562cd7b1c Mon Sep 17 00:00:00 2001 From: paul Date: Mon, 7 Feb 2011 17:28:37 +0000 Subject: [PATCH] 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: http://subversion.ardour.org/svn/ardour2/ardour2/branches/3.0@8746 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/ardour3_ui_dark.rc.in | 6 +++--- gtk2_ardour/mono_panner.cc | 8 +++++--- gtk2_ardour/stereo_panner.cc | 11 ++++++----- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/gtk2_ardour/ardour3_ui_dark.rc.in b/gtk2_ardour/ardour3_ui_dark.rc.in index bb280ae98..9c3ee9744 100644 --- a/gtk2_ardour/ardour3_ui_dark.rc.in +++ b/gtk2_ardour/ardour3_ui_dark.rc.in @@ -84,12 +84,12 @@ style "medium_bold_text" style "medium_text" { - font_name = "@FONT_NORMAL" + font_name = "@FONT_NORMAL@" } style "medium_monospace_text" { - #font_name = "monospace @FONT_NORMAL@" + font_name = "monospace @FONT_NORMAL@" } 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 fg[NORMAL] = @A_darkest diff --git a/gtk2_ardour/mono_panner.cc b/gtk2_ardour/mono_panner.cc index 9627f8710..5500d6f55 100644 --- a/gtk2_ardour/mono_panner.cc +++ b/gtk2_ardour/mono_panner.cc @@ -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. */ - drag_data_label->set_markup (string_compose (_("L:%1 R:%2"), - (int) rint (100.0 * (1.0 - pos)), - (int) rint (100.0 * pos))); + char buf[64]; + snprintf (buf, sizeof (buf), "L:%3d R:%3d", + (int) rint (100.0 * (1.0 - pos)), + (int) rint (100.0 * pos)); + drag_data_label->set_markup (buf); } void diff --git a/gtk2_ardour/stereo_panner.cc b/gtk2_ardour/stereo_panner.cc index 4889f0234..53f143d2d 100644 --- a/gtk2_ardour/stereo_panner.cc +++ b/gtk2_ardour/stereo_panner.cc @@ -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. */ - drag_data_label->set_markup (string_compose (_("L:%1 R:%2 Width: %3%%"), - (int) rint (100.0 * (1.0 - pos)), - (int) rint (100.0 * pos), - (int) floor (100.0 * width_control->get_value()))); + char buf[64]; + snprintf (buf, sizeof (buf), "L:%3d R:%3d Width:%d%%", (int) rint (100.0 * (1.0 - pos)), + (int) rint (100.0 * pos), + (int) floor (100.0 * width_control->get_value())); + drag_data_label->set_markup (buf); } void @@ -312,7 +313,7 @@ StereoPanner::on_button_press_event (GdkEventButton* ev) /* 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 min_pos = w/2.0; -- 2.11.4.GIT