Skip to content

Commit

Permalink
Merge remote-tracking branch 'mixxx/2.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
ronso0 committed Jan 20, 2024
2 parents e12415a + 5b1f477 commit 7ab1844
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion res/skins/Tango/skin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@
<SizePolicy>min,me</SizePolicy>
<Children>
<Template src="skins:Tango/mixer/vumeter_single.xml">
<SetVariable name="group">[Master]</SetVariable>
<SetVariable name="group">[Main]</SetVariable>
</Template>
<WidgetGroup><Size>0f,5f</Size></WidgetGroup>
<WidgetGroup>
Expand Down
26 changes: 17 additions & 9 deletions src/library/stareditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,23 @@ void StarEditor::paintEvent(QPaintEvent*) {
m_styleOption.state |= QStyle::State_MouseOver;
m_styleOption.rect = rect();

// If the editor cell is selected set the respective flag so we can use the
// palette's 'HighlightedText' font color for the brush StarRating will use
// to fill the star/diamond polygons with.
// Else, unset it and we use the regular color.
QItemSelectionModel* selectionModel = m_pTableView->selectionModel();
if (selectionModel && selectionModel->isSelected(m_index)) {
m_styleOption.state |= QStyle::State_Selected;
} else {
m_styleOption.state &= ~QStyle::State_Selected;
if (selectionModel) {
// If the editor cell is selected set the respective flag so we can use the
// palette's 'HighlightedText' font color for the brush StarRating will use
// to fill the star/diamond polygons with.
// Else, unset it and we use the regular color.
if (selectionModel->isSelected(m_index)) {
m_styleOption.state |= QStyle::State_Selected;
} else {
m_styleOption.state &= ~QStyle::State_Selected;
}
// Accordingly, un/set the focus flag.
if (selectionModel->currentIndex() == m_index) {
m_styleOption.state |= QStyle::State_HasFocus;
} else {
m_styleOption.state &= ~QStyle::State_HasFocus;
}
}

QPainter painter(this);
Expand Down Expand Up @@ -84,7 +92,7 @@ void StarEditor::paintEvent(QPaintEvent*) {
m_starRating.paint(&painter, m_styleOption.rect);

// Draw a border if the color cell is selected
if (m_styleOption.state & QStyle::State_Selected) {
if (m_styleOption.state & QStyle::State_HasFocus) {
TableItemDelegate::drawBorder(&painter, m_pFocusBorderColor, m_styleOption.rect);
}
}
Expand Down

0 comments on commit 7ab1844

Please sign in to comment.