mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2024-12-27 21:15:19 +00:00
mod description size limiter done
This commit is contained in:
parent
4d320e8fc9
commit
f99a3072b8
@ -15,6 +15,7 @@
|
||||
|
||||
#include "MCModInfoFrame.h"
|
||||
#include "ui_MCModInfoFrame.h"
|
||||
#include <iostream>
|
||||
void MCModInfoFrame::updateWithMod(Mod &m)
|
||||
{
|
||||
if(m.type() == m.MOD_FOLDER)
|
||||
@ -82,5 +83,17 @@ void MCModInfoFrame::setModDescription(QString text)
|
||||
prev = c == rem;
|
||||
finaltext += c;
|
||||
}
|
||||
ui->label_ModDescription->setText(finaltext);
|
||||
QString labeltext;
|
||||
labeltext.reserve(300);
|
||||
if(finaltext.length() > 297)
|
||||
{
|
||||
labeltext.append(finaltext.left(287) + "...");
|
||||
ui->label_ModDescription->setToolTip(text);
|
||||
}
|
||||
else
|
||||
{
|
||||
labeltext.append(finaltext);
|
||||
}
|
||||
// std::cout << finaltext.length() << std::endl;
|
||||
ui->label_ModDescription->setText(labeltext);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user