Browse Source

Fix typo

adaptive-webui-19844
Chocobo1 4 years ago
parent
commit
6d399f0303
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 14
      src/gui/properties/piecesbar.cpp
  2. 2
      src/gui/properties/piecesbar.h

14
src/gui/properties/piecesbar.cpp

@ -154,7 +154,7 @@ void PiecesBar::enterEvent(QEvent *e)
void PiecesBar::leaveEvent(QEvent *e) void PiecesBar::leaveEvent(QEvent *e)
{ {
m_hovered = false; m_hovered = false;
m_highlitedRegion = QRect(); m_highlightedRegion = {};
requestImageUpdate(); requestImageUpdate();
base::leaveEvent(e); base::leaveEvent(e);
} }
@ -183,11 +183,11 @@ void PiecesBar::paintEvent(QPaintEvent *)
painter.drawImage(imageRect, m_image); painter.drawImage(imageRect, m_image);
} }
if (!m_highlitedRegion.isNull()) if (!m_highlightedRegion.isNull())
{ {
QColor highlightColor {this->palette().color(QPalette::Active, QPalette::Highlight)}; QColor highlightColor {this->palette().color(QPalette::Active, QPalette::Highlight)};
highlightColor.setAlphaF(0.35); highlightColor.setAlphaF(0.35);
QRect targetHighlightRect {m_highlitedRegion.adjusted(borderWidth, borderWidth, borderWidth, height() - 2 * borderWidth)}; QRect targetHighlightRect {m_highlightedRegion.adjusted(borderWidth, borderWidth, borderWidth, height() - 2 * borderWidth)};
painter.fillRect(targetHighlightRect, highlightColor); painter.fillRect(targetHighlightRect, highlightColor);
} }
@ -316,15 +316,15 @@ void PiecesBar::highlightFile(int imagePos)
ImageRange imageRange = transform.imagePos(filePieces); ImageRange imageRange = transform.imagePos(filePieces);
QRect newHighlitedRegion {imageRange.first(), 0, imageRange.size(), m_image.height()}; QRect newHighlitedRegion {imageRange.first(), 0, imageRange.size(), m_image.height()};
if (newHighlitedRegion != m_highlitedRegion) if (newHighlitedRegion != m_highlightedRegion)
{ {
m_highlitedRegion = newHighlitedRegion; m_highlightedRegion = newHighlitedRegion;
update(); update();
} }
} }
else if (!m_highlitedRegion.isEmpty()) else if (!m_highlightedRegion.isEmpty())
{ {
m_highlitedRegion = QRect(); m_highlightedRegion = {};
update(); update();
} }
} }

2
src/gui/properties/piecesbar.h

@ -96,5 +96,5 @@ private:
// buffered 256 levels gradient from bg_color to piece_color // buffered 256 levels gradient from bg_color to piece_color
QVector<QRgb> m_pieceColors; QVector<QRgb> m_pieceColors;
bool m_hovered = false; bool m_hovered = false;
QRect m_highlitedRegion; //!< part of the bar can be highlighted; this rectangle is in the same frame as m_image QRect m_highlightedRegion; // part of the bar can be highlighted; this rectangle is in the same frame as m_image
}; };

Loading…
Cancel
Save