Merge pull request #111 from jgibbon/bugfix/poll-fixes
Fix two issues in PollPreview
This commit is contained in:
commit
e3224c5b4f
1 changed files with 7 additions and 8 deletions
|
@ -102,10 +102,11 @@ Item {
|
||||||
id: canAnswerDelegate
|
id: canAnswerDelegate
|
||||||
TextSwitch {
|
TextSwitch {
|
||||||
id: optionDelegate
|
id: optionDelegate
|
||||||
|
// TextSwitch changes the html base path:
|
||||||
|
property url emojiBase: "../js/emoji/"
|
||||||
width: pollMessageComponent.width
|
width: pollMessageComponent.width
|
||||||
automaticCheck: false
|
automaticCheck: false
|
||||||
// emojify does not work here :/
|
text: Emoji.emojify(modelData.text, Theme.fontSizeMedium, emojiBase)
|
||||||
text: modelData.text
|
|
||||||
checked: pollMessageComponent.chosenIndexes.indexOf(index) > -1
|
checked: pollMessageComponent.chosenIndexes.indexOf(index) > -1
|
||||||
onClicked: {
|
onClicked: {
|
||||||
pollMessageComponent.handleChoose(index);
|
pollMessageComponent.handleChoose(index);
|
||||||
|
@ -263,6 +264,7 @@ Item {
|
||||||
Component {
|
Component {
|
||||||
id: closePollMenuItemComponent
|
id: closePollMenuItemComponent
|
||||||
MenuItem {
|
MenuItem {
|
||||||
|
visible: !pollData.is_closed && pollMessageComponent.canEdit
|
||||||
text: qsTr("Close Poll")
|
text: qsTr("Close Poll")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
tdLibWrapper.stopPoll(pollMessageComponent.chatId, pollMessageComponent.messageId);
|
tdLibWrapper.stopPoll(pollMessageComponent.chatId, pollMessageComponent.messageId);
|
||||||
|
@ -272,6 +274,7 @@ Item {
|
||||||
Component {
|
Component {
|
||||||
id: resetAnswerMenuItemComponent
|
id: resetAnswerMenuItemComponent
|
||||||
MenuItem {
|
MenuItem {
|
||||||
|
visible: !pollData.is_closed && !pollMessageComponent.isQuiz && pollMessageComponent.hasAnswered
|
||||||
text: qsTr("Reset Answer")
|
text: qsTr("Reset Answer")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
pollMessageComponent.resetChosen()
|
pollMessageComponent.resetChosen()
|
||||||
|
@ -282,12 +285,8 @@ Item {
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
opacity = 1;
|
opacity = 1;
|
||||||
if(messageItem && messageItem.menu ) { // workaround to add menu entries
|
if(messageItem && messageItem.menu ) { // workaround to add menu entries
|
||||||
if(!pollData.is_closed && pollMessageComponent.canEdit) {
|
closePollMenuItemComponent.createObject(messageItem.menu._contentColumn);
|
||||||
closePollMenuItemComponent.createObject(messageItem.menu._contentColumn);
|
resetAnswerMenuItemComponent.createObject(messageItem.menu._contentColumn);
|
||||||
}
|
|
||||||
if(!pollData.is_closed && !pollMessageComponent.isQuiz && pollMessageComponent.hasAnswered) {
|
|
||||||
resetAnswerMenuItemComponent.createObject(messageItem.menu._contentColumn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue