aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/objects/class_painter.cpp
diff options
context:
space:
mode:
authorGravatar Fabio Bas2010-03-21 17:45:55 +0000
committerGravatar Fabio Bas2010-03-21 17:45:55 +0000
commit8539ba0f38ddec1e50a7d75027eef840f4d3536d (patch)
tree20960699f09bb135c375dcb8b6d12352c51b0269 /src/modules/objects/class_painter.cpp
parenttypos, thx to Curan for noticing (diff)
downloadKVIrc-8539ba0f38ddec1e50a7d75027eef840f4d3536d.tar.gz
KVIrc-8539ba0f38ddec1e50a7d75027eef840f4d3536d.tar.bz2
KVIrc-8539ba0f38ddec1e50a7d75027eef840f4d3536d.zip
small fixes to the painterl, label, multilineedit objects
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@4181 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/objects/class_painter.cpp')
-rw-r--r--src/modules/objects/class_painter.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/modules/objects/class_painter.cpp b/src/modules/objects/class_painter.cpp
index 63165335a..76adab385 100644
--- a/src/modules/objects/class_painter.cpp
+++ b/src/modules/objects/class_painter.cpp
@@ -1149,14 +1149,16 @@ KVSO_CLASS_FUNCTION(painter,drawText)
{
CHECK_INTERNAL_POINTER(m_pPainter)
QString szText,szMode;
- kvs_int_t iX,iY;
+ kvs_int_t iX,iY,iN=-1;
KVSO_PARAMETERS_BEGIN(c)
KVSO_PARAMETER("x",KVS_PT_INT,0,iX)
KVSO_PARAMETER("y",KVS_PT_INT,0,iY)
KVSO_PARAMETER("text",KVS_PT_STRING,0,szText)
+ KVSO_PARAMETER("num_chars",KVS_PT_INT,KVS_PF_OPTIONAL,iN)
KVSO_PARAMETER("mode",KVS_PT_STRING,KVS_PF_OPTIONAL,szMode)
KVSO_PARAMETERS_END(c)
- if (!szMode.isEmpty()){
+ if (!szMode.isEmpty() && !KviQString::equalCI(szMode,"Auto"))
+ {
if(KviQString::equalCI(szMode,"RTL"))m_pPainter->setLayoutDirection(Qt::RightToLeft);
else if(KviQString::equalCI(szMode,"LTR"))m_pPainter->setLayoutDirection(Qt::LeftToRight);
else
@@ -1165,7 +1167,7 @@ KVSO_CLASS_FUNCTION(painter,drawText)
return true;
}
}
- m_pPainter->drawText(iX,iY,szText);
+ m_pPainter->drawText(iX,iY,szText.left(iN));
return true;
}