RoundImageButton: add icon margins

pull/14/head
reionwong 5 years ago
parent 4766ef86c0
commit 7cd1c91c02

@ -30,7 +30,7 @@ FishUI.MenuPopupWindow {
Rectangle { Rectangle {
id: _background id: _background
anchors.fill: parent anchors.fill: parent
color: FishUI.Theme.backgroundColor color: FishUI.Theme.secondBackgroundColor
radius: windowHelper.compositing ? FishUI.Theme.hugeRadius : 0 radius: windowHelper.compositing ? FishUI.Theme.hugeRadius : 0
opacity: windowHelper.compositing ? 0.6 : 1 opacity: windowHelper.compositing ? 0.6 : 1

@ -26,6 +26,7 @@ Item {
id: control id: control
property var size: 32 property var size: 32
property var iconMargins: 0
height: size height: size
width: size width: size
@ -56,6 +57,7 @@ Item {
id: image id: image
objectName: "image" objectName: "image"
anchors.fill: parent anchors.fill: parent
anchors.margins: control.iconMargins
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
sourceSize: Qt.size(width, height) sourceSize: Qt.size(width, height)
cache: true cache: true

@ -296,7 +296,7 @@ Window {
} }
Item { Item {
width: FishUI.Units.smallSpacing width: _header.spacing
} }
} }
} }

@ -9,6 +9,13 @@ T.Button
implicitWidth: Math.max(background.implicitWidth, contentItem.implicitWidth + FishUI.Units.largeSpacing) implicitWidth: Math.max(background.implicitWidth, contentItem.implicitWidth + FishUI.Units.largeSpacing)
implicitHeight: background.implicitHeight implicitHeight: background.implicitHeight
hoverEnabled: true hoverEnabled: true
scale: control.pressed ? 0.95 : 1.0
Behavior on scale {
NumberAnimation {
duration: 100
}
}
property color hoveredColor: Qt.tint(FishUI.Theme.textColor, Qt.rgba(FishUI.Theme.backgroundColor.r, property color hoveredColor: Qt.tint(FishUI.Theme.textColor, Qt.rgba(FishUI.Theme.backgroundColor.r,
FishUI.Theme.backgroundColor.g, FishUI.Theme.backgroundColor.g,

Loading…
Cancel
Save