mirror of
https://github.com/QRouland/UTPass.git
synced 2025-06-29 16:52:29 +00:00
Add style command && applied new style format to existing code && setup tests plugins
This commit is contained in:
11
qml/Main.qml
11
qml/Main.qml
@ -6,7 +6,7 @@ import Gpg 1.0
|
||||
import "components"
|
||||
|
||||
MainView {
|
||||
id: root
|
||||
id: "root"
|
||||
objectName: "mainView"
|
||||
applicationName: "utpass.qrouland"
|
||||
|
||||
@ -18,7 +18,12 @@ MainView {
|
||||
id: pageStack
|
||||
anchors.fill: parent
|
||||
|
||||
Component.onCompleted: push(pageStack.push(Qt.resolvedUrl("pages/PasswordList.qml")))
|
||||
Component.onCompleted: push(pageStack.push(
|
||||
Qt.resolvedUrl(
|
||||
"pages/PasswordList.qml")))
|
||||
}
|
||||
Component.onCompleted: {
|
||||
Gpg.import_key("password-store/public.key")
|
||||
Gpg.get_all_keys_id()
|
||||
}
|
||||
Component.onCompleted: { Gpg.import_key("password-store/public.key"); Gpg.get_all_keys_id();}
|
||||
}
|
||||
|
@ -19,13 +19,18 @@ Component {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: units.gu(4)
|
||||
height: units.gu(4)
|
||||
name: fileIsDir ? "go-next" : "lock"
|
||||
name: fileIsDir ? "go-next" : "lock"
|
||||
color: Theme.raisin_black
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: { if (fileIsDir){ folderModel.folder = folderModel.folder + "/" + fileName ; backAction.visible = true;} }
|
||||
onClicked: {
|
||||
if (fileIsDir) {
|
||||
folderModel.folder = folderModel.folder + "/" + fileName
|
||||
backAction.visible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CustomBorder {
|
||||
@ -37,4 +42,4 @@ Component {
|
||||
borderColor: UbuntuColors.warmGrey
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,19 +3,19 @@ import Ubuntu.Components 1.3
|
||||
import "../styles"
|
||||
|
||||
Item {
|
||||
property string url
|
||||
property string text
|
||||
property string url
|
||||
property string text
|
||||
|
||||
property bool commonBorder : true
|
||||
property int lBorderwidth : 0
|
||||
property int rBorderwidth : 0
|
||||
property int tBorderwidth : 0
|
||||
property int bBorderwidth : 0
|
||||
property int commonBorderWidth : 0
|
||||
property string borderColor : UbuntuColors.warmGrey
|
||||
property bool commonBorder: true
|
||||
property int lBorderwidth: 0
|
||||
property int rBorderwidth: 0
|
||||
property int tBorderwidth: 0
|
||||
property int bBorderwidth: 0
|
||||
property int commonBorderWidth: 0
|
||||
property string borderColor: UbuntuColors.warmGrey
|
||||
|
||||
width: parent.width
|
||||
height: units.gu(6)
|
||||
width: parent.width
|
||||
height: units.gu(6)
|
||||
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
@ -33,17 +33,19 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: units.gu(4)
|
||||
height: units.gu(4)
|
||||
name: "go-next"
|
||||
name: "go-next"
|
||||
color: Theme.raisin_black
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: { Qt.openUrlExternally(parent.parent.url); }
|
||||
onClicked: {
|
||||
Qt.openUrlExternally(parent.parent.url)
|
||||
}
|
||||
}
|
||||
|
||||
CustomBorder {
|
||||
id : cb
|
||||
id: cb
|
||||
commonBorder: parent.parent.commonBorder
|
||||
lBorderwidth: parent.parent.lBorderwidth
|
||||
rBorderwidth: parent.parent.rBorderwidth
|
||||
@ -52,4 +54,4 @@ Item {
|
||||
borderColor: parent.parent.borderColor
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,5 +2,4 @@ pragma Singleton
|
||||
import QtQuick 2.4
|
||||
|
||||
Item {
|
||||
|
||||
}
|
||||
|
5
qml/models/Passtore.qml
Normal file
5
qml/models/Passtore.qml
Normal file
@ -0,0 +1,5 @@
|
||||
pragma Singleton
|
||||
import QtQuick 2.4
|
||||
|
||||
Item {
|
||||
}
|
@ -5,7 +5,7 @@ import "../components"
|
||||
|
||||
Page {
|
||||
header: StackHeader {
|
||||
id : infoHeader
|
||||
id: infoHeader
|
||||
title: i18n.tr('Info')
|
||||
}
|
||||
|
||||
@ -19,22 +19,22 @@ Page {
|
||||
spacing: 2
|
||||
anchors.fill: parent
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: units.gu(4)
|
||||
width: parent.width
|
||||
height: units.gu(4)
|
||||
}
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: units.gu(12)
|
||||
Image {
|
||||
source: "../../assets/logo.svg"
|
||||
width: units.gu(12)
|
||||
height: units.gu(12)
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: parent.width
|
||||
height: units.gu(12)
|
||||
Image {
|
||||
source: "../../assets/logo.svg"
|
||||
width: units.gu(12)
|
||||
height: units.gu(12)
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: units.gu(4)
|
||||
width: parent.width
|
||||
height: units.gu(4)
|
||||
}
|
||||
Text {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
@ -55,5 +55,3 @@ Page {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -4,10 +4,9 @@ import Qt.labs.folderlistmodel 2.1
|
||||
import "../components"
|
||||
import "headers"
|
||||
|
||||
|
||||
Page {
|
||||
header : MainHeader {
|
||||
flickable : nav
|
||||
header: MainHeader {
|
||||
flickable: nav
|
||||
|
||||
leadingActionBar.height: units.gu(4)
|
||||
leadingActionBar.actions: [
|
||||
@ -15,11 +14,11 @@ Page {
|
||||
id: backAction
|
||||
iconName: "back"
|
||||
text: i18n.tr("Back")
|
||||
visible:false
|
||||
visible: false
|
||||
onTriggered: {
|
||||
folderModel.folder = folderModel.parentFolder;
|
||||
if(folderModel.rootFolder === folderModel.folder) {
|
||||
backAction.visible = false;
|
||||
folderModel.folder = folderModel.parentFolder
|
||||
if (folderModel.rootFolder === folderModel.folder) {
|
||||
backAction.visible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -42,7 +41,7 @@ Page {
|
||||
}
|
||||
}
|
||||
|
||||
ListView {
|
||||
ListView {
|
||||
anchors.fill: parent
|
||||
spacing: 1
|
||||
model: FolderListModel {
|
||||
@ -56,4 +55,4 @@ Page {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import "headers"
|
||||
|
||||
Page {
|
||||
header: StackHeader {
|
||||
id:settingsHeader
|
||||
id: settingsHeader
|
||||
title: i18n.tr('Settings')
|
||||
}
|
||||
|
||||
@ -23,8 +23,6 @@ Page {
|
||||
height: units.gu(6)
|
||||
text: "Settings"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -8,23 +8,25 @@ PageHeader {
|
||||
title: i18n.tr("UTPass")
|
||||
|
||||
contents: Item {
|
||||
height : parent.height
|
||||
height: parent.height
|
||||
width: parent.width
|
||||
Label {
|
||||
id : labelTitle
|
||||
id: labelTitle
|
||||
text: mainHeader.title
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: true
|
||||
}
|
||||
TextField {
|
||||
id: searchBar
|
||||
anchors.right : parent.right
|
||||
anchors.left : parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.left
|
||||
placeholderText: i18n.tr("Search")
|
||||
height: units.gu(4)
|
||||
visible: false
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
onFocusChanged: {}
|
||||
onFocusChanged: {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,8 +37,8 @@ PageHeader {
|
||||
iconName: "search"
|
||||
text: i18n.tr("Search")
|
||||
onTriggered: {
|
||||
searchBar.visible = !searchBar.visible;
|
||||
labelTitle.visible = !searchBar.visible;
|
||||
searchBar.visible = !searchBar.visible
|
||||
labelTitle.visible = !searchBar.visible
|
||||
if (searchBar.visible === true) {
|
||||
searchBar.focus = true
|
||||
}
|
||||
@ -57,4 +59,4 @@ PageHeader {
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -8,10 +8,10 @@ PageHeader {
|
||||
title: i18n.tr("UTPass")
|
||||
|
||||
contents: Item {
|
||||
height : parent.height
|
||||
height: parent.height
|
||||
width: parent.width
|
||||
Label {
|
||||
id : labelTitle
|
||||
id: labelTitle
|
||||
text: stackHeader.title
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
@ -2,33 +2,31 @@
|
||||
// @ https://stackoverflow.com/questions/16534489/qml-control-border-width-and-color-on-any-one-side-of-rectangle-element#16562823
|
||||
import QtQuick 2.4
|
||||
|
||||
Rectangle
|
||||
{
|
||||
property bool commonBorder : true
|
||||
Rectangle {
|
||||
property bool commonBorder: true
|
||||
|
||||
property int lBorderwidth : 1
|
||||
property int rBorderwidth : 1
|
||||
property int tBorderwidth : 1
|
||||
property int bBorderwidth : 1
|
||||
property int lBorderwidth: 1
|
||||
property int rBorderwidth: 1
|
||||
property int tBorderwidth: 1
|
||||
property int bBorderwidth: 1
|
||||
|
||||
property int commonBorderWidth : 1
|
||||
property int commonBorderWidth: 1
|
||||
|
||||
z : -1
|
||||
z: -1
|
||||
|
||||
property string borderColor : "white"
|
||||
property string borderColor: "white"
|
||||
|
||||
color: borderColor
|
||||
|
||||
anchors
|
||||
{
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
top: parent.top
|
||||
bottom: parent.bottom
|
||||
|
||||
topMargin : commonBorder ? -commonBorderWidth : -tBorderwidth
|
||||
bottomMargin : commonBorder ? -commonBorderWidth : -bBorderwidth
|
||||
leftMargin : commonBorder ? -commonBorderWidth : -lBorderwidth
|
||||
rightMargin : commonBorder ? -commonBorderWidth : -rBorderwidth
|
||||
topMargin: commonBorder ? -commonBorderWidth : -tBorderwidth
|
||||
bottomMargin: commonBorder ? -commonBorderWidth : -bBorderwidth
|
||||
leftMargin: commonBorder ? -commonBorderWidth : -lBorderwidth
|
||||
rightMargin: commonBorder ? -commonBorderWidth : -rBorderwidth
|
||||
}
|
||||
}
|
||||
|
@ -2,9 +2,9 @@ pragma Singleton
|
||||
import QtQuick 2.4
|
||||
|
||||
Item {
|
||||
readonly property color claret : "#77172A"
|
||||
readonly property color raisin_black : "#AE2B25"
|
||||
readonly property color steel_blue : "#462C98"
|
||||
readonly property color twilight_lavender : "#754888"
|
||||
readonly property color eerie_black : "#191716"
|
||||
}
|
||||
readonly property color claret: "#77172A"
|
||||
readonly property color raisin_black: "#AE2B25"
|
||||
readonly property color steel_blue: "#462C98"
|
||||
readonly property color twilight_lavender: "#754888"
|
||||
readonly property color eerie_black: "#191716"
|
||||
}
|
||||
|
Reference in New Issue
Block a user