
    G@d/                     v   d Z ddlZddlZddlZddlZddlmZ ddlZ	ddl
mZ ddlmZ ej        dk    Zej        dk    Z G d d	          Z G d
 de          Z e            Z G d de          Z G d de          Z e            Z e            Z G d de          Z e            Z G d d          ZdS )z"Custom stylesheets used in Spyder.    N)parse)OLD_PYQT)QStylePalettedarwinntc                   6    e Zd ZdZd Zd Zd Zd Zd Zd Z	dS )	SpyderStyleSheetz"Base class for Spyder stylesheets.c                 t    t           j                                        | _        |                                  d S N)	qstylizerstyle
StyleSheet_stylesheetset_stylesheetselfs    7lib/python3.11/site-packages/spyder/utils/stylesheet.py__init__zSpyderStyleSheet.__init__"   s0    $?5577    c                     | j         S r   )r   r   s    r   get_stylesheetzSpyderStyleSheet.get_stylesheet&   s    r   c                 4    | j                                         S r   )r   toStringr   s    r   	to_stringzSpyderStyleSheet.to_string)   s    ((***r   c                 *    t          j        |           S )zo
        Return a copy of the sytlesheet.

        This allows it to be modified for specific widgets.
        )copydeepcopyr   s    r   get_copyzSpyderStyleSheet.get_copy,   s     }T"""r   c                      t          d          )NzkSubclasses need to implement this method to set the _stylesheet attribute as a Qstylizer StyleSheet object.)NotImplementedErrorr   s    r   r   zSpyderStyleSheet.set_stylesheet4   s    !:
 
 	
r   c                 *    |                                  S )z`
        Get a string representation of the stylesheet object this class
        holds.
        )r   r   s    r   __str__zSpyderStyleSheet.__str__:   s    
 ~~r   N)
__name__
__module____qualname____doc__r   r   r   r   r   r"    r   r   r	   r	      st        ,,       + + +# # #
 
 
         r   r	   c                   4     e Zd ZdZ fdZd Zd Zd Z xZS )AppStylesheetzX
    Class to build and access the stylesheet we use in the entire
    application.
    c                 V    t                                                       d | _        d S r   )superr   _stylesheet_as_string)r   	__class__s    r   r   zAppStylesheet.__init__K   s'    %)"""r   c                 Z    | j         | j                                        | _         | j         S )z-Save stylesheet as a string for quick access.)r,   r   r   r   s    r   r   zAppStylesheet.to_stringO   s+    %-)-)9)B)B)D)DD&))r   c                     t          j        t                    }t          |          | _        |                                  dS )zi
        This takes the stylesheet from QDarkstyle and applies our
        customizations to it.
        )paletteN)
qdarkstyleload_stylesheetr   parse_stylesheetr   _customize_stylesheet)r   
stylesheets     r   r   zAppStylesheet.set_stylesheetU   sA    
  /FFF
+J77 	""$$$$$r   c                    | j         }|d                             dd           |d                             d           |d                             d           |j                            ddd           |d	                             dd
           |d                             ddd           |d                             ddd           t          r|d                             d           |d                             d           |j                            d           dD ]!}|d|                              d           "dD ]}||                              d            dD ]@}|dk    rt
          j        }nt
          j        }|d|                              |           A|d                             d           |d                             d            d!S )"z+Apply our customizations to the stylesheet.QStackedWidget0px)borderpaddingzQToolButton:pressed)marginzQMenuBar::item:pressed)r:   )borderBottomr:   spacingz!QMainWindow::separator:horizontal)	marginTopmarginBottomzQMainWindow::separator:vertical3px)
marginLeftmarginRightheightzQMenu::itemz1.4emz0.7emz4px 24px 4px 8px)rC   fontSizer:   z4px 24px 4px 28pxzQMenu#checkbox-padding::item)disabledcheckedzchecked:disabledzQPushButton:)QToolButtonzQToolButton:disabledtransparentbackgroundColorhoverpressedrF   zchecked:hoverrL   zQToolButton:zQDialog QPushButtonz3px 15px 3px 15pxz%QDialogButtonBox QPushButton:!defaultz3px 0px 3px 0pxN)r   	setValuesQToolBarr   QPushButtonr   COLOR_BACKGROUND_2COLOR_BACKGROUND_3)r   cssstateelementcolors        r   r4   z#AppStylesheet._customize_stylesheet`   s    	'' 	( 	
 	
 	
 	!",, 	- 	
 	
 	

 	$%// 	0 	
 	
 	

 	 	 	
 	
 	
 	/0:: 	; 	
 	
 	

 	-.88 	9 	
 	
 	
 	M$$& 	% 	
 	
 	
  	((+ )    	*+55' 	6 	
 	
 	

 	!! 	" 	
 	
 	
 A 	 	E&u&&'11 2     ? 	 	G7'' - (     F 	 	E%8%8&u&&'11 % 2    
 	!",,' 	- 	
 	
 	
 	34>>% 	? 	
 	
 	
 	
 	
r   )	r#   r$   r%   r&   r   r   r   r4   __classcell__r-   s   @r   r)   r)   E   sv         
* * * * ** * *	% 	% 	%]
 ]
 ]
 ]
 ]
 ]
 ]
r   r)   c                   (    e Zd ZdZdZdZdZdZd ZdS )ApplicationToolbarStylesheetz$Stylesheet for application toolbars.z2.7emz0.25emc                    | j         }|j                            t          j                   |j                            | j        | j        | j        | j        dd           dD ]@}|dk    rt          j	        }nt          j
        }|d|                              |           A|d                             d	           d S )
