mod description size limiter done

This commit is contained in:
robotbrainify 2013-10-12 08:28:21 -04:00
parent 4d320e8fc9
commit f99a3072b8

View File

@ -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);
}