File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,10 +66,10 @@ void DQuickIconImagePrivate::init()
6666{
6767 D_Q (DQuickIconImage);
6868
69- if (iconType == ThemeIconName) {
70- // 强制确保图标的缩放比例正确
71- updateDevicePixelRatio (1.0 );
69+ // 强制确保图标的缩放比例正确
70+ updateDevicePixelRatio (1.0 );
7271
72+ if (iconType == ThemeIconName) {
7373 QObject::connect (DGuiApplicationHelper::instance ()->applicationTheme (), SIGNAL (iconThemeNameChanged (QByteArray)),
7474 q, SLOT (maybeUpdateUrl ()));
7575 // dtk build-in 类型的图标支持区分窗口主题色, 此处需在主题类型变化时更新图标
@@ -372,10 +372,8 @@ void DQuickIconImage::pixmapChange()
372372 // QQuickImage中只会在设置了souceSize的前提下才会计算图片自身的缩放比例
373373 // 此处强制确保图标的缩放比例正确
374374 D_D (DQuickIconImage);
375- if (d->iconType == DQuickIconImagePrivate::ThemeIconName) {
376- if (d->updateDevicePixelRatio (1.0 )) {
377- d->maybeUpdateUrl ();
378- }
375+ if (d->updateDevicePixelRatio (1.0 )) {
376+ d->maybeUpdateUrl ();
379377 }
380378
381379 QQuickImage::pixmapChange ();
You can’t perform that action at this time.
0 commit comments