diff --git a/assets/NewPostSheet.qml b/assets/NewPostSheet.qml index 4011aa9..df12784 100644 --- a/assets/NewPostSheet.qml +++ b/assets/NewPostSheet.qml @@ -57,7 +57,14 @@ Sheet { TextArea { id: postText preferredHeight: 350.0 - onTextChanging: postChanging(text) + onTextChanging: { + postChanging(text) + if (count > 0) { + sendAction.enabled = true + } else { + sendAction.enabled = false + } + } } } Container { diff --git a/assets/PostItem.qml b/assets/PostItem.qml index 55227d0..4583fa7 100644 --- a/assets/PostItem.qml +++ b/assets/PostItem.qml @@ -377,6 +377,14 @@ Container { onSendPost: { postitem.ListItem.view.sendReply(text, ListItemData.id); } + onPostChanging: { + replySheet.count = 256 - postitem.ListItem.view.postLength(text) + if (replySheet.count < 0) { + replySheet.counttext = "longpost" + } else { + replySheet.counttext = replySheet.count.toString() + } + } } ] function parseMentions(mentions) { diff --git a/assets/StreamTab.qml b/assets/StreamTab.qml index f926ec7..04a6e94 100644 --- a/assets/StreamTab.qml +++ b/assets/StreamTab.qml @@ -113,6 +113,9 @@ NavigationPane { function getPost(pid) { pnut.getPost(pid) } + function postLength(text) { + return pnut.postLength(text) + } function ccOnReply() { if (_app.setting("cc") === "true") { return true diff --git a/src/Pnut.cpp b/src/Pnut.cpp index 67589e3..6f11790 100644 --- a/src/Pnut.cpp +++ b/src/Pnut.cpp @@ -360,7 +360,7 @@ void Pnut::sendPost(QString text, int pid=0) QVariantMap map; QVariantList raw; - if (postLength(text) > 254) + if (postLength(text) > 256) { QVariantMap longpost; QVariantMap rawobj; diff --git a/translations/Goober.ts b/translations/Goober.ts index b26b215..740b27d 100644 --- a/translations/Goober.ts +++ b/translations/Goober.ts @@ -233,22 +233,22 @@ StreamTab - + New Post - + To Top - + To Bottom - + Reload