1/**************************************************************************
2 **                                                                      **
3 ** Copyright (C) 2018 Lukas Spies                                       **
4 ** Contact: http://photoqt.org                                          **
5 **                                                                      **
6 ** This file is part of PhotoQt.                                        **
7 **                                                                      **
8 ** PhotoQt is free software: you can redistribute it and/or modify      **
9 ** it under the terms of the GNU General Public License as published by **
10 ** the Free Software Foundation, either version 2 of the License, or    **
11 ** (at your option) any later version.                                  **
12 **                                                                      **
13 ** PhotoQt is distributed in the hope that it will be useful,           **
14 ** but WITHOUT ANY WARRANTY; without even the implied warranty of       **
15 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        **
16 ** GNU General Public License for more details.                         **
17 **                                                                      **
18 ** You should have received a copy of the GNU General Public License    **
19 ** along with PhotoQt. If not, see <http://www.gnu.org/licenses/>.      **
20 **                                                                      **
21 **************************************************************************/
22
23import QtQuick 2.5
24import QtQuick.Controls.Styles 1.4
25
26import "../../elements"
27
28Item {
29
30    id: remember
31    anchors.right: prev.left
32    anchors.rightMargin: 10
33    y: 10
34    height: parent.height-20
35    width: but.width
36
37    CustomButton {
38
39        id: but
40        x: 0
41        width: height
42        height: parent.height
43        checkable: true
44        checked: settings.openKeepLastLocation
45
46        style: ButtonStyle {
47            background: Rectangle {
48                implicitWidth: remember.height
49                implicitHeight: remember.height
50                anchors.fill: parent
51                radius: 5
52                color: control.checked ? "#696969" : "#313131"
53                Image {
54                    opacity: control.checked ? 1: 0.2
55                    x: 3
56                    y: 3
57                    width: parent.width-6
58                    height: parent.height-6
59                    source: Qt.resolvedUrl("qrc:/img/openfile/remember.png")
60                }
61            }
62        }
63        ToolTip {
64            anchors.fill: parent
65            cursorShape: Qt.PointingHandCursor
66            acceptedButtons: Qt.RightButton|Qt.LeftButton
67            text: em.pty+qsTr("Remember current folder between sessions")
68            onClicked:
69                settings.openKeepLastLocation = !settings.openKeepLastLocation
70        }
71
72    }
73
74}
75