projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert "Reset the input prior to processing it in order to prevent issues with per...
[quassel.git]
/
src
/
qtui
/
chatitem.cpp
diff --git
a/src/qtui/chatitem.cpp
b/src/qtui/chatitem.cpp
index
bec1eb7
..
5e2942c
100644
(file)
--- a/
src/qtui/chatitem.cpp
+++ b/
src/qtui/chatitem.cpp
@@
-115,11
+115,6
@@
void ChatItem::clearCache() {
_cachedLayout = 0;
}
_cachedLayout = 0;
}
-void ChatItem::initLayout(QTextLayout *layout, QTextOption::WrapMode mode, Qt::Alignment alignment) const {
- initLayoutHelper(layout, mode, alignment);
- doLayout(layout);
-}
-
void ChatItem::initLayoutHelper(QTextLayout *layout, QTextOption::WrapMode wrapMode, Qt::Alignment alignment) const {
Q_ASSERT(layout);
void ChatItem::initLayoutHelper(QTextLayout *layout, QTextOption::WrapMode wrapMode, Qt::Alignment alignment) const {
Q_ASSERT(layout);
@@
-135,6
+130,11
@@
void ChatItem::initLayoutHelper(QTextLayout *layout, QTextOption::WrapMode wrapM
layout->setAdditionalFormats(formatRanges);
}
layout->setAdditionalFormats(formatRanges);
}
+void ChatItem::initLayout(QTextLayout *layout) const {
+ initLayoutHelper(layout, QTextOption::NoWrap);
+ doLayout(layout);
+}
+
void ChatItem::doLayout(QTextLayout *layout) const {
layout->beginLayout();
QTextLine line = layout->createLine();
void ChatItem::doLayout(QTextLayout *layout) const {
layout->beginLayout();
QTextLine line = layout->createLine();
@@
-405,6
+405,11
@@
void ChatItem::addActionsToMenu(QMenu *menu, const QPointF &pos) {
// SenderChatItem
// ************************************************************
// SenderChatItem
// ************************************************************
+void SenderChatItem::initLayout(QTextLayout *layout) const {
+ initLayoutHelper(layout, QTextOption::ManualWrap, Qt::AlignRight);
+ doLayout(layout);
+}
+
void SenderChatItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) {
Q_UNUSED(option); Q_UNUSED(widget);
painter->save();
void SenderChatItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) {
Q_UNUSED(option); Q_UNUSED(widget);
painter->save();
@@
-518,6
+523,11
@@
qreal ContentsChatItem::setGeometryByWidth(qreal w) {
return h;
}
return h;
}
+void ContentsChatItem::initLayout(QTextLayout *layout) const {
+ initLayoutHelper(layout, QTextOption::WrapAtWordBoundaryOrAnywhere);
+ doLayout(layout);
+}
+
void ContentsChatItem::doLayout(QTextLayout *layout) const {
ChatLineModel::WrapList wrapList = data(ChatLineModel::WrapListRole).value<ChatLineModel::WrapList>();
if(!wrapList.count()) return; // empty chatitem
void ContentsChatItem::doLayout(QTextLayout *layout) const {
ChatLineModel::WrapList wrapList = data(ChatLineModel::WrapListRole).value<ChatLineModel::WrapList>();
if(!wrapList.count()) return; // empty chatitem
@@
-587,7
+597,7
@@
QVector<QTextLayout::FormatRange> ContentsChatItem::additionalFormats() const {
void ContentsChatItem::endHoverMode() {
if(privateData()) {
if(privateData()->currentClickable.isValid()) {
void ContentsChatItem::endHoverMode() {
if(privateData()) {
if(privateData()->currentClickable.isValid()) {
- chatLine()->
setCursor(Qt::ArrowCursor
);
+ chatLine()->
unsetCursor(
);
privateData()->currentClickable = Clickable();
}
clearWebPreview();
privateData()->currentClickable = Clickable();
}
clearWebPreview();