aboutsummaryrefslogtreecommitdiff
path: root/qml/cover/CoverPage.qml
blob: 5b5af6c97fffbda5464139663f563e3b5eb78598 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import QtQuick 2.0
import Sailfish.Silica 1.0

CoverBackground {
    Column{
        x: Theme.paddingLarge
        y: Theme.paddingLarge
        width: parent.width - 2 * x
        spacing: Theme.paddingLarge
        Label {
            id: label
            text: qsTr("PassFish")
            color: Theme.highlightColor
            fontSizeMode: Text.Fit
            font.pixelSize: Theme.fontSizeLarge
            bottomPadding: Theme.paddingLarge
            width: parent.width
            elide: Text.ElideNone
        }
        Column{
            width: parent.width
            spacing: Theme.paddingSmall
            Label {
                id: urlLabel
                color: Theme.highlightColor
                text: qsTr("Used Text:")
                font.pixelSize: Theme.fontSizeSmall
                truncationMode: TruncationMode.Fade
                width: parent.width
            }
            Label {
                id: generated_for_url
                text: passwordmaker.used_text
                font.pixelSize: Theme.fontSizeSmall
                truncationMode: TruncationMode.Fade
                width: parent.width
            }
        }
        Column{
            width: parent.width
            spacing: Theme.paddingSmall
            Label {
                id: readyLabel
                color: Theme.highlightColor
                text: passwordmaker.generated_password.length > 0
                      && passwordmaker.generator_state === 0
                      ? qsTr("Pass Ready")
                      : qsTr("Input Needed")
                font.pixelSize: Theme.fontSizeSmall
                truncationMode: TruncationMode.Fade
                width: parent.width
            }
        }
    }

    CoverActionList {
        id: coverAction
        enabled: passwordmaker.generated_password.length > 0
                 && passwordmaker.generator_state === 0
        CoverAction {
            iconSource: "image://theme/icon-s-clipboard"
            onTriggered: Clipboard.text = passwordmaker.generated_password;
        }

        CoverAction {
            iconSource: "image://theme/icon-cover-cancel"
            onTriggered: {
                passwordmaker.master_password = "";
                passwordmaker.url = "";
            }
        }
    }
}