add style sheet for sound column

This commit is contained in:
shun_iwasawa 2016-09-05 21:33:28 +09:00
parent 9cb1845f21
commit 74d63437e8
13 changed files with 99 additions and 21 deletions

View file

@ -946,6 +946,12 @@ XsheetViewer {
qproperty-MeshColumnBorderColor: rgb(186,146,239); qproperty-MeshColumnBorderColor: rgb(186,146,239);
qproperty-SelectedMeshColumnColor: rgb(138,117,162); qproperty-SelectedMeshColumnColor: rgb(138,117,162);
qproperty-SoundColumnColor: rgb(101,116,86);
qproperty-SoundColumnBorderColor: rgb(160,175,125);
qproperty-SelectedSoundColumnColor: rgb(127,149,106);
qproperty-SoundColumnHlColor: rgb(52,254,94);
qproperty-SoundColumnTrackColor: rgb(182,194,157);
qproperty-ColumnHeadPastelizer: rgb(0,0,0); qproperty-ColumnHeadPastelizer: rgb(0,0,0);
qproperty-SelectedColumnHead: rgb(80,96,130); qproperty-SelectedColumnHead: rgb(80,96,130);

View file

@ -954,6 +954,11 @@ XsheetViewer {
qproperty-MeshColumnColor: #684d86; qproperty-MeshColumnColor: #684d86;
qproperty-MeshColumnBorderColor: #ba92ef; qproperty-MeshColumnBorderColor: #ba92ef;
qproperty-SelectedMeshColumnColor: #8a75a2; qproperty-SelectedMeshColumnColor: #8a75a2;
qproperty-SoundColumnColor: #657456;
qproperty-SoundColumnBorderColor: #a0af7d;
qproperty-SelectedSoundColumnColor: #7f956a;
qproperty-SoundColumnHlColor: #34fe5e;
qproperty-SoundColumnTrackColor: #b6c29d;
qproperty-ColumnHeadPastelizer: #000000; qproperty-ColumnHeadPastelizer: #000000;
qproperty-SelectedColumnHead: #506082; qproperty-SelectedColumnHead: #506082;
qproperty-LightLightBGColor: #fafafa; qproperty-LightLightBGColor: #fafafa;

View file

@ -954,6 +954,11 @@ XsheetViewer {
qproperty-MeshColumnColor: #684d86; qproperty-MeshColumnColor: #684d86;
qproperty-MeshColumnBorderColor: #ba92ef; qproperty-MeshColumnBorderColor: #ba92ef;
qproperty-SelectedMeshColumnColor: #8a75a2; qproperty-SelectedMeshColumnColor: #8a75a2;
qproperty-SoundColumnColor: #657456;
qproperty-SoundColumnBorderColor: #a0af7d;
qproperty-SelectedSoundColumnColor: #7f956a;
qproperty-SoundColumnHlColor: #34fe5e;
qproperty-SoundColumnTrackColor: #b6c29d;
qproperty-ColumnHeadPastelizer: #000000; qproperty-ColumnHeadPastelizer: #000000;
qproperty-SelectedColumnHead: #506082; qproperty-SelectedColumnHead: #506082;
qproperty-LightLightBGColor: #fafafa; qproperty-LightLightBGColor: #fafafa;

View file

@ -946,6 +946,12 @@ XsheetViewer {
qproperty-MeshColumnBorderColor: rgb(186,146,239); qproperty-MeshColumnBorderColor: rgb(186,146,239);
qproperty-SelectedMeshColumnColor: rgb(138,117,162); qproperty-SelectedMeshColumnColor: rgb(138,117,162);
qproperty-SoundColumnColor: rgb(101,116,86);
qproperty-SoundColumnBorderColor: rgb(160,175,125);
qproperty-SelectedSoundColumnColor: rgb(127,149,106);
qproperty-SoundColumnHlColor: rgb(52,254,94);
qproperty-SoundColumnTrackColor: rgb(182,194,157);
qproperty-ColumnHeadPastelizer: rgb(0,0,0); qproperty-ColumnHeadPastelizer: rgb(0,0,0);
qproperty-SelectedColumnHead: rgb(80,96,130); qproperty-SelectedColumnHead: rgb(80,96,130);

View file

@ -954,6 +954,11 @@ XsheetViewer {
qproperty-MeshColumnColor: #684d86; qproperty-MeshColumnColor: #684d86;
qproperty-MeshColumnBorderColor: #ba92ef; qproperty-MeshColumnBorderColor: #ba92ef;
qproperty-SelectedMeshColumnColor: #8a75a2; qproperty-SelectedMeshColumnColor: #8a75a2;
qproperty-SoundColumnColor: #657456;
qproperty-SoundColumnBorderColor: #a0af7d;
qproperty-SelectedSoundColumnColor: #7f956a;
qproperty-SoundColumnHlColor: #34fe5e;
qproperty-SoundColumnTrackColor: #b6c29d;
qproperty-ColumnHeadPastelizer: #000000; qproperty-ColumnHeadPastelizer: #000000;
qproperty-SelectedColumnHead: #506082; qproperty-SelectedColumnHead: #506082;
qproperty-LightLightBGColor: #fafafa; qproperty-LightLightBGColor: #fafafa;

View file

@ -954,6 +954,11 @@ XsheetViewer {
qproperty-MeshColumnColor: #684d86; qproperty-MeshColumnColor: #684d86;
qproperty-MeshColumnBorderColor: #ba92ef; qproperty-MeshColumnBorderColor: #ba92ef;
qproperty-SelectedMeshColumnColor: #8a75a2; qproperty-SelectedMeshColumnColor: #8a75a2;
qproperty-SoundColumnColor: #657456;
qproperty-SoundColumnBorderColor: #a0af7d;
qproperty-SelectedSoundColumnColor: #7f956a;
qproperty-SoundColumnHlColor: #34fe5e;
qproperty-SoundColumnTrackColor: #b6c29d;
qproperty-ColumnHeadPastelizer: #000000; qproperty-ColumnHeadPastelizer: #000000;
qproperty-SelectedColumnHead: #506082; qproperty-SelectedColumnHead: #506082;
qproperty-LightLightBGColor: #fafafa; qproperty-LightLightBGColor: #fafafa;

View file

@ -782,6 +782,12 @@ XsheetViewer {
qproperty-MeshColumnBorderColor: rgb(105,70,135); qproperty-MeshColumnBorderColor: rgb(105,70,135);
qproperty-SelectedMeshColumnColor: rgb(216,180,245); qproperty-SelectedMeshColumnColor: rgb(216,180,245);
qproperty-SoundColumnColor: rgb(179,193,135);
qproperty-SoundColumnBorderColor: rgb(99,120,86);
qproperty-SelectedSoundColumnColor: rgb(215,215,180);
qproperty-SoundColumnHlColor: rgb(245,255,230);
qproperty-SoundColumnTrackColor: rgb(90,100,45);
qproperty-ColumnHeadPastelizer: rgb(255,255,255); qproperty-ColumnHeadPastelizer: rgb(255,255,255);
qproperty-SelectedColumnHead: rgb(190,210,240); qproperty-SelectedColumnHead: rgb(190,210,240);

View file

@ -701,6 +701,11 @@ XsheetViewer {
qproperty-MeshColumnColor: #c882ff; qproperty-MeshColumnColor: #c882ff;
qproperty-MeshColumnBorderColor: #694687; qproperty-MeshColumnBorderColor: #694687;
qproperty-SelectedMeshColumnColor: #d8b4f5; qproperty-SelectedMeshColumnColor: #d8b4f5;
qproperty-SoundColumnColor: #b3c187;
qproperty-SoundColumnBorderColor: #637856;
qproperty-SelectedSoundColumnColor: #d7d7b4;
qproperty-SoundColumnHlColor: #f5ffe6;
qproperty-SoundColumnTrackColor: #5a642d;
qproperty-ColumnHeadPastelizer: #ffffff; qproperty-ColumnHeadPastelizer: #ffffff;
qproperty-SelectedColumnHead: #bed2f0; qproperty-SelectedColumnHead: #bed2f0;
qproperty-LightLightBGColor: #fafafa; qproperty-LightLightBGColor: #fafafa;

View file

@ -701,6 +701,11 @@ XsheetViewer {
qproperty-MeshColumnColor: #c882ff; qproperty-MeshColumnColor: #c882ff;
qproperty-MeshColumnBorderColor: #694687; qproperty-MeshColumnBorderColor: #694687;
qproperty-SelectedMeshColumnColor: #d8b4f5; qproperty-SelectedMeshColumnColor: #d8b4f5;
qproperty-SoundColumnColor: #b3c187;
qproperty-SoundColumnBorderColor: #637856;
qproperty-SelectedSoundColumnColor: #d7d7b4;
qproperty-SoundColumnHlColor: #f5ffe6;
qproperty-SoundColumnTrackColor: #5a642d;
qproperty-ColumnHeadPastelizer: #ffffff; qproperty-ColumnHeadPastelizer: #ffffff;
qproperty-SelectedColumnHead: #bed2f0; qproperty-SelectedColumnHead: #bed2f0;
qproperty-LightLightBGColor: #fafafa; qproperty-LightLightBGColor: #fafafa;

View file

@ -923,22 +923,34 @@ void CellArea::drawSoundCell(QPainter &p, int row, int col) {
bool isSelected = cellSelection->isCellSelected(row, col) || bool isSelected = cellSelection->isCellSelected(row, col) ||
columnSelection->isColumnSelected(col); columnSelection->isColumnSelected(col);
// get cell colors
QColor cellColor, sideColor;
int levelType;
m_viewer->getCellTypeAndColors(levelType, cellColor, sideColor, cell,
isSelected);
// sfondo celle // sfondo celle
QRect backgroundRect = QRect(x + 1, y + 1, ColumnWidth - 1, RowHeight - 1); QRect backgroundRect = QRect(x + 1, y + 1, ColumnWidth - 1, RowHeight - 1);
p.fillRect(backgroundRect, QBrush((isSelected) ? SelectedSoundColumnColor p.fillRect(backgroundRect, cellColor);
: SoundColumnColor)); p.fillRect(QRect(x, y, 7, RowHeight), QBrush(sideColor));
if (isLastRow) {
QPainterPath path(QPointF(x, y));
path.lineTo(QPointF(x + 6, y));
path.lineTo(QPointF(x + 6, y + 2));
path.lineTo(QPointF(x, y + RowHeight - 2));
p.fillPath(path, QBrush(SoundColumnBorderColor));
} else
p.fillRect(QRect(x, y, 6, RowHeight), QBrush(SoundColumnBorderColor));
int x1 = rect.x() + 5; // draw dot line if the column is locked
if (soundColumn->isLocked()) {
p.setPen(QPen(cellColor, 2, Qt::DotLine));
p.drawLine(x + 3, y, x + 3, y + RowHeight);
}
// draw "end of the level"
if (isLastRow) {
QPainterPath path(QPointF(x, y + RowHeight));
path.lineTo(QPointF(x + 7, y + RowHeight));
path.lineTo(QPointF(x + 7, y + RowHeight - 7));
path.lineTo(QPointF(x, y + RowHeight));
p.fillPath(path, QBrush(cellColor));
}
int x1 = rect.x() + 6;
int x2 = rect.x() + rect.width(); int x2 = rect.x() + rect.width();
int x1Bis = x2 - 6; int x1Bis = x2 - 7;
int offset = row - cell.getFrameId().getNumber(); int offset = row - cell.getFrameId().getNumber();
int y0 = rect.y(); int y0 = rect.y();
@ -975,22 +987,22 @@ void CellArea::drawSoundCell(QPainter &p, int row, int col) {
if (i != y0 || !isFirstRow) { if (i != y0 || !isFirstRow) {
// trattini a destra della colonna // trattini a destra della colonna
if (i % 2) { if (i % 2) {
p.setPen((isSelected) ? SelectedSoundColumnColor : SoundColumnColor); p.setPen(cellColor);
p.drawLine(x1, i, x1Bis, i); p.drawLine(x1, i, x1Bis, i);
} else { } else {
p.setPen(SoundColumnTrackColor); p.setPen(m_viewer->getSoundColumnTrackColor());
p.drawLine(x1Bis + 1, i, x2, i); p.drawLine(x1Bis + 1, i, x2, i);
} }
} }
if (scrub && i % 2) { if (scrub && i % 2) {
p.setPen(SoundColumnHlColor); p.setPen(m_viewer->getSoundColumnHlColor());
p.drawLine(x1Bis + 1, i, x2, i); p.drawLine(x1Bis + 1, i, x2, i);
} }
if (i != y0) { if (i != y0) {
// "traccia audio" al centro della colonna // "traccia audio" al centro della colonna
p.setPen(SoundColumnTrackColor); p.setPen(m_viewer->getSoundColumnTrackColor());
p.drawLine(lastMin, i, min, i); p.drawLine(lastMin, i, min, i);
p.drawLine(lastMax, i, max, i); p.drawLine(lastMax, i, max, i);
} }

View file

@ -824,7 +824,11 @@ void ColumnArea::drawSoundColumnHead(QPainter &p, int col) {
} }
QColor pastelizer(m_viewer->getColumnHeadPastelizer()); QColor pastelizer(m_viewer->getColumnHeadPastelizer());
p.fillRect(rect, (isSelected) ? ColorSelection : pastelizer); pastelizer.setAlpha(50);
QColor colorSelection(m_viewer->getSelectedColumnHead());
colorSelection.setAlpha(170);
p.fillRect(rect, (isSelected) ? colorSelection : pastelizer);
int prevViewImgHeight = RowHeight - 5; int prevViewImgHeight = RowHeight - 5;
int prevViewImgWidth = prevViewImgHeight * 5 / 4; int prevViewImgWidth = prevViewImgHeight * 5 / 4;
@ -881,7 +885,7 @@ void ColumnArea::drawSoundColumnHead(QPainter &p, int col) {
QRect rr(rect.x() + 8, RowHeight * 2 + 3, rect.width() - 7, m_tabBox.y() - 3); QRect rr(rect.x() + 8, RowHeight * 2 + 3, rect.width() - 7, m_tabBox.y() - 3);
// suddivisioni slider // suddivisioni slider
p.setPen(Qt::black); p.setPen(m_viewer->getTextColor());
int xa = rr.x() + 7, ya = rr.y() + 4; int xa = rr.x() + 7, ya = rr.y() + 4;
int y = ya; int y = ya;
for (int i = 0; i <= 20; i++, y += 3) for (int i = 0; i <= 20; i++, y += 3)

View file

@ -92,9 +92,9 @@ void XsheetViewer::getCellTypeAndColors(int &ltype, QColor &cellColor,
sideColor = getChildColumnBorderColor(); sideColor = getChildColumnBorderColor();
break; break;
case SND_XSHLEVEL: case SND_XSHLEVEL:
cellColor = (isSelected) ? XsheetGUI::SelectedSoundColumnColor cellColor =
: XsheetGUI::SoundColumnColor; (isSelected) ? m_selectedSoundColumnColor : m_soundColumnColor;
sideColor = XsheetGUI::SoundColumnBorderColor; sideColor = m_soundColumnBorderColor;
break; break;
case SND_TXT_XSHLEVEL: case SND_TXT_XSHLEVEL:
cellColor = XsheetGUI::SoundTextColumnColor; cellColor = XsheetGUI::SoundTextColumnColor;

View file

@ -287,6 +287,17 @@ class XsheetViewer final : public QFrame, public Spreadsheet::FrameScroller {
setMeshColumnBorderColor) setMeshColumnBorderColor)
Q_PROPERTY(QColor SelectedMeshColumnColor READ getSelectedMeshColumnColor Q_PROPERTY(QColor SelectedMeshColumnColor READ getSelectedMeshColumnColor
WRITE setSelectedMeshColumnColor) WRITE setSelectedMeshColumnColor)
// Sound column
QColor m_soundColumnColor;
QColor m_soundColumnBorderColor;
QColor m_selectedSoundColumnColor;
QColor m_soundColumnHlColor;
QColor m_soundColumnTrackColor;
Q_PROPERTY(QColor SoundColumnColor MEMBER m_soundColumnColor)
Q_PROPERTY(QColor SoundColumnBorderColor MEMBER m_soundColumnBorderColor)
Q_PROPERTY(QColor SelectedSoundColumnColor MEMBER m_selectedSoundColumnColor)
Q_PROPERTY(QColor SoundColumnHlColor MEMBER m_soundColumnHlColor)
Q_PROPERTY(QColor SoundColumnTrackColor MEMBER m_soundColumnTrackColor)
// for making the column head lighter (255,255,255,50); // for making the column head lighter (255,255,255,50);
QColor m_columnHeadPastelizer; QColor m_columnHeadPastelizer;
@ -612,6 +623,9 @@ public:
QColor getSelectedMeshColumnColor() const { QColor getSelectedMeshColumnColor() const {
return m_selectedMeshColumnColor; return m_selectedMeshColumnColor;
} }
// Sound column
QColor getSoundColumnHlColor() const { return m_soundColumnHlColor; }
QColor getSoundColumnTrackColor() const { return m_soundColumnTrackColor; }
void setColumnHeadPastelizer(const QColor &color) { void setColumnHeadPastelizer(const QColor &color) {
m_columnHeadPastelizer = color; m_columnHeadPastelizer = color;