diff --git a/ui/filemanageview/fileview.cpp b/ui/filemanageview/fileview.cpp index ca693c2..57036f1 100644 --- a/ui/filemanageview/fileview.cpp +++ b/ui/filemanageview/fileview.cpp @@ -157,14 +157,18 @@ void FileView::changeFontSize(double fontSize) { m_listItemHeight = m_listItemHeight + ((fontSize - m_fontSize) * 2); m_fontSize = fontSize; - updateViewMode(); if (m_downloadBtn != nullptr) { m_downloadBtn->changeFontSize(m_fontSize); } QFont font; font.setPointSizeF(fontSize); setFont(font); - update(); + updateViewMode(); +} + +double FileView::getFontSize() const +{ + return m_fontSize; } void FileView::setItemMode(FileView::ItemSelectMode mode, bool isClear) diff --git a/ui/filemanageview/fileview.h b/ui/filemanageview/fileview.h index 0696719..417c061 100644 --- a/ui/filemanageview/fileview.h +++ b/ui/filemanageview/fileview.h @@ -41,6 +41,7 @@ public: void setTheme(PublicAttributes::Theme theme); PublicAttributes::Theme getTheme() const; void changeFontSize(double fontSize); + double getFontSize() const; void setItemMode(FileView::ItemSelectMode mode, bool isClear = false); FileView::ItemSelectMode getItemMode() const; void setThumbnailType(ThumbnailType type); diff --git a/ui/filemanageview/fileviewdelegate.cpp b/ui/filemanageview/fileviewdelegate.cpp index 74e794c..6a1d080 100644 --- a/ui/filemanageview/fileviewdelegate.cpp +++ b/ui/filemanageview/fileviewdelegate.cpp @@ -28,6 +28,11 @@ FileViewDelegate::~FileViewDelegate() void FileViewDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { auto *view = qobject_cast(option.widget); + double fontSize = view->getFontSize(); + QFont font; + font.setPointSizeF(fontSize); + painter->setFont(font); + if (view->getItemMode() == FileView::ItemSelectMode::Default) { kdk::KListViewDelegate::paint(painter, option, index); } else {