From db9244b7f2b05b91816e10fc51fcc451c2d9301f Mon Sep 17 00:00:00 2001 From: VKamyshniy Date: Thu, 26 Jun 2014 20:29:40 +0300 Subject: [PATCH] [Summary] Involving canvas-var "meter highlight background" into the fastmeter; Removing horizontal/vertical extra-shade from the highlighted state of meter. --- gtk2_ardour/level_meter.cc | 4 ++-- libs/gtkmm2ext/fastmeter.cc | 24 ++++++++++++------------ libs/gtkmm2ext/gtkmm2ext/fastmeter.h | 4 ++-- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/gtk2_ardour/level_meter.cc b/gtk2_ardour/level_meter.cc index ce62ed3782..b3dae8287b 100644 --- a/gtk2_ardour/level_meter.cc +++ b/gtk2_ardour/level_meter.cc @@ -268,8 +268,8 @@ LevelMeterBase::_setup_meters () int styleflags = Config->get_meter_style_led() ? 3 : 1; b[0] = ARDOUR_UI::config()->get_canvasvar_MeterBackgroundBot(); b[1] = ARDOUR_UI::config()->get_canvasvar_MeterBackgroundTop(); - b[2] = 0x991122ff; // red highlight gradient Bot - b[3] = 0x551111ff; // red highlight gradient Top + b[2] = ARDOUR_UI::config()->get_canvasvar_MeterHighlightBackgroundBot(); // red highlight gradient Bot + b[3] = ARDOUR_UI::config()->get_canvasvar_MeterHighlightBackgroundTop(); // red highlight gradient Top if (n < nmidi) { c[0] = ARDOUR_UI::config()->get_canvasvar_MidiMeterColor0(); c[1] = ARDOUR_UI::config()->get_canvasvar_MidiMeterColor1(); diff --git a/libs/gtkmm2ext/fastmeter.cc b/libs/gtkmm2ext/fastmeter.cc index a547f60bf7..5972779271 100644 --- a/libs/gtkmm2ext/fastmeter.cc +++ b/libs/gtkmm2ext/fastmeter.cc @@ -111,13 +111,13 @@ FastMeter::FastMeter (long hold, unsigned long dimen, Orientation o, int len, pixheight = len; pixwidth = dimen; fgpattern = request_vertical_meter(pixwidth, pixheight, _clr, _stp, _styleflags); - bgpattern = request_vertical_background (pixwidth, pixheight, _bgc, false); + bgpattern = request_vertical_background (pixwidth, pixheight, _bgc); } else { pixheight = dimen; pixwidth = len; fgpattern = request_horizontal_meter(pixwidth, pixheight, _clr, _stp, _styleflags); - bgpattern = request_horizontal_background (pixwidth, pixheight, _bgc, false); + bgpattern = request_horizontal_background (pixwidth, pixheight, _bgc); } pixrect.width = pixwidth; @@ -354,13 +354,13 @@ FastMeter::request_vertical_meter( Cairo::RefPtr FastMeter::request_vertical_background( - int width, int height, int *bgc, bool shade) + int width, int height, int *bgc) { height = max(height, min_pattern_metric_size); height = min(height, max_pattern_metric_size); height += 2; - const PatternBgMapKey key (width, height, bgc[0], bgc[1], shade); + const PatternBgMapKey key (width, height, bgc[0], bgc[1], false); PatternBgMap::iterator i; if ((i = vb_pattern_cache.find (key)) != vb_pattern_cache.end()) { return i->second; @@ -368,7 +368,7 @@ FastMeter::request_vertical_background( // TODO flush pattern cache if it gets too large Cairo::RefPtr p = generate_meter_background ( - width, height, bgc, shade, false); + width, height, bgc, false, false); vb_pattern_cache[key] = p; return p; @@ -402,13 +402,13 @@ FastMeter::request_horizontal_meter( Cairo::RefPtr FastMeter::request_horizontal_background( - int width, int height, int *bgc, bool shade) + int width, int height, int *bgc) { width = max(width, min_pattern_metric_size); width = min(width, max_pattern_metric_size); width += 2; - const PatternBgMapKey key (width, height, bgc[0], bgc[1], shade); + const PatternBgMapKey key (width, height, bgc[0], bgc[1], false); PatternBgMap::iterator i; if ((i = hb_pattern_cache.find (key)) != hb_pattern_cache.end()) { return i->second; @@ -416,7 +416,7 @@ FastMeter::request_horizontal_background( // TODO flush pattern cache if it gets too large Cairo::RefPtr p = generate_meter_background ( - height, width, bgc, shade, true); + height, width, bgc, false, true); hb_pattern_cache[key] = p; @@ -499,7 +499,7 @@ FastMeter::vertical_size_allocate (Gtk::Allocation &alloc) if (pixheight != h) { fgpattern = request_vertical_meter (request_width, h, _clr, _stp, _styleflags); - bgpattern = request_vertical_background (request_width, h, highlight ? _bgh : _bgc, highlight); + bgpattern = request_vertical_background (request_width, h, highlight ? _bgh : _bgc); pixheight = h; pixwidth = request_width; } @@ -524,7 +524,7 @@ FastMeter::horizontal_size_allocate (Gtk::Allocation &alloc) if (pixwidth != w) { fgpattern = request_horizontal_meter (w, request_height, _clr, _stp, _styleflags); - bgpattern = request_horizontal_background (w, request_height, highlight ? _bgh : _bgc, highlight); + bgpattern = request_horizontal_background (w, request_height, highlight ? _bgh : _bgc); pixwidth = w; pixheight = request_height; } @@ -893,9 +893,9 @@ FastMeter::set_highlight (bool onoff) } highlight = onoff; if (orientation == Vertical) { - bgpattern = request_vertical_background (pixwidth + 2, pixheight + 2, highlight ? _bgh : _bgc, highlight); + bgpattern = request_vertical_background (pixwidth + 2, pixheight + 2, highlight ? _bgh : _bgc); } else { - bgpattern = request_horizontal_background (pixwidth + 2, pixheight + 2, highlight ? _bgh : _bgc, highlight); + bgpattern = request_horizontal_background (pixwidth + 2, pixheight + 2, highlight ? _bgh : _bgc); } queue_draw (); } diff --git a/libs/gtkmm2ext/gtkmm2ext/fastmeter.h b/libs/gtkmm2ext/gtkmm2ext/fastmeter.h index 6802481777..c3b8e093aa 100644 --- a/libs/gtkmm2ext/gtkmm2ext/fastmeter.h +++ b/libs/gtkmm2ext/gtkmm2ext/fastmeter.h @@ -118,9 +118,9 @@ private: static Cairo::RefPtr generate_meter_background ( int, int, int *, bool, bool); static Cairo::RefPtr request_vertical_background ( - int, int, int *, bool); + int, int, int *); static Cairo::RefPtr request_horizontal_background ( - int, int, int *, bool); + int, int, int *); struct Pattern10MapKey { Pattern10MapKey (