Просмотр исходного кода

Reduce icon size

Signed-off-by: amzn-mike <[email protected]>
amzn-mike 2 лет назад
Родитель
Сommit
c314cec864

+ 5 - 3
Code/Tools/AssetProcessor/native/ui/GoToButtonDelegate.cpp

@@ -26,14 +26,16 @@ namespace AssetProcessor
 
 
         if (index.data().canConvert<GoToButtonData>())
         if (index.data().canConvert<GoToButtonData>())
         {
         {
+            constexpr int MarginPX = 3;
+            auto marginRect = option.rect.marginsRemoved(QMargins(MarginPX, MarginPX, MarginPX, MarginPX));
+
             if (option.state & QStyle::State_MouseOver)
             if (option.state & QStyle::State_MouseOver)
             {
             {
-
-                m_hoverIcon.paint(painter, option.rect);
+                m_hoverIcon.paint(painter, marginRect);
             }
             }
             else
             else
             {
             {
-                m_icon.paint(painter, option.rect);
+                m_icon.paint(painter, marginRect);
             }
             }
         }
         }
     }
     }

+ 2 - 1
Code/Tools/AssetProcessor/native/ui/GoToButtonDelegate.h

@@ -44,7 +44,8 @@ namespace AssetProcessor
 
 
     protected:
     protected:
 
 
-        QIcon m_icon, m_hoverIcon;
+        QIcon m_icon;
+        QIcon m_hoverIcon;
     };
     };
 } // namespace AssetProcessor
 } // namespace AssetProcessor