spyder/utils/stylesheet.py
def _customize_stylesheet(self):
        """Apply our customizations to the stylesheet."""
        css = self._stylesheet

        # Remove padding and border for QStackedWidget (used in Plots
        # and the Variable Explorer)
        css['QStackedWidget'].setValues(
            border='0px',
            padding='0px',
        )

        # Remove margin when pressing buttons
        css["QToolButton:pressed"].setValues(
            margin='0px'
        )

        # Remove padding when pressing main menus
        css['QMenuBar::item:pressed'].setValues(
            padding='0px'
        )

        # Remove border, padding and spacing for main toolbar
        css.QToolBar.setValues(
            borderBottom='0px',
            padding='0px',
            spacing='0px',
        )

        # Remove margins around separators
        css['QMainWindow::separator:horizontal'].setValues(
            marginTop='0px',
            marginBottom='0px'
        )

        css['QMainWindow::separator:vertical'].setValues(
            marginLeft='0px',
            marginRight='0px',
            height='3px'
        )

        # Set menu item properties
        css["QMenu::item"].setValues(
            height='1.4em',
            fontSize='0.7em',
            padding='4px 24px 4px 8px',
            # TODO: This requires a fix in qstylizer
            # iconSize='0.8em'
        )

        if OLD_PYQT:
            css["QMenu::item"].setValues(
                padding='4px 24px 4px 28px',
            )

        css["QMenu#checkbox-padding::item"].setValues(
            padding='4px 24px 4px 28px',
        )

        # Increase padding for QPushButton's
        css.QPushButton.setValues(
            padding='3px',
        )

        for state in ['disabled', 'checked', 'checked:disabled']:
            css[f'QPushButton:{state}'].setValues(
                padding='3px',
            )

        # Adjust QToolButton style to our needs.
        # This affects not only the pane toolbars but also the
        # find/replace widget, the finder in the Variable Explorer,
        # and all QToolButton's that are not part of the main toolbar.
        for element in ['QToolButton', 'QToolButton:disabled']:
            css[f'{element}'].setValues(
                backgroundColor='transparent'
            )

        for state in ['hover', 'pressed', 'checked', 'checked:hover']:
            if state == 'hover':
                color = QStylePalette.COLOR_BACKGROUND_2
            else:
                color = QStylePalette.COLOR_BACKGROUND_3
            css[f'QToolButton:{state}'].setValues(
                backgroundColor=color
            )
Apply our customizations to the stylesheet.
Apply our customizations to the stylesheet.
Apply our customizations to the stylesheet .
def _customize_stylesheet(self):
        css = self._stylesheet
        css['QStackedWidget'].setValues(
            border='0px',
            padding='0px',
        )
        css["QToolButton:pressed"].setValues(
            margin='0px'
        )
        css['QMenuBar::item:pressed'].setValues(
            padding='0px'
        )
        css.QToolBar.setValues(
            borderBottom='0px',
            padding='0px',
            spacing='0px',
        )
        css['QMainWindow::separator:horizontal'].setValues(
            marginTop='0px',
            marginBottom='0px'
        )
        css['QMainWindow::separator:vertical'].setValues(
            marginLeft='0px',
            marginRight='0px',
            height='3px'
        )
        css["QMenu::item"].setValues(
            height='1.4em',
            fontSize='0.7em',
            padding='4px 24px 4px 8px',
        )
        if OLD_PYQT:
            css["QMenu::item"].setValues(
                padding='4px 24px 4px 28px',
            )
        css["QMenu#checkbox-padding::item"].setValues(
            padding='4px 24px 4px 28px',
        )
        css.QPushButton.setValues(
            padding='3px',
        )
        for state in ['disabled', 'checked', 'checked:disabled']:
            css[f'QPushButton:{state}'].setValues(
                padding='3px',
            )
        for element in ['QToolButton', 'QToolButton:disabled']:
            css[f'{element}'].setValues(
                backgroundColor='transparent'
            )
        for state in ['hover', 'pressed', 'checked', 'checked:hover']:
            if state == 'hover':
                color = QStylePalette.COLOR_BACKGROUND_2
            else:
                color = QStylePalette.COLOR_BACKGROUND_3
            css[f'QToolButton:{state}'].setValues(
                backgroundColor=color
            )
def _customize_stylesheet ( self ) : css = self . _stylesheet css [ 'QStackedWidget' ] . setValues ( border = '0px' , padding = '0px' , ) css [ "QToolButton:pressed" ] . setValues ( margin = '0px' ) css [ 'QMenuBar::item:pressed' ] . setValues ( padding = '0px' ) css . QToolBar . setValues ( borderBottom = '0px' , padding = '0px' , spacing = '0px' , ) css [ 'QMainWindow::separator:horizontal' ] . setValues ( marginTop = '0px' , marginBottom = '0px' ) css [ 'QMainWindow::separator:vertical' ] . setValues ( marginLeft = '0px' , marginRight = '0px' , height = '3px' ) css [ "QMenu::item" ] . setValues ( height = '1.4em' , fontSize = '0.7em' , padding = '4px 24px 4px 8px' , ) if OLD_PYQT : css [ "QMenu::item" ] . setValues ( padding = '4px 24px 4px 28px' , ) css [ "QMenu#checkbox-padding::item" ] . setValues ( padding = '4px 24px 4px 28px' , ) css . QPushButton . setValues ( padding = '3px' , ) for state in [ 'disabled' , 'checked' , 'checked:disabled' ] : css [ f'QPushButton:{state}' ] . setValues ( padding = '3px' , ) for element in [ 'QToolButton' , 'QToolButton:disabled' ] : css [ f'{element}' ] . setValues ( backgroundColor = 'transparent' ) for state in [ 'hover' , 'pressed' , 'checked' , 'checked:hover' ] : if state == 'hover' : color = QStylePalette . COLOR_BACKGROUND_2 else : color = QStylePalette . COLOR_BACKGROUND_3 css [ f'QToolButton:{state}' ] . setValues ( backgroundColor = color )
Apply our customizations to the stylesheet.
Apply our customizations to the stylesheet .
"""Apply our customizations to the stylesheet.""" # Remove padding and border for QStackedWidget (used in Plots # and the Variable Explorer) # Remove margin when pressing buttons # Remove padding when pressing main menus # Remove border, padding and spacing for main toolbar # Remove margins around separators # Set menu item properties # TODO: This requires a fix in qstylizer # iconSize='0.8em' # Increase padding for QPushButton's # Adjust QToolButton style to our needs. # This affects not only the pane toolbars but also the # find/replace widget, the finder in the Variable Explorer, # and all QToolButton's that are not part of the main toolbar.
self