diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-07-21 05:19:54 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-07-21 05:19:54 +0200 |
commit | 8fc5808b5f0dfab59e93d46ef581eebe66a1ffd1 (patch) | |
tree | 255c4d8e01c93810c2474a0d4cbee8721c8fa7c2 | |
parent | c28584e8a866ed0b270e0ef741b266c0677831dc (diff) | |
download | kube-8fc5808b5f0dfab59e93d46ef581eebe66a1ffd1.tar.gz kube-8fc5808b5f0dfab59e93d46ef581eebe66a1ffd1.zip |
Fixed mailview focus handling
-rw-r--r-- | components/kube/contents/ui/MailView.qml | 140 | ||||
-rw-r--r-- | framework/qml/InlineAccountSwitcher.qml | 1 |
2 files changed, 72 insertions, 69 deletions
diff --git a/components/kube/contents/ui/MailView.qml b/components/kube/contents/ui/MailView.qml index 23d09b1f..ef790b70 100644 --- a/components/kube/contents/ui/MailView.qml +++ b/components/kube/contents/ui/MailView.qml | |||
@@ -25,89 +25,91 @@ import QtQuick.Layouts 1.1 | |||
25 | 25 | ||
26 | import org.kube.framework 1.0 as Kube | 26 | import org.kube.framework 1.0 as Kube |
27 | 27 | ||
28 | SplitView { | 28 | FocusScope { |
29 | Rectangle { | 29 | SplitView { |
30 | width: Kube.Units.gridUnit * 10 | 30 | anchors.fill: parent |
31 | Layout.minimumWidth: Kube.Units.gridUnit * 5 | 31 | Rectangle { |
32 | width: Kube.Units.gridUnit * 10 | ||
33 | Layout.minimumWidth: Kube.Units.gridUnit * 5 | ||
32 | 34 | ||
33 | color: Kube.Colors.textColor | 35 | color: Kube.Colors.textColor |
34 | focus: true | ||
35 | 36 | ||
36 | Kube.PositiveButton { | 37 | Kube.PositiveButton { |
37 | id: newMailButton | 38 | id: newMailButton |
38 | 39 | ||
39 | anchors { | 40 | anchors { |
40 | top: parent.top | 41 | top: parent.top |
41 | left: parent.left | 42 | left: parent.left |
42 | right: parent.right | 43 | right: parent.right |
43 | margins: Kube.Units.largeSpacing | 44 | margins: Kube.Units.largeSpacing |
44 | } | 45 | } |
45 | 46 | focus: true | |
46 | text: qsTr("New Email") | 47 | text: qsTr("New Email") |
47 | 48 | onClicked: Kube.Fabric.postMessage(Kube.Messages.compose, {}) | |
48 | onClicked: { | ||
49 | Kube.Fabric.postMessage(Kube.Messages.compose, {}) | ||
50 | } | ||
51 | } | ||
52 | |||
53 | Kube.InlineAccountSwitcher { | ||
54 | id: accountFolderview | ||
55 | |||
56 | activeFocusOnTab: true | ||
57 | anchors { | ||
58 | top: newMailButton.bottom | ||
59 | topMargin: Kube.Units.largeSpacing | ||
60 | bottom: statusBarContainer.top | ||
61 | left: newMailButton.left | ||
62 | right: parent.right | ||
63 | } | ||
64 | } | ||
65 | |||
66 | Item { | ||
67 | id: statusBarContainer | ||
68 | anchors { | ||
69 | topMargin: Kube.Units.smallSpacing | ||
70 | bottom: parent.bottom | ||
71 | left: parent.left | ||
72 | right: parent.right | ||
73 | } | 49 | } |
74 | height: childrenRect.height | ||
75 | 50 | ||
76 | Rectangle { | 51 | Kube.InlineAccountSwitcher { |
77 | id: border | 52 | id: accountFolderview |
78 | visible: statusBar.visible | 53 | activeFocusOnTab: true |
79 | anchors { | 54 | anchors { |
55 | top: newMailButton.bottom | ||
56 | topMargin: Kube.Units.largeSpacing | ||
57 | bottom: statusBarContainer.top | ||
58 | left: newMailButton.left | ||
80 | right: parent.right | 59 | right: parent.right |
81 | left: parent.left | ||
82 | margins: Kube.Units.smallSpacing | ||
83 | } | 60 | } |
84 | height: 1 | ||
85 | color: Kube.Colors.viewBackgroundColor | ||
86 | opacity: 0.3 | ||
87 | } | 61 | } |
88 | Kube.StatusBar { | 62 | |
89 | id: statusBar | 63 | Item { |
90 | accountId: accountFolderview.currentAccount | 64 | id: statusBarContainer |
91 | height: Kube.Units.gridUnit * 2 | ||
92 | anchors { | 65 | anchors { |
93 | top: border.bottom | 66 | topMargin: Kube.Units.smallSpacing |
94 | left: statusBarContainer.left | 67 | bottom: parent.bottom |
95 | right: statusBarContainer.right | 68 | left: parent.left |
69 | right: parent.right | ||
70 | } | ||
71 | height: childrenRect.height | ||
72 | |||
73 | Rectangle { | ||
74 | id: border | ||
75 | visible: statusBar.visible | ||
76 | anchors { | ||
77 | right: parent.right | ||
78 | left: parent.left | ||
79 | margins: Kube.Units.smallSpacing | ||
80 | } | ||
81 | height: 1 | ||
82 | color: Kube.Colors.viewBackgroundColor | ||
83 | opacity: 0.3 | ||
84 | } | ||
85 | Kube.StatusBar { | ||
86 | id: statusBar | ||
87 | accountId: accountFolderview.currentAccount | ||
88 | height: Kube.Units.gridUnit * 2 | ||
89 | anchors { | ||
90 | top: border.bottom | ||
91 | left: statusBarContainer.left | ||
92 | right: statusBarContainer.right | ||
93 | } | ||
96 | } | 94 | } |
97 | } | 95 | } |
98 | } | 96 | } |
99 | } | ||
100 | 97 | ||
101 | Kube.MailListView { | 98 | Kube.MailListView { |
102 | id: mailListView | 99 | id: mailListView |
103 | width: Kube.Units.gridUnit * 20 | 100 | width: Kube.Units.gridUnit * 20 |
104 | height: parent.height | 101 | height: parent.height |
105 | Layout.minimumWidth: Kube.Units.gridUnit * 10 | 102 | activeFocusOnTab: true |
106 | } | 103 | onActiveFocusChanged: console.warn("maillist active focus", activeFocus) |
104 | Layout.minimumWidth: Kube.Units.gridUnit * 10 | ||
105 | } | ||
107 | 106 | ||
108 | Kube.ConversationView { | 107 | Kube.ConversationView { |
109 | id: mailView | 108 | id: mailView |
110 | Layout.fillWidth: true | 109 | Layout.fillWidth: true |
111 | Layout.minimumWidth: Kube.Units.gridUnit * 5 | 110 | Layout.minimumWidth: Kube.Units.gridUnit * 5 |
111 | activeFocusOnTab: true | ||
112 | onActiveFocusChanged: console.warn("conversation active focus", activeFocus) | ||
113 | } | ||
112 | } | 114 | } |
113 | } | 115 | } |
diff --git a/framework/qml/InlineAccountSwitcher.qml b/framework/qml/InlineAccountSwitcher.qml index c3929b9e..45001500 100644 --- a/framework/qml/InlineAccountSwitcher.qml +++ b/framework/qml/InlineAccountSwitcher.qml | |||
@@ -89,6 +89,7 @@ FocusScope { | |||
89 | right: parent.right | 89 | right: parent.right |
90 | bottom: parent.bottom | 90 | bottom: parent.bottom |
91 | } | 91 | } |
92 | focus: isCurrent | ||
92 | activeFocusOnTab: true | 93 | activeFocusOnTab: true |
93 | 94 | ||
94 | accountId: currentData.accountId | 95 | accountId: currentData.accountId |