Create custom button icon component

This commit is contained in:
Angela Mazzurco 2017-06-08 19:08:41 +02:00
parent cb96b9fac6
commit 66d63c29b3
2 changed files with 88 additions and 0 deletions

View File

@ -0,0 +1,27 @@
import QtQuick 2.0
Item {
id: root
signal clicked
// signal pressed
// signal released
property var imgUrl: ""
Image {
anchors.fill: parent
source: imgUrl
height: parent.height
width: parent.width
}
MouseArea {
anchors.fill: root
onClicked: { root.clicked() }
// onPressed: { root.pressed() }
// onReleased: { root.released() }
}
}

View File

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
height="80"
style="enable-background:new 0 0 110 110;"
version="1.0"
viewBox="0 0 110 110"
width="80"
xml:space="preserve"
id="svg2"
inkscape:version="0.91 r13725"
sodipodi:docname="attach.svg"><metadata
id="metadata20"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
id="defs18" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1009"
id="namedview16"
showgrid="false"
inkscape:zoom="3.0341309"
inkscape:cx="-75.947202"
inkscape:cy="16.755676"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" /><g
id="Artboard" /><g
inkscape:groupmode="layer"
id="layer1"
inkscape:label="Layer 1"
style="display:inline"><circle
id="circle6"
style="fill:#039bd5;fill-opacity:1"
r="55"
cy="55"
cx="55" /><path
style="fill:#000000;fill-opacity:0.15686275"
sodipodi:nodetypes="ccccccccccsasccsccccccccccccccsasccccccccccc"
id="use4188"
d="m 32.658016,88.493222 c -3.615848,8.28e-4 -7.263315,-1.424329 -10.041357,-4.202659 -2.77944,-2.779018 -4.205861,-6.427875 -4.204884,-10.04303 -0.0049,-3.403438 1.278081,-6.83375 3.862101,-9.413455 l 0.593216,-0.593494 35.641173,-35.642841 c 3.391596,-3.396336 7.894417,-5.081409 12.383162,-5.075283 4.771078,-0.002 9.594249,1.87938 13.276261,5.560136 3.678385,3.680194 5.559013,8.500861 5.558044,13.271665 0.0042,4.490277 -1.679643,8.991979 -5.075281,12.385393 -10.716723,10.715527 -20.64003,20.648354 -29.983159,29.721144 -1.137853,1.104931 -3.354856,1.236196 -4.391767,0.200648 -1.067827,-1.066425 -1.137299,-3.218296 0.200684,-4.522981 9.420341,-9.185906 29.722264,-29.852779 29.722264,-29.852779 2.153348,-2.157945 3.224312,-4.981261 3.229331,-7.9316 -4.97e-4,-3.126264 -1.22794,-6.331216 -3.714323,-8.818435 -2.48722,-2.488056 -5.693845,-3.714325 -8.821914,-3.716554 -2.949092,0.0058 -5.771848,1.076122 -7.928541,3.230447 L 27.31921,68.693496 26.726551,69.286573 c -1.343545,1.346615 -2.011143,3.098819 -2.016991,4.960511 0.002,1.972136 0.773588,4.003619 2.360607,5.591332 1.585346,1.583812 3.615429,2.354624 5.587991,2.356842 1.861408,-0.0058 3.613479,-0.673018 4.961066,-2.016569 L 62.839621,54.959584 64.95174,52.847599 c 0.506025,-0.509784 0.757852,-1.157881 0.76273,-1.899994 0,-0.782361 -0.304758,-1.604703 -0.959542,-2.259626 -0.656167,-0.656451 -1.478649,-0.960092 -2.260316,-0.962322 -0.741838,0.0064 -1.388963,0.258657 -1.899442,0.765517 0,0 -17.740223,17.818894 -20.832589,21.018568 -1.223513,1.265969 -3.596261,1.141861 -4.639005,3e-6 -1.036591,-1.135117 -0.92155,-3.247964 0.417589,-4.592681 3.215314,-3.228707 20.59883,-20.877036 20.59883,-20.877036 1.744968,-1.750676 4.072705,-2.616475 6.354335,-2.610904 2.425928,-0.002 4.864259,0.956613 6.715226,2.80674 1.845669,1.848595 2.803537,4.284834 2.803537,6.711885 0.0049,2.28024 -0.859952,4.607559 -2.608679,6.353359 l -2.112816,2.111986 -25.22026,25.220118 c -2.576358,2.578305 -5.997345,3.860847 -9.393545,3.860151 l -0.01975,-1.41e-4 0,0 z"
inkscape:connector-curvature="0" /><path
inkscape:connector-curvature="0"
d="m 32.658016,86.241133 c -3.615848,8.27e-4 -7.263315,-1.424329 -10.041357,-4.202659 -2.77944,-2.779019 -4.205861,-6.427875 -4.204884,-10.043031 -0.0049,-3.403437 1.278081,-6.83375 3.862101,-9.413456 l 0.593216,-0.593494 35.641173,-35.642841 c 3.391596,-3.396336 7.894417,-5.081408 12.383162,-5.075281 4.771078,-0.002 9.594249,1.879379 13.276261,5.560134 3.678385,3.680195 5.559013,8.500863 5.558044,13.271665 0.0042,4.490278 -1.679643,8.991981 -5.075281,12.385394 -10.716723,10.715526 -20.64003,20.648355 -29.983159,29.721144 -1.137853,1.10493 -3.354856,1.236196 -4.391767,0.200647 -1.067827,-1.066424 -1.137299,-3.218295 0.200684,-4.522981 9.420341,-9.185904 29.722264,-29.852778 29.722264,-29.852778 2.153348,-2.157945 3.224312,-4.981262 3.229331,-7.9316 -4.97e-4,-3.126264 -1.22794,-6.331217 -3.714323,-8.818435 -2.48722,-2.488056 -5.693845,-3.714325 -8.821914,-3.716555 -2.949092,0.0058 -5.771848,1.076123 -7.928541,3.230448 L 27.31921,66.441405 26.726551,67.034482 c -1.343545,1.346615 -2.011143,3.098821 -2.016991,4.960512 0.002,1.972136 0.773588,4.003619 2.360607,5.591331 1.585346,1.583813 3.615429,2.354624 5.587991,2.356843 1.861408,-0.0058 3.613479,-0.673017 4.961066,-2.01657 L 62.839621,52.707493 64.95174,50.595508 c 0.506025,-0.509784 0.757852,-1.15788 0.76273,-1.899994 0,-0.78236 -0.304758,-1.604703 -0.959542,-2.259625 -0.656167,-0.656452 -1.478649,-0.960092 -2.260316,-0.962321 -0.741838,0.0064 -1.388963,0.258655 -1.899442,0.765515 0,0 -17.740223,17.818896 -20.832589,21.01857 -1.223513,1.265968 -3.596261,1.14186 -4.639005,3e-6 -1.036591,-1.135118 -0.92155,-3.247965 0.417589,-4.592682 3.215314,-3.228708 20.59883,-20.877037 20.59883,-20.877037 1.744968,-1.750675 4.072705,-2.616473 6.354335,-2.610903 2.425928,-0.002 4.864259,0.956612 6.715226,2.806741 1.845669,1.848594 2.803537,4.284833 2.803537,6.711884 0.0049,2.28024 -0.859952,4.607558 -2.608679,6.353358 l -2.112816,2.111987 -25.22026,25.220118 c -2.576358,2.578306 -5.997345,3.860847 -9.393545,3.860151 l -0.01975,-1.4e-4 0,0 z"
id="path3"
sodipodi:nodetypes="ccccccccccsasccsccccccccccccccsasccccccccccc"
style="fill:#ffffff;fill-opacity:1" /></g></svg>

After

Width:  |  Height:  |  Size: 6.0 KiB