2022-10-01 22:02:11 +02:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
/*
|
2023-08-04 19:41:47 +02:00
|
|
|
* Prism Launcher - Minecraft Launcher
|
2022-10-01 22:02:11 +02:00
|
|
|
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, version 3.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "InstanceDelegate.h"
|
|
|
|
#include "InstanceList.h"
|
|
|
|
|
2023-08-22 16:17:44 +03:00
|
|
|
InstanceDelegate::InstanceDelegate(QObject* parent, int iconSize) : QStyledItemDelegate(parent), m_iconSize(iconSize) {}
|
2022-10-01 22:02:11 +02:00
|
|
|
|
|
|
|
void InstanceDelegate::initStyleOption(QStyleOptionViewItem* option, const QModelIndex& index) const
|
|
|
|
{
|
|
|
|
QStyledItemDelegate::initStyleOption(option, index);
|
2022-10-01 23:16:38 +02:00
|
|
|
if (index.column() == InstanceList::NameColumn) {
|
2022-10-02 11:40:30 +02:00
|
|
|
option->decorationSize = QSize(m_iconSize, m_iconSize);
|
2022-10-01 22:02:11 +02:00
|
|
|
}
|
2022-10-02 12:43:04 +02:00
|
|
|
}
|