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/InlineButton.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/InlineButton.qml')
| -rw-r--r-- | components/InlineButton.qml | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/components/InlineButton.qml b/components/InlineButton.qml index 4741a701..5871a8ff 100644 --- a/components/InlineButton.qml +++ b/components/InlineButton.qml @@ -26,10 +26,12 @@ // 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.0 +import QtQuick 2.9 import QtQuick.Layouts 1.1 +import QtGraphicalEffects 1.0 -import "../components" as MoneroComponents +import "." as MoneroComponents +import "./effects/" as MoneroEffects Item { id: inlineButton @@ -43,9 +45,9 @@ Item { property string pressedColor: "#FF4304" property string releasedColor: "#FF6C3C" property string icon: "" - property string textColor: "black" + property string textColor: MoneroComponents.Style.inlineButtonTextColor property int fontSize: small ? 14 * scaleRatio : 16 * scaleRatio - property int rectHeight: small ? 24 * scaleRatio : 28 * scaleRatio + property int rectHeight: small ? 24 * scaleRatio : 24 * scaleRatio property int rectHMargin: small ? 16 * scaleRatio : 22 * scaleRatio property alias text: inlineText.text property alias fontPixelSize: inlineText.font.pixelSize @@ -61,16 +63,16 @@ Item { Rectangle{ id: rect - color: MoneroComponents.Style.buttonBackgroundColorDisabled - border.color: "black" - height: 28 * scaleRatio - width: inlineText.text ? (inlineText.width + 22) * scaleRatio : inlineButton.icon ? (inlineImage.width + 16) * scaleRatio : rect.height + color: MoneroComponents.Style.buttonInlineBackgroundColor + height: 24 * scaleRatio + width: inlineText.text ? (inlineText.width + 16) * scaleRatio : inlineButton.icon ? (inlineImage.width + 16) * scaleRatio : rect.height radius: 4 anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right + anchors.rightMargin: 4 * scaleRatio - Text { + MoneroComponents.TextPlain { id: inlineText font.family: MoneroComponents.Style.fontBold.name font.bold: true @@ -78,6 +80,13 @@ Item { color: inlineButton.textColor anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter + themeTransition: false + + MoneroEffects.ColorTransition { + targetObj: inlineText + blackColor: MoneroComponents.Style._b_inlineButtonTextColor + whiteColor: MoneroComponents.Style._w_inlineButtonTextColor + } } Image { @@ -104,6 +113,18 @@ Item { } } + DropShadow { + visible: !MoneroComponents.Style.blackTheme + anchors.fill: rect + horizontalOffset: 2 + verticalOffset: 2 + radius: 7.0 + samples: 10 + color: "#1B000000" + cached: true + source: rect + } + Keys.onSpacePressed: doClick() Keys.onReturnPressed: doClick() } |
