mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-19 20:06:09 +01:00
[Summary] Involving canvas-var "meter highlight background" into the fastmeter;
Removing horizontal/vertical extra-shade from the highlighted state of meter.
This commit is contained in:
parent
b46544f564
commit
db9244b7f2
3 changed files with 16 additions and 16 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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<Cairo::Pattern>
|
||||
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<Cairo::Pattern> 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<Cairo::Pattern>
|
||||
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<Cairo::Pattern> 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 ();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,9 +118,9 @@ private:
|
|||
static Cairo::RefPtr<Cairo::Pattern> generate_meter_background (
|
||||
int, int, int *, bool, bool);
|
||||
static Cairo::RefPtr<Cairo::Pattern> request_vertical_background (
|
||||
int, int, int *, bool);
|
||||
int, int, int *);
|
||||
static Cairo::RefPtr<Cairo::Pattern> request_horizontal_background (
|
||||
int, int, int *, bool);
|
||||
int, int, int *);
|
||||
|
||||
struct Pattern10MapKey {
|
||||
Pattern10MapKey (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue