#
# Machekku New Character Counter
#
# Version: 0.1
# Date: 2005-06-23
#
# http://machekku.uaznia.net/jabber/psi/patches/
#
# chatdlg.cpp  |   24 +++++++++++++-----------
# eventdlg.cpp |   22 ++++++++++++----------
# 2 files changed, 25 insertions(+), 21 deletions(-)
#
diff -X exclude -Naru psi_cvs-2005.06.17/psi/src/chatdlg.cpp psi/psi/src/chatdlg.cpp
--- psi_cvs-2005.06.17/psi/src/chatdlg.cpp	Sun May 15 22:26:44 2005
+++ psi/psi/src/chatdlg.cpp	Thu Jun 23 19:58:08 2005
@@ -30,7 +30,6 @@
 #include<qtooltip.h>
 #include<qtimer.h>
 #include<qdatetime.h>
-#include<qlcdnumber.h>
 #include"profiles.h"
 #include"psiaccount.h"
 #include"common.h"
@@ -76,7 +75,7 @@
 	QLabel *lb_ident;
 	IconLabel *lb_status;
 	QLineEdit *le_jid;
-	QLCDNumber *lcd_count;
+	QLabel *lb_count;
 	QPopupMenu *pm_settings;

 	QLabel *lb_composing;
@@ -134,7 +133,7 @@
 	}

 	void updateCounter() {
-		lcd_count->display((int)mle->text().length());
+		lb_count->setNum((int)mle->text().length());
 	}

 	// Records that the user is composing
@@ -203,12 +202,15 @@
 	hb2->addWidget(d->lb_status);
 	d->le_jid = new QLineEdit(sp_top);
 	d->le_jid->setReadOnly(true);
-	d->lcd_count = new QLCDNumber(sp_top);
 	d->le_jid->setFocusPolicy(QWidget::NoFocus);
-	QToolTip::add(d->lcd_count, tr("Message length"));
-	d->lcd_count->setFixedWidth(50);
+	d->lb_count = new QLabel(sp_top);
+	QToolTip::add(d->lb_count, tr("Message length"));
+	d->lb_count->setFrameStyle(QFrame::Panel | QFrame::Sunken);
+	d->lb_count->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
+	d->lb_count->setFixedWidth(40);
+	d->lb_count->setNum((int)0);
 	hb2->addWidget(d->le_jid);
-	hb2->addWidget(d->lcd_count);
+	hb2->addWidget(d->lb_count);
 	hb2->addWidget(d->lb_ident);

 	// mid area
@@ -456,9 +458,9 @@
 	doFlash(false);

 	if(option.showCounter && !d->smallChat)
-		d->lcd_count->show();
+		d->lb_count->show();
 	else
-		d->lcd_count->hide();
+		d->lb_count->hide();

 	d->mle->setFocus();
 }
@@ -667,9 +669,9 @@
 	}

 	if ( option.showCounter && !d->smallChat )
-		d->lcd_count->show();
+		d->lb_count->show();
 	else
-		d->lcd_count->hide();
+		d->lb_count->hide();
 
 	// update contact info
 	d->status = -2; // sick way of making it redraw the status
diff -X exclude -Naru psi_cvs-2005.06.17/psi/src/eventdlg.cpp psi/psi/src/eventdlg.cpp
--- psi_cvs-2005.06.17/psi/src/eventdlg.cpp	Sun May 15 22:26:44 2005
+++ psi/psi/src/eventdlg.cpp	Thu Jun 23 20:15:10 2005
@@ -37,7 +37,6 @@
 #include<qheader.h>
 #include<qapplication.h>
 #include<qclipboard.h>
-#include<qlcdnumber.h>
 #include"psievent.h"
 #include"psicon.h"
 #include"psiaccount.h"
@@ -444,7 +443,7 @@
 	IconLabel *lb_status;
 	ELineEdit *le_to;
 	QLineEdit *le_from, *le_subj;
-	QLCDNumber *lcd_count;
+	QLabel *lb_count;
 	IconToolButton *tb_url, *tb_info, *tb_history, *tb_pgp, *tb_icon;
 	IconLabel *lb_pgp;
 	bool enc;
@@ -494,7 +493,7 @@
 	}
 
 	void updateCounter() {
-		lcd_count->display((int)mle->text().length());
+		lb_count->setNum((int)mle->text().length());
 	}
 };
 
@@ -691,9 +690,12 @@
 
 	// message length counter
 	d->le_subj = new QLineEdit(this);
-	d->lcd_count = new QLCDNumber(this);
-	QToolTip::add(d->lcd_count, tr("Message length"));
-	d->lcd_count->setFixedWidth(50);
+	d->lb_count = new QLabel(this);
+	QToolTip::add(d->lb_count, tr("Message length"));
+	d->lb_count->setFrameStyle(QFrame::Panel | QFrame::Sunken);
+	d->lb_count->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
+	d->lb_count->setFixedWidth(40);
+	d->lb_count->setNum((int)0);
 
 	if(d->composing) {
 		d->tb_pgp = new IconToolButton(this);
@@ -725,7 +727,7 @@
 		l = new QLabel(tr("Subject:"), this);
 		hb3->addWidget(l);
 		hb3->addWidget(d->le_subj);
-		hb3->addWidget(d->lcd_count);
+		hb3->addWidget(d->lb_count);
 		hb3->addWidget(d->tb_icon);
 		hb3->addWidget(d->tb_url);
 		hb3->addWidget(d->tb_info);
@@ -740,7 +742,7 @@
 
 	} else {
 		d->le_subj->hide();
-		hb2->addWidget(d->lcd_count);
+		hb2->addWidget(d->lb_count);
 		hb2->addWidget(d->tb_icon);
 		hb2->addWidget(d->tb_url);
 		hb2->addWidget(d->tb_info);
@@ -1174,9 +1176,9 @@
 	doWhois(true);
 
 	if ( option.showCounter && d->composing )
-		d->lcd_count->show();
+		d->lb_count->show();
 	else
-		d->lcd_count->hide();
+		d->lb_count->hide();
 
 	if ( option.useEmoticons )
 		d->tb_icon->show();
