shade outside pattern

portability/macos
zetaPRIME 2019-07-20 01:14:45 -04:00
parent b65ce423a7
commit 8f55ef577b
3 changed files with 3 additions and 2 deletions

1
notes
View File

@ -32,7 +32,6 @@ parameters {
TODO {
immediate frontburner {
- spacer rows on top/bottom of pattern editor (keep centered)
non-hardcoded export path
reimplement sample import to IPC from standalone ffmpeg since QAudioDecoder is partially broken on arch and completely broken on macOS

View File

@ -10,6 +10,7 @@ namespace Xybrid::Config {
QColor patternSelection = {127, 63, 255, 63};
QColor patternFoldIndicator = {95, 95, 95};
QColor patternFoldShade = {0, 0, 0, 31};
QColor patternOuterShade = {0, 0, 0, 63};
QColor patternBg = {23, 23, 23};
QColor patternBgBeat = {31, 31, 31};

View File

@ -96,7 +96,8 @@ void PatternEditorItemDelegate::paint(QPainter *painter, const QStyleOptionViewI
auto p = mdl->getPattern();
{ /* background */ } {
painter->fillRect(option.rect, Config::colorScheme.patternBg);
if (p->fold > 1 && row >= 0 && row % p->fold != 0) painter->fillRect(option.rect, Config::colorScheme.patternFoldShade);
if (row == -1 || row >= p->rows) painter->fillRect(option.rect, Config::colorScheme.patternOuterShade);
else if (p->fold > 1 && row % p->fold != 0) painter->fillRect(option.rect, Config::colorScheme.patternFoldShade);
if (option.state & QStyle::State_Enabled) {
if (row % p->time.rowsPerMeasure() == 0) painter->fillRect(option.rect, Config::colorScheme.patternBgMeasure);
else if (row % p->time.rowsPerBeat == 0) painter->fillRect(option.rect, Config::colorScheme.patternBgBeat);