diff options
author | robotbrainify <robotbrainify@gmail.com> | 2013-10-12 08:28:21 -0400 |
---|---|---|
committer | robotbrainify <robotbrainify@gmail.com> | 2013-10-12 08:28:21 -0400 |
commit | f99a3072b8ff2119972e90fa30045c21078ebf92 (patch) | |
tree | 47453a492d7252c55de845de358642786cee54b4 /gui | |
parent | 4d320e8fc9997ec54ba53c44bd8607399a2c4476 (diff) | |
download | MultiMC-f99a3072b8ff2119972e90fa30045c21078ebf92.tar MultiMC-f99a3072b8ff2119972e90fa30045c21078ebf92.tar.gz MultiMC-f99a3072b8ff2119972e90fa30045c21078ebf92.tar.lz MultiMC-f99a3072b8ff2119972e90fa30045c21078ebf92.tar.xz MultiMC-f99a3072b8ff2119972e90fa30045c21078ebf92.zip |
mod description size limiter done
Diffstat (limited to 'gui')
-rw-r--r-- | gui/MCModInfoFrame.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
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 <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); } |