Skip to content
Verified Commit f1f19f81 authored by ivan tkachenko's avatar ivan tkachenko 🗯
Browse files

Delegates: Set padding values in a smarter way

QtQuick.Controls 2.5 (Qt 5.12) introduced a new pair of properties in
the padding inheritance chain: verticalPadding & horizontalPadding.
Binding more generic properties in the QQC2 style implementation both
makes for less code, more efficient implementation, and allows custom
client components to overrides those horizontal/vertical values and get
a correct behavior.
parent f598cb9a
Pipeline #386034 passed with stage
in 1 minute and 46 seconds
  • ivan tkachenko 🗯 @ratijas

    mentioned in commit cbfdc357

    ·

    mentioned in commit cbfdc357

    Toggle commit list
  • Developer

    What about

    verticaLpadding: Kirigami.Settings.tabletMode ? Kirigami.Units.largeSpacing : Kirigami.Units.smallSpacing
    horizontalPadding: (Kirigami.Settings.tabletMode ? Kirigami.Units.largeSpacing : Kirigami.Units.smallSpacing) * 2

    or

    verticaLpadding: Kirigami.Settings.tabletMode ? Kirigami.Units.largeSpacing : Kirigami.Units.smallSpacing
    horizontalPadding: verticalPadding * 2
  • Author Developer

    verticaLpadding: Kirigami.Settings.tabletMode ? Kirigami.Units.largeSpacing : Kirigami.Units.smallSpacing

    why intentionally breaking inheritance promise?

    horizontalPadding: verticalPadding * 2

    this one is just not correct (:

0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment