diff --git a/application/widgets/MCModInfoFrame.cpp b/application/widgets/MCModInfoFrame.cpp index 0ec1376d..cdf35be8 100644 --- a/application/widgets/MCModInfoFrame.cpp +++ b/application/widgets/MCModInfoFrame.cpp @@ -110,7 +110,22 @@ void MCModInfoFrame::setModDescription(QString text) } ui->label_ModDescription->setText(labeltext); } + void MCModInfoFrame::modDescEllipsisHandler(const QString &link) { - CustomMessageBox::selectable(this, tr(""), desc)->show(); + if(!currentBox) + { + currentBox = CustomMessageBox::selectable(this, tr(""), desc); + connect(currentBox, &QMessageBox::finished, this, &MCModInfoFrame::boxClosed); + currentBox->show(); + } + else + { + currentBox->setText(desc); + } +} + +void MCModInfoFrame::boxClosed(int result) +{ + currentBox = nullptr; } diff --git a/application/widgets/MCModInfoFrame.h b/application/widgets/MCModInfoFrame.h index 3f75279c..d29a32bd 100644 --- a/application/widgets/MCModInfoFrame.h +++ b/application/widgets/MCModInfoFrame.h @@ -38,9 +38,12 @@ public: void clear(); public slots: - void modDescEllipsisHandler(const QString& link ); + void modDescEllipsisHandler(const QString& link ); + void boxClosed(int result); private: Ui::MCModInfoFrame *ui; - QString desc; + QString desc; + class QMessageBox * currentBox = nullptr; }; +