From f99a3072b8ff2119972e90fa30045c21078ebf92 Mon Sep 17 00:00:00 2001 From: robotbrainify Date: Sat, 12 Oct 2013 08:28:21 -0400 Subject: mod description size limiter done --- gui/MCModInfoFrame.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/gui/MCModInfoFrame.cpp b/gui/MCModInfoFrame.cpp index 22a53819..4659afba 100644 --- a/gui/MCModInfoFrame.cpp +++ b/gui/MCModInfoFrame.cpp @@ -15,6 +15,7 @@ #include "MCModInfoFrame.h" #include "ui_MCModInfoFrame.h" +#include 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); } -- cgit v1.2.3