Warning, /education/kstars/kstars/kstarslite/qml/modules/helpers/BottomMenuButton.qml is written in an unsupported language. File is not indexed.
0001 // SPDX-FileCopyrightText: 2016 Artem Fedoskin <afedoskin3@gmail.com> 0002 // SPDX-License-Identifier: GPL-2.0-or-later 0003 0004 import QtQuick 2.7 0005 import QtQuick.Controls 2.0 0006 import "../../constants/" 1.0 0007 0008 AbstractButton { 0009 id: button 0010 property string iconSrc: "" 0011 width: icon.width + 5 0012 height: icon.height + 5 0013 0014 Image { 0015 id: icon 0016 source: iconSrc 0017 width: sourceSize.width/Num.pixelRatio 0018 height: sourceSize.height/Num.pixelRatio 0019 anchors.centerIn: iconRect 0020 } 0021 0022 background: Rectangle { 0023 id: iconRect 0024 radius: 5 0025 anchors { 0026 //centerIn: parent 0027 fill: parent 0028 } 0029 color: "black" 0030 border { 0031 color: Num.sysPalette.light 0032 width: 1 0033 } 0034 } 0035 0036 onDownChanged: { 0037 if(down) opacity = 0.6 0038 else opacity = 1 0039 } 0040 0041 onPressed: { 0042 opacity = 0.6 0043 } 0044 0045 onReleased: { 0046 opacity = 1 0047 } 0048 0049 Behavior on opacity { 0050 OpacityAnimator { duration: 100 } 0051 } 0052 }