-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.qml
70 lines (54 loc) · 1.19 KB
/
main.qml
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
import QtQuick.Controls 2.3
import QtQuick 2.9
import QtQuick.Window 2.2
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
Window {
id: root
property string uuid: ""
property alias text: text_area.text
flags: Qt.FramelessWindowHint
visible: true
width: 300
height: 300
color: "#feff9c"
title: qsTr("Notix")
TitleBar {
id: title_bar
anchors.top: parent.top
height: 25
container: root
}
TextArea {
id: text_area
anchors.top: title_bar.bottom
width: parent.width
height: parent.height-25
wrapMode: Text.WrapAnywhere
frameVisible: false
Keys.onReleased: notes_model.text_changed(uuid, this.text)
style: TextAreaStyle {
textColor: "#333"
selectionColor: "steelblue"
selectedTextColor: "#eee"
backgroundColor: "#feff9c"
}
text: "";
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.RightButton
onClicked: {
if (mouse.button === Qt.RightButton)
{
contextMenu.menus
}
}
}
}
Component.onCompleted: {
if(uuid == "")
{
uuid = notes_model.generate_id();
}
}
}