fix: undeclared list_view identifier and setAlphaF double-to-float

Signed-off-by: Mythrax <mythrax@mythrax-rs.org>
This commit is contained in:
Mythrax
2026-04-04 13:12:29 +10:00
parent 63985a61e2
commit b57795d319
5 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -123,7 +123,7 @@ void GameDetailsPanel::setupUI() {
connect(pulse, &QVariantAnimation::valueChanged, this, [icon_glow](const QVariant& value) {
const QString hex = QString::fromStdString(UISettings::values.accent_color.GetValue());
QColor accent = QColor(hex).isValid() ? QColor(hex) : QColor(0, 150, 255);
accent.setAlphaF(0.2 + (value.toReal() / 50.0));
accent.setAlphaF(static_cast<float>(0.2 + (value.toReal() / 50.0)));
icon_glow->setColor(accent);
icon_glow->setBlurRadius(value.toReal());
});
+1 -1
View File
@@ -113,7 +113,7 @@ void GameGridDelegate::PaintGridItem(QPainter* painter, const QStyleOptionViewIt
if (is_selected) {
QColor glow = AccentColor();
glow.setAlphaF(0.2);
glow.setAlphaF(0.2f);
painter->save();
painter->setBrush(glow);
painter->setPen(Qt::NoPen);
+7 -7
View File
@@ -1179,15 +1179,15 @@ GameList::GameList(std::shared_ptr<FileSys::VfsFilesystem> vfs_,
#ifndef __linux__
// On non-Linux platforms, also update game icon size and repaint grid view
UISettings::values.game_icon_size.SetValue(static_cast<u32>(value));
if (list_view->isVisible()) {
QAbstractItemModel* current_model = list_view->model();
if (grid_view->isVisible()) {
QAbstractItemModel* current_model = grid_view->model();
if (current_model && current_model != item_model) {
QStandardItemModel* flat_model = qobject_cast<QStandardItemModel*>(current_model);
if (flat_model) {
const u32 icon_size = static_cast<u32>(value);
list_view->setGridSize(QSize(icon_size + 60, icon_size + 80));
int scroll_position = list_view->verticalScrollBar()->value();
QModelIndex current_index = list_view->currentIndex();
grid_view->view()->setGridSize(QSize(icon_size + 60, icon_size + 80));
int scroll_position = grid_view->view()->verticalScrollBar()->value();
QModelIndex current_index = grid_view->currentIndex();
for (int i = 0; i < flat_model->rowCount(); ++i) {
QStandardItem* item = flat_model->item(i);
@@ -1236,10 +1236,10 @@ GameList::GameList(std::shared_ptr<FileSys::VfsFilesystem> vfs_,
}
}
if (scroll_position >= 0) {
list_view->verticalScrollBar()->setValue(scroll_position);
grid_view->view()->verticalScrollBar()->setValue(scroll_position);
}
if (current_index.isValid() && current_index.row() < flat_model->rowCount()) {
list_view->setCurrentIndex(flat_model->index(current_index.row(), 0));
grid_view->setCurrentIndex(flat_model->index(current_index.row(), 0));
}
}
} else {
+1 -1
View File
@@ -416,7 +416,7 @@ void GameListDelegate::PaintBackground(QPainter* painter, const QStyleOptionView
float pulse_width_extra = is_selected ? (0.2f + (float)pulse * 0.8f) : 0.0f;
if (is_selected) {
border_color.setAlphaF(0.3 + (pulse * 0.7));
border_color.setAlphaF(static_cast<float>(0.3 + (pulse * 0.7)));
}
painter->setPen(QPen(border_color, 1.2f + pulse_width_extra));
+2 -2
View File
@@ -117,8 +117,8 @@ void CinematicCarousel::paintEvent(QPaintEvent* event) {
const bool focal = std::abs(i - m_focal_index) < 0.5;
if (focal) {
p.save(); QColor acc = AccentColor(); qreal pulse = (std::sin(m_pulse_tick * 0.1) + 1.0) / 2.0;
if (m_has_focus) { p.setPen(QPen(acc, 4.5 + pulse * 1.5)); acc.setAlphaF(0.12 + pulse * 0.08); p.setBrush(acc); }
else { acc.setAlphaF(0.4); p.setPen(QPen(acc, 3.0)); p.setBrush(Qt::NoBrush); }
if (m_has_focus) { p.setPen(QPen(acc, 4.5 + pulse * 1.5)); acc.setAlphaF(static_cast<float>(0.12 + pulse * 0.08)); p.setBrush(acc); }
else { acc.setAlphaF(0.4f); p.setPen(QPen(acc, 3.0)); p.setBrush(Qt::NoBrush); }
p.drawPath(path); p.restore();
// Draw the alphabetical header ONLY when it changes (category boundary)