NrI   r8   )widthrC   rA   rB   r9   r:   rK   rL   zQToolBar QToolButton:z$QToolBar QToolButton::menu-indicatornoneimage)r   rO   rN   r   COLOR_BACKGROUND_4rG   BUTTON_WIDTHBUTTON_HEIGHTBUTTON_MARGIN_RIGHTCOLOR_BACKGROUND_5COLOR_BACKGROUND_6)r   rS   rT   rV   s       r   r   z+ApplicationToolbarStylesheet.set_stylesheet   s    	)< 	 	
 	
 	

 	!!#%/0 	" 	
 	
 	
 F 	 	E%8%8///0:: % ;    
 	23== 	> 	
 	
 	
 	
 	
r   N)	r#   r$   r%   r&   ra   rb   BUTTON_MARGIN_LEFTrc   r   r'   r   r   rZ   rZ      s?        ..LM!"
 
 
 
 
r   rZ   c                        e Zd ZdZdZdZd ZdS )PanesToolbarStyleSheetzStylesheet for pane toolbars.z2.2emc                     | j         }|j                            d           |j                            | j        | j        dd           |d                             d           d S )Nz0.3em)r=   r8   )rC   r\   r9   r;   zQToolButton::menu-indicatorr]   r^   )r   rO   rN   rG   rb   ra   )r   rS   s     r   r   z%PanesToolbarStyleSheet.set_stylesheet   s     	 	
 	
 	
 	!!%#	 	" 	
 	
 	
 	)*44 	5 	
 	
 	
 	
 	
r   N)r#   r$   r%   r&   ra   rb   r   r'   r   r   rh   rh      s3        ''LM
 
 
 
 
r   rh   c                   &     e Zd ZdZdZ fdZ xZS )PanesTabBarStyleSheetzStylesheet for pane tabbarsz0.8emc                    t                                                       |                                 }|j                            t
          rdnd           |d                             | j        ddt          rdndt          rdnd           t          r9|j                            dd	           |d
                             d           n$|j                            t
          rdnd           |d                             ddt          rdndt          rdnd           dD ]6}|d|                              ddt          rdndt          rdnd           7|d                             t          rdnd           |d                             t          j
        ddt          j
                    dD ]@}|dk    rt          j        }nt          j        }|d|                              |           At          s|d                             d            |d!                             d"           |d#                             dd$%           |d&                             dd$t
          rdnd'           d S )(Nz-3pxz-1px)rA   zQTabBar::tab4px10px)r>   
paddingToppaddingBottompaddingLeftpaddingRightleft)	alignmentrA   zQTabWidget::tab-bar)rt   zQTabBar::tab:hoverr@   9px)ro   rp   rq   rr   )selectedzselected:hoverzQTabBar::tab:zQTabBar::close-buttonz-5pxz-6px)rp   zQTabBar#pane-tabbar QToolButtonr8   z0.3em solid )
backgroundborderRadiusborderRightrK   rL   z QTabBar#pane-tabbar QToolButton:)rw   zQTabBar::scrollerz4.0em)r\   zQTabWidget::pane)	borderTopzQTabWidget::left-cornerz-2px)topbottomzQTabWidget::right-corner)r{   r|   right)r+   r   r   rO   rN   WIN
TOP_MARGINMACQTabBarr   COLOR_BACKGROUND_1rQ   rR   r   )r   rS   rT   rV   r-   s       r   r   z$PanesTabBarStyleSheet.set_stylesheet  s_      !!## 	!$0vv& 	 	
 	
 	
 	N%%o!$0&#&1E 	& 	
 	
 	
  	 K!! ! "   
 %&00  1    
 K!!%(466f "    	 !++!$/%"%05	 	, 	
 	
 	
 4 	 	E'''(22 #%(4EEf'*5VV	 3     	#$..$'3&&V 	/ 	
 	
 	

 	-.88$7I}'GII 	9 	
 	
 	
 F 	 	E%8%8:5::;EE  F    
  	#$.. /   
 	)) 	* 	
 	
 	

 	%&00 	1 	
 	
 	

 	&'11+&&V 	2 	
 	
 	
 	
 	
r   )r#   r$   r%   r&   r   r   rW   rX   s   @r   rk   rk     sN        %% Jd
 d
 d
 d
 d
 d
 d
 d
 d
r   rk   c                   F    e Zd ZdZdZerdndZerdndZerdndZerdnd	Z	d
S )DialogStylez1Style constants for tour, about and kite dialogs.g      ?19pt14pt15pt12pt13pt6pxz4px 10pxN)
r#   r$   r%   r&   IconScaleFactorr   TitleFontSizeContentFontSizeButtonsFontSizeButtonsPaddingr'   r   r   r   r     sQ        ;;O!-FFvM #/ffO #/ffO!1UUzNNNr   r   )r&   r   ossysr1   qstylizer.parserr   r3   qstylizer.styler   spyder.config.guir   spyder.utils.paletter   platformr   namer~   r	   r)   APP_STYLESHEETrZ   rh   APP_TOOLBAR_STYLESHEETPANES_TOOLBAR_STYLESHEETrk   PANES_TABBAR_STYLESHEETr   r'   r   r   <module>r      s   ) (  				 



     6 6 6 6 6 6     ' & & & & & . . . . . . 
lhgo                       Lx
 x
 x
 x
 x
$ x
 x
 x
v 
&
 &
 &
 &
 &
#3 &
 &
 &
R
 
 
 
 
- 
 
 
4 6577 1133 k
 k
 k
 k
 k
2 k
 k
 k
\ 0/11 2 2 2 2 2 2 2 2 2 2r   