Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-126124

Material style Button has extra padding when text property has a value but display is IconOnly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.5.7, 6.7.3, 6.8.0 Beta2, 6.9.0 FF
    • 6.7.1
    • Quick: Controls 2
    • None
    • Operating System: openSUSE Tumbleweed 20240531
      KDE Plasma Version: 6.0.5
      KDE Frameworks Version: 6.2.0
      Qt Version: 6.7.1
      Kernel Version: 6.9.3-1-default (64-bit)
      Graphics Platform: Wayland
    • Linux/Wayland
    • bffee8b06 (dev), 41a517ebf (6.8), 218653b05 (6.7), b896fe22f (tqtc/lts-6.5)

    Description

      Run the following code:

      Button {
          id: button1
          text: "Play"
          icon.name: "media-playback-start"
          display: AbstractButton.IconOnly
      }
      Button {
          anchors.left: button1.right
          icon.name: "media-playback-start"
          display: AbstractButton.IconOnly
       }
      

      The first button has extra right-padding.

      The fix is probably here: https://invent.kde.org/qt/qt/qtdeclarative/-/blob/dev/src/quickcontrols/material/Button.qml?ref_type=heads#L22

      - Material.buttonRightPadding(flat, hasIcon, text !== "")
      + Material.buttonRightPadding(flat, hasIcon, text !== "" && display !== T.AbstractButton.IconOnly)
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            mhqanbari MohammadHossein Qanbari
            jackh Jack Hill
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews