How to use the kiwisolver.strength.required function in kiwisolver

To help you get started, we’ve selected a few kiwisolver examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nucleic / enaml / enaml / layout / spacers.py View on Github external
""" A spacer which represents a flexible space with a minimum value.

    """
    def constraints(self, first, second):
        """ A constraint of the form: (second - first) >= size

        """
        return [(second - first) >= self.size]


class FlexSpacer(Spacer):
    """ A spacer with a hard minimum and a preference for that minimum.

    """
    #: The strength for the minimum space constraint.
    min_strength = StrengthMember(kiwi.strength.required)

    #: The strength for the equality space constraint.
    eq_strength = StrengthMember(kiwi.strength.medium * 1.25)

    def __init__(self, size, min_strength=None, eq_strength=None):
        """ Initialize a FlexSpacer.

        Parameters
        ----------
        size : int
            The basic size of the spacer, in pixels >= 0.

        min_strength : strength-like, optional
            The strength to apply to the minimum spacer size. The
            default is kiwi.strength.required.

kiwisolver

A fast implementation of the Cassowary constraint solver

BSD-3-Clause
Latest version published 12 hours ago

Package Health Score

91 / 100
Full package analysis

Similar packages