Exemplo n.º 1
0
    def pixelMetric(self, QStyle_PixelMetric, option=None, widget=None):

        if QStyle_PixelMetric == QStyle.PM_SmallIconSize:
            return 24
        else:
            return QProxyStyle.pixelMetric(self, QStyle_PixelMetric, option,
                                           widget)
Exemplo n.º 2
0
    def pixelMetric(self, metric, opt=None, widget=None):

        if metric in (QStyle.PM_ButtonShiftVertical,
                      QStyle.PM_ButtonShiftHorizontal,
                      QStyle.PM_MenuBarPanelWidth, QStyle.PM_ToolBarItemMargin,
                      QStyle.PM_ToolBarItemSpacing):
            return 0
        elif metric in (QStyle.PM_MenuPanelWidth, QStyle.PM_MenuBarHMargin,
                        QStyle.PM_MenuBarVMargin, QStyle.PM_ToolBarFrameWidth,
                        QStyle.PM_SplitterWidth):
            return 1

        return QProxyStyle.pixelMetric(self, metric, opt, widget)
Exemplo n.º 3
0
    def pixelMetric(self, style_pixel_metric, option=None, widget=None):
        """Applies custom metric to button icons.

        :param self: self
        :param style_pixel_metric: type of element
        :param option: metric options
        :param widget: widget containing element
        :returns: metric for element
        """
        if style_pixel_metric == QStyle.PM_ButtonIconSize:
            return 200
        else:
            return QProxyStyle.pixelMetric(self, style_pixel_metric, option, widget)
Exemplo n.º 4
0
 def pixelMetric(self, metric, option, widget):
     if metric == QProxyStyle.PM_TextCursorWidth:
         if self.cursor_width > 0:
             return self.cursor_width
     return QProxyStyle.pixelMetric(self, metric, option, widget)
Exemplo n.º 5
0
 def pixelMetric(self, qt_pixel_metric_style, option=None, widget=None):
     if qt_pixel_metric_style == QStyle.PM_ToolBarIconSize:
         return 40
     else:
         return QProxyStyle.pixelMetric(self, qt_pixel_metric_style, option,
                                        widget)
Exemplo n.º 6
0
 def pixelMetric(self,
                 metric,
                 style_option: QStyleOption = None,
                 widget=None) -> int:
     """TODO"""
     return QProxyStyle.pixelMetric(self, metric, style_option, widget)
Exemplo n.º 7
0
 def pixelMetric(self, QStyle_PixelMetric, option=None, widget=None):
     if QStyle_PixelMetric == QStyle.PM_ToolBarIconSize:
         return 40
     else:
         return QProxyStyle.pixelMetric(self, QStyle_PixelMetric, option, widget)