Merge pull request #1174 from manongjohn/restore_current_column_indicator

Restore current column indicator
This commit is contained in:
manongjohn 2023-06-23 23:49:57 -04:00 committed by GitHub
commit fb3d710197
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 26 additions and 11 deletions

View file

@ -2086,7 +2086,7 @@ QWidget* PreferencesPopup::createXsheetPage() {
insertUI(syncLevelRenumberWithXsheet, lay);
insertUI(currentTimelineEnabled, lay);
}
// insertUI(currentColumnColor, lay);
insertUI(currentColumnColor, lay);
insertUI(currentCellColor, lay);
if (Preferences::instance()->isShowAdvancedOptionsEnabled())
insertUI(showFrameNumberWithLetters, lay);

View file

@ -592,7 +592,7 @@ void ChangeObjectHandle::refresh() {
int i;
QString str;
QColor colorHndHook = viewer->getPreviewFrameTextColor();
QColor colorHndDef = viewer->getSelectedColumnTextColor();
QColor colorHndDef = viewer->getColumnFocusColor();
QColor colorHndNone = viewer->getTextColor();
if (stageObject->getParent().isColumn()) {
for (i = 0; i < 20; i++) addText(str.number(20 - i), colorHndHook);
@ -1047,8 +1047,6 @@ void ColumnArea::DrawHeader::drawColumnNumber() const {
p.setPen(m_viewer->getVerticalLineColor());
if (o->flag(PredefinedFlag::LAYER_NUMBER_BORDER)) p.drawRect(pos);
// p.setPen((isCurrent) ? m_viewer->getSelectedColumnTextColor()
// : m_viewer->getTextColor());
p.setPen(m_viewer->getTextColor());
int valign = o->isVerticalTimeline() ? Qt::AlignVCenter : Qt::AlignBottom;
@ -1121,12 +1119,8 @@ void ColumnArea::DrawHeader::drawColumnName() const {
leftadj = 24;
}
// p.setPen((isCurrent) ? m_viewer->getSelectedColumnTextColor()
// : nameBacklit ? Qt::black : m_viewer->getTextColor());
p.setPen(nameBacklit ? Qt::black : m_viewer->getTextColor());
} else
// p.setPen((isCurrent) ? m_viewer->getSelectedColumnTextColor()
// : m_viewer->getTextColor());
p.setPen(m_viewer->getTextColor());
if (o->isVerticalTimeline() && col < 0) {
@ -1649,6 +1643,23 @@ void ColumnArea::drawLevelColumnHead(QPainter &p, int col) {
//-----------------------------------------------------------------------------
void ColumnArea::drawCurrentColumnFocus(QPainter &p, int col) {
const Orientation *o = m_viewer->orientation();
QPoint orig = m_viewer->positionToXY(CellPosition(0, col));
QRect rect = o->rect((col < 0) ? PredefinedRect::CAMERA_LAYER_NAME
: PredefinedRect::LAYER_NAME)
.translated(orig);
p.setPen(m_viewer->getColumnFocusColor());
p.setBrush(Qt::NoBrush);
for (int i = 0; i < 2; i++) // thick border within name area
p.drawRect(QRect(rect.topLeft() + QPoint(i, i),
rect.size() - QSize(2 * i, 2 * i)));
}
//-----------------------------------------------------------------------------
void ColumnArea::drawSoundColumnHead(QPainter &p, int col) { // AREA
TColumnSelection *selection = m_viewer->getColumnSelection();
const Orientation *o = m_viewer->orientation();
@ -1915,6 +1926,9 @@ void ColumnArea::paintEvent(QPaintEvent *event) { // AREA
else
p.drawRect(toBeUpdated.adjusted(0, 0, -2, -1));
// focus column border
drawCurrentColumnFocus(p, m_viewer->getCurrentColumn());
if (getDragTool()) getDragTool()->drawColumnsArea(p);
}

View file

@ -369,6 +369,7 @@ public:
void drawSoundColumnHead(QPainter &p, int col);
void drawPaletteColumnHead(QPainter &p, int col);
void drawSoundTextColumnHead(QPainter &p, int col);
void drawCurrentColumnFocus(QPainter &p, int col);
QPixmap getColumnIcon(int columnIndex);

View file

@ -1986,7 +1986,7 @@ void XsheetViewer::zoomOnFrame(int frame, int factor) {
m_rowArea->update();
}
QColor XsheetViewer::getSelectedColumnTextColor() const {
QColor XsheetViewer::getColumnFocusColor() const {
// get colors
TPixel currentColumnPixel;
Preferences::instance()->getCurrentColumnData(currentColumnPixel);

View file

@ -834,7 +834,7 @@ public:
QColor getEmptyColumnHeadColor() const { return m_emptyColumnHeadColor; }
// specified by preferences
QColor getSelectedColumnTextColor() const;
QColor getColumnFocusColor() const;
// Cell
void setEmptyCellColor(const QColor &color) { m_emptyCellColor = color; }

View file

@ -593,7 +593,7 @@ void Preferences::definePreferenceItems() {
define(currentTimelineEnabled, "currentTimelineEnabled", QMetaType::Bool,
true);
define(currentColumnColor, "currentColumnColor", QMetaType::QColor,
QColor(Qt::yellow));
QColor(Qt::cyan));
define(currentCellColor, "currentCellColor", QMetaType::QColor,
QColor(Qt::cyan));
// define(levelNameOnEachMarkerEnabled, "levelNameOnEachMarkerEnabled",