diff options
| author | luigi1111 <luigi1111w@gmail.com> | 2019-04-25 13:05:54 -0500 |
|---|---|---|
| committer | luigi1111 <luigi1111w@gmail.com> | 2019-04-25 13:05:54 -0500 |
| commit | fb4dfd0ea8a09999a7433e4d0d9ad1aa5009821d (patch) | |
| tree | cbbe7fc3e3950354f7a4dcb925b6e1e9dc62efd8 /components/IconButton.qml | |
| parent | 358e1d23facbd10fefbb2bf04c45b98f0c728ad0 (diff) | |
| parent | 42f7afaefddbf5a7929ddf88dbe7b27e7f40a669 (diff) | |
| download | monzero-gui-fb4dfd0ea8a09999a7433e4d0d9ad1aa5009821d.tar.gz monzero-gui-fb4dfd0ea8a09999a7433e4d0d9ad1aa5009821d.tar.xz monzero-gui-fb4dfd0ea8a09999a7433e4d0d9ad1aa5009821d.zip | |
Merge pull request #2060
42f7afa White theme (xmrdsc)
Diffstat (limited to 'components/IconButton.qml')
| -rw-r--r-- | components/IconButton.qml | 52 |
1 files changed, 15 insertions, 37 deletions
diff --git a/components/IconButton.qml b/components/IconButton.qml index ba6d1e94..5d4d8d19 100644 --- a/components/IconButton.qml +++ b/components/IconButton.qml @@ -26,55 +26,33 @@ // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +import QtQuick 2.9 +import "../components" as MoneroComponents +import "../components/effects" as MoneroEffects -import QtQuick 2.0 - -Item { - property alias image : buttonImage - property alias imageSource : buttonImage.source - - signal clicked(var mouse) - +MoneroEffects.ImageMask { id: button - width: parent.height - height: parent.height - anchors.right: parent.right - anchors.top: parent.top - anchors.bottom: parent.bottom + z: 666 + color: MoneroComponents.Style.defaultFontColor + image: "" - Image { - id: buttonImage - source: "" - x : (parent.width - width) / 2 - y : (parent.height - height) / 2 - z: 100 - } + signal clicked(var mouse) MouseArea { - id: buttonArea - anchors.fill: buttonImage + anchors.fill: parent hoverEnabled: true cursorShape: Qt.PointingHandCursor - onPressed: { - buttonImage.x = buttonImage.x + 2 - buttonImage.y = buttonImage.y + 2 - } - - onReleased: { - buttonImage.x = (parent.width - width) / 2 - buttonImage.y = (parent.height - height) / 2 + onEntered: { + button.width = button.width + 2 + button.height = button.height + 2 } onExited: { - if (pressed) { - buttonImage.x = (parent.width - width) / 2 - buttonImage.y = (parent.height - height) / 2 - } + button.width = button.width - 2 + button.height = button.height - 2 } - onClicked: { - parent.clicked(mouse) - } + onClicked: button.clicked(mouse) } } |
