+
    Ki  c                   s\    ^ RI Ht ^ RIHtHtHtHtHtHt  ! R R]P                  4      t
R# )i    )Gtk)	ICON_SIZEget_default_icon_pathget_pixbuf_by_pathget_required_pixbuf_by_pathget_runtime_icon_pathhas_stock_iconc                   s   a a ] tR t^t oRtR tV 3R lt]R
R l4       t]RR l4       t	]RR l4       t
R tR tR tR	tVtV ;t# )ScaledImagezThis class provides a rather basic feature the GtkImage doesn't offer - the ability
to scale the image rendered. Scaling a pixbuf is not the same thing - that discards
pixel data. This will preserve it on high-DPI displays by scaling only at drawing time.c                s4   < \         SV `  ! V/ VB  Wn        R # N)Zsuper__init__scale_factor)selfr
   ZargsZkwargs	__class__s   &&*,D/usr/lib/python3.14/site-packages/lutris/gui/widgets/scaled_image.pyr	   ZScaledImage.__init__   s    $)&)(    c                s    V'       d!   V^ ,          V,          V^,          V,          3MRp\        W4      p\        ^V,          4      pVP                  V4       V# )a  Constructs an image showing the image at the path, scaled to the size given.
The scale factor is used to scale up the pixbuf, but scale down the image so
a higher-res image can be shown in the same space on a High-DPI screen. You
pass your widget's get_scale_factor() here.N)r   r   set_from_pixbuf)pathsizepreserve_aspect_ratior
   pixbuf_sizepixbufimages   &&&&   r   new_scaled_from_pathZ ScaledImage.new_scaled_from_path   sS     KOtAw-tAw/EFTX,T?A,-f%r   c                s    V^ ,          V,          V^,          V,          3p\        W4      pV'       g   \        V4      p\        WSRR7      p\        ^V,          4      pVP	                  V4       V# )a)  Constructs an image showing Lutris media, read from the path, scaled to the
size given, as with new_scaled_from_path().

However, if the path is not readable, this will substitute a default icon
or banner. If 'size' is square, you get the icon; if not it is a gradient
filling the full size given.F)r   )r   r   r   r   r   )r   r   r
   r   r   Zdefault_iconr   s   &&&    r   new_from_media_pathZScaledImage.new_from_media_path%   sf     Aw-tAw/EF#D606L0bghFA,-f%r   c                s   \        V 4      pV'       d   \        P                  V\        VR7      pMK\	        V4      '       g   Rp\
        P                  P                  V\
        P                  P                  4      pVP                  V4       V# )a*  Returns a ScaledImage of an icon for runtime or service; the image has the
default icon size. If the icon can't be found, we'll fall back onto another,
stock icon. If you don't supply one (or it's not available) we'll fall back
further to 'package-x-generic-symbolic'; we always give you something.)r   r
   zpackage-x-generic-symbolic)r   r   r   r   r   r    ImageZnew_from_icon_nameZIconSizeZDNDZset_visible)Z	icon_nameZfallback_stock_icon_namer
   Zvisibler   Zicons   &&&&  r   get_runtime_icon_imageZ"ScaledImage.get_runtime_icon_image9   so     %Y/33DyWc3dD!":;;+G(99//0H#,,JZJZ[D!r   c                    \         P                  P                  V 4      w  rWP                  ,          W P                  ,          3# r   )r    r   do_get_preferred_widthr
   r   ZminimumZnatural   &  r   r   Z"ScaledImage.do_get_preferred_widthK   s6    99;;DA***G6G6G,GGGr   c                r   r   )r    r   do_get_preferred_heightr
   r   r   r   r   Z#ScaledImage.do_get_preferred_heightO   s6    99<<TB***G6G6G,GGGr   c                sh   V P                   ^8w  d   V P                  4       pVP                  ^,          pVP                  ^,          pVP	                  W44       VP                  V P                   V P                   4       VP	                  V) V) 4       \        P                  P                  W4       R# )   N)	r
   Zget_allocationZwidthZheightZ	translateZscaler    r   do_draw)r   ZcrZ
allocationZcenter_xZcenter_ys   &&   r   r    ZScaledImage.do_drawS   s    ! ,,.J!''!+H!((1,HLL,HHT&&(9(9:LL(XI.		$#r   )r
   )NTr   )r   )Nr   F)Z__name__Z
__module__Z__qualname__Z__firstlineno__Z__doc__Z__gtype_name__r	   Zstaticmethodr   r   r   r   r   r    Z__static_attributes__Z__classdictcell__Z__classcell__)r   Z__classdict__s   @@r   r   r      si     _ #N) 
 
  &  "HH$ $r   r   N)Zgi.repositoryr    Zlutris.gui.widgets.utilsr   r   r   r   r   r   r   r   ) r   r   <module>r!      s$     S$#)) S$r   