[poll-view] Moved poll paint and update methods into Parts.

This commit is contained in:
23rd
2026-03-29 10:43:28 +03:00
parent daa46ab296
commit 4b3945dec8
2 changed files with 501 additions and 503 deletions
File diff suppressed because it is too large Load Diff
@@ -96,127 +96,10 @@ private:
[[nodiscard]] bool canVote() const;
[[nodiscard]] bool canSendVotes() const;
[[nodiscard]] bool isAuthorNotVoted() const;
void updateDescription();
void updateAttachedMedia();
[[nodiscard]] int countTopContentSkip(int pollWidth = 0) const;
[[nodiscard]] int countTopMediaHeight(int pollWidth = 0) const;
[[nodiscard]] int countAttachHeight(int pollWidth = 0) const;
[[nodiscard]] QRect countTopMediaRect(int top) const;
[[nodiscard]] Ui::BubbleRounding topMediaRounding() const;
void validateTopMediaCache(QSize size) const;
[[nodiscard]] int countDescriptionHeight(int innerWidth) const;
[[nodiscard]] int countQuestionTop(
int innerWidth,
int pollWidth = 0) const;
[[nodiscard]] uint16 solutionSelectionLength() const;
[[nodiscard]] TextSelection toSolutionSelection(
TextSelection selection) const;
[[nodiscard]] TextSelection fromSolutionSelection(
TextSelection selection) const;
[[nodiscard]] TextSelection toQuestionSelection(
TextSelection selection) const;
[[nodiscard]] TextSelection fromQuestionSelection(
TextSelection selection) const;
[[nodiscard]] int countAnswerContentWidth(
const Answer &answer,
int innerWidth) const;
[[nodiscard]] int countAnswerHeight(
const Answer &answer,
int innerWidth) const;
[[nodiscard]] ClickHandlerPtr createAnswerClickHandler(
const Answer &answer);
void updateTexts();
void updateRecentVoters();
void updateAnswers();
void updateVotes();
bool showVotersCount() const;
bool inlineFooter() const;
void updateAnswerVotes();
void updateAnswerVotesFromOriginal(
Answer &answer,
const PollAnswer &original,
int percent,
int maxVotes);
void paintRecentVoters(
Painter &p,
int left,
int top,
const PaintContext &context) const;
void paintShowSolution(
Painter &p,
int right,
int top,
const PaintContext &context) const;
int paintAnswer(
Painter &p,
const Answer &answer,
const AnswerAnimation *animation,
int left,
int top,
int width,
int outerWidth,
const PaintContext &context) const;
void paintRadio(
Painter &p,
const Answer &answer,
int left,
int top,
const PaintContext &context) const;
void paintPercent(
Painter &p,
const QString &percent,
int percentWidth,
int left,
int top,
int topPadding,
int outerWidth,
const PaintContext &context) const;
void paintFilling(
Painter &p,
bool chosen,
bool correct,
float64 filling,
int left,
int top,
int topPadding,
int width,
int contentWidth,
const PaintContext &context) const;
bool checkAnimationStart() const;
bool answerVotesChanged() const;
void saveStateInAnimation() const;
void startAnswersAnimation() const;
void resetAnswersAnimation() const;
void radialAnimationCallback() const;
void toggleRipple(Answer &answer, bool pressed);
void toggleMultiOption(const QByteArray &option);
void sendMultiOptions();
void showResults();
void showAnswerVotesTooltip(const QByteArray &option);
void checkQuizAnswered();
void showSolution() const;
void solutionToggled(
bool solutionShown,
anim::type animated = anim::type::normal) const;
[[nodiscard]] bool canShowSolution() const;
[[nodiscard]] bool inShowSolution(
QPoint point,
int right,
int top) const;
void updateSolutionText();
void updateSolutionMedia();
[[nodiscard]] int countSolutionBlockHeight(int innerWidth) const;
[[nodiscard]] int countSolutionMediaHeight(int mediaWidth) const;
void paintSolutionBlock(
Painter &p,
int left,
int top,
int paintw,
const PaintContext &context) const;
[[nodiscard]] bool canAddOption() const;