diff --git a/src/playlist/playlistview.cpp b/src/playlist/playlistview.cpp index 443cc5272..b43e60f53 100644 --- a/src/playlist/playlistview.cpp +++ b/src/playlist/playlistview.cpp @@ -214,6 +214,9 @@ PlaylistView::PlaylistView(QWidget *parent) dynamic_controls_->hide(); + // To proper scale all pixmaps + device_pixel_ratio_ = devicePixelRatioF(); + // For fading connect(fade_animation_, SIGNAL(valueChanged(qreal)), SLOT(FadePreviousBackgroundImage(qreal))); fade_animation_->setDirection(QTimeLine::Backward); // 1.0 -> 0.0 @@ -557,7 +560,8 @@ void PlaylistView::UpdateCachedCurrentRowPixmap(QStyleOptionViewItem option, con cached_current_row_row_ = idx.row(); option.rect.moveTo(0, 0); - cached_current_row_ = QPixmap(option.rect.size()); + cached_current_row_ = QPixmap(option.rect.width() * device_pixel_ratio_, option.rect.height() * device_pixel_ratio_); + cached_current_row_.setDevicePixelRatio(device_pixel_ratio_); cached_current_row_.fill(Qt::transparent); QPainter p(&cached_current_row_); @@ -1023,7 +1027,8 @@ void PlaylistView::paintEvent(QPaintEvent *event) { if (drop_indicator_row_ != -1) { if (cached_tree_.isNull()) { - cached_tree_ = QPixmap(size()); + cached_tree_ = QPixmap(size().width() * device_pixel_ratio_, size().height() * device_pixel_ratio_); + cached_tree_.setDevicePixelRatio(device_pixel_ratio_); cached_tree_.fill(Qt::transparent); QPainter cache_painter(&cached_tree_); diff --git a/src/playlist/playlistview.h b/src/playlist/playlistview.h index c685ad02a..7c24cc96c 100644 --- a/src/playlist/playlistview.h +++ b/src/playlist/playlistview.h @@ -220,6 +220,7 @@ class PlaylistView : public QTreeView { Playlist *playlist_; PlaylistHeader *header_; + qreal device_pixel_ratio_; AppearanceSettingsPage::BackgroundImageType background_image_type_; QString background_image_filename_; AppearanceSettingsPage::BackgroundImagePosition background_image_position_;