mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-07-24 14:33:02 +02:00
Support links in tasks.
This commit is contained in:
parent
b506bf9506
commit
7284926db4
1 changed files with 13 additions and 0 deletions
|
@ -667,11 +667,24 @@ TextState TodoList::textState(QPoint point, StateRequest request) const {
|
|||
request.forText()));
|
||||
return result;
|
||||
}
|
||||
const auto aleft = padding.left()
|
||||
+ st::historyPollAnswerPadding.left();
|
||||
const auto awidth = paintw
|
||||
- st::historyPollAnswerPadding.left()
|
||||
- st::historyPollAnswerPadding.right();
|
||||
tshift += questionH + st::historyPollSubtitleSkip;
|
||||
tshift += st::msgDateFont->height + st::historyPollAnswersSkip;
|
||||
for (const auto &task : _tasks) {
|
||||
const auto height = countTaskHeight(task, paintw);
|
||||
if (point.y() >= tshift && point.y() < tshift + height) {
|
||||
const auto atop = tshift + st::historyPollAnswerPadding.top();
|
||||
auto taskTextResult = task.text.getState(
|
||||
point - QPoint(aleft, atop),
|
||||
awidth,
|
||||
request.forText());
|
||||
if (taskTextResult.link) {
|
||||
return TextState(_parent, taskTextResult);
|
||||
}
|
||||
_lastLinkPoint = point;
|
||||
result.link = task.handler;
|
||||
if (task.completionDate) {
|
||||
|
|
Loading…
Add table
Reference in a new issue