Search code examples
androidqtqmlqtquick2qtquickcontrols2

Pressed (ripple) animation on button stops


I have a drawer, and indside it a button, which among others closes drawer. When I press button, the pressed animation starts, when it's clicked the drawer closes, and then animation (pressed animation) stops, so when I open again drawer button is partly highlighted. How can make it to continue animation?

Drawer {
     id: drawer
     width: 0.66 * parent.width
     height: parent.height

     background: Rectangle {
         color: "#212121"
         anchors.fill: parent
      }

     ColumnLayout {
         Button {
             onClicked: {
                 drawer.close()
             }
             text: "<font color=\"#ffffff\">Lorem</font>"
             implicitHeight: 60
             implicitWidth: drawer.width
             flat: true
             Material.theme: Material.Dark
             Material.elevation: 0
         }
     }
 }

Solution

  • I actually solved the problem with the ripple animation by changing Button.qml (in qt folder installation). In the Ripple element I changed control.Material.rippleColor for "transparent".