初步重构

This commit is contained in:
2026-07-23 17:06:07 +08:00
parent 4d4b7f5599
commit 4530cd3fbe
15 changed files with 187 additions and 187 deletions
@@ -17,13 +17,13 @@ void CustomFileDelegate::paint(QPainter* painter, const QStyleOptionViewItem& op
QIcon fileIcon = model->fileIcon(index); // 文件/文件夹图标
// 设置选中和未选中背景颜色
QColor backgroundColor = fileInfo.isDir() ? QColor(220, 240, 255) : QColor(255, 255, 220); // 文件夹和文件的不同背景色
QColor background_color = fileInfo.isDir() ? QColor(220, 240, 255) : QColor(255, 255, 220); // 文件夹和文件的不同背景色
if (option.state & QStyle::State_Selected) {
backgroundColor = QColor(0, 120, 215); // 选中的背景色
background_color = QColor(0, 120, 215); // 选中的背景色
}
// 绘制背景
painter->fillRect(option.rect, backgroundColor);
painter->fillRect(option.rect, background_color);
// 设置文本颜色
QColor textColor = (option.state & QStyle::State_Selected) ? Qt::white : Qt::black;