/***************************************************************************
- * Copyright (C) 2005-07 by the Quassel IRC Team *
+ * Copyright (C) 2005-08 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
scrollTimer = new QTimer(this);
scrollTimer->setSingleShot(false);
scrollTimer->setInterval(100);
+ // setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
- setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
- setMinimumSize(QSize(400,400));
+ setMinimumSize(QSize(20,20));
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
bottomLine = -1;
connect(verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(scrollBarValChanged(int)));
}
-void ChatWidget::init(QString netname, QString bufname) {
- networkName = netname;
- bufferName = bufname;
+void ChatWidget::init(BufferId id) {
+ bufferId = id;
setBackgroundRole(QPalette::Base);
setFont(QFont("Fixed"));
UiSettings s;
QVariant tsDef = s.value("DefaultTimestampColumnWidth", 90);
QVariant senderDef = s.value("DefaultSenderColumnWidth", 100);
- tsWidth = s.value(QString("%1/%2/TimestampColumnWidth").arg(netname, bufname), tsDef).toInt();
- senderWidth = s.value(QString("%1/%2/SenderColumnWidth").arg(netname, bufname), senderDef).toInt();
+ tsWidth = s.value(QString("%1/TimestampColumnWidth").arg(bufferId.toInt()), tsDef).toInt();
+ senderWidth = s.value(QString("%1/SenderColumnWidth").arg(bufferId.toInt()), senderDef).toInt();
computePositions();
adjustScrollBar();
verticalScrollBar()->setValue(verticalScrollBar()->maximum());
//verticalScrollBar()->setMinimum(0);
//verticalScrollBar()->setMaximum((int)height - verticalScrollBar()->pageStep());
- setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+ // setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
setMouseTracking(true);
mouseMode = Normal;
selectionMode = NoSelection;
UiSettings s;
s.setValue("DefaultTimestampColumnWidth", tsWidth); // FIXME stupid dirty quicky
s.setValue("DefaultSenderColumnWidth", senderWidth);
- s.setValue(QString("%1/%2/TimestampColumnWidth").arg(networkName, bufferName), tsWidth);
- s.setValue(QString("%1/%2/SenderColumnWidth").arg(networkName, bufferName), senderWidth);
+ s.setValue(QString("%1/TimestampColumnWidth").arg(bufferId.toInt()), tsWidth);
+ s.setValue(QString("%1/SenderColumnWidth").arg(bufferId.toInt()), senderWidth);
}
-QSize ChatWidget::sizeHint() const {
- //qDebug() << size();
- return size();
+QSize ChatWidget::minimumSizeHint() const {
+ return QSize(20, 20);
}
+// QSize ChatWidget::sizeHint() const {
+// //qDebug() << size();
+// return size();
+// }
+
void ChatWidget::adjustScrollBar() {
verticalScrollBar()->setPageStep(viewport()->height());
verticalScrollBar()->setSingleStep(20);
/*if(event->oldSize().isValid())*/
//contents->setWidth(event->size().width());
//setAlignment(Qt::AlignBottom);
- if(event->size().width() != event->oldSize().width()) {
+ if(event->size() != event->oldSize()) {
computePositions();
layout();
}