From aeb5d1120f001e01cad596515c369b1902b52672 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sun, 31 May 2015 22:15:20 +0000 Subject: [PATCH] Fixed layout of From, Recipient, Subject and Tags in MessageComposer. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8329 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- .../src/gui/msgs/MessageComposer.cpp | 11 +- .../src/gui/msgs/MessageComposer.ui | 165 +++++++++--------- 2 files changed, 90 insertions(+), 86 deletions(-) diff --git a/retroshare-gui/src/gui/msgs/MessageComposer.cpp b/retroshare-gui/src/gui/msgs/MessageComposer.cpp index 6bfb58f55..c7fb26fa1 100644 --- a/retroshare-gui/src/gui/msgs/MessageComposer.cpp +++ b/retroshare-gui/src/gui/msgs/MessageComposer.cpp @@ -295,12 +295,13 @@ MessageComposer::MessageComposer(QWidget *parent, Qt::WindowFlags flags) ui.recipientWidget->setColumnCount(COLUMN_RECIPIENT_COUNT); QHeaderView *header = ui.recipientWidget->horizontalHeader(); - header->resizeSection(COLUMN_RECIPIENT_TYPE, 60); +// header->resizeSection(COLUMN_RECIPIENT_TYPE, ui.fromLabel->size().width()); // see ::eventFilter header->resizeSection(COLUMN_RECIPIENT_ICON, 22); QHeaderView_setSectionResizeMode(header, COLUMN_RECIPIENT_TYPE, QHeaderView::Fixed); QHeaderView_setSectionResizeMode(header, COLUMN_RECIPIENT_ICON, QHeaderView::Fixed); QHeaderView_setSectionResizeMode(header, COLUMN_RECIPIENT_NAME, QHeaderView::Fixed); header->setStretchLastSection(true); + ui.fromLabel->installEventFilter(this); /* Set own item delegate */ QItemDelegate *delegate = new MessageItemDelegate(this); @@ -1686,6 +1687,14 @@ bool MessageComposer::eventFilter(QObject *obj, QEvent *event) } } + if (event->type() == QEvent::Resize) { + if (obj == ui.fromLabel) { + // Resize "Recipient" column + QHeaderView *header = ui.recipientWidget->horizontalHeader(); + header->resizeSection(COLUMN_RECIPIENT_TYPE, ui.fromLabel->size().width()); + } + } + // pass the event on to the parent class return QMainWindow::eventFilter(obj, event); } diff --git a/retroshare-gui/src/gui/msgs/MessageComposer.ui b/retroshare-gui/src/gui/msgs/MessageComposer.ui index d7686965a..9e89c3501 100644 --- a/retroshare-gui/src/gui/msgs/MessageComposer.ui +++ b/retroshare-gui/src/gui/msgs/MessageComposer.ui @@ -674,6 +674,19 @@ + + + + + 4 + 4 + + + + Qt::TextEditorInteraction + + + @@ -825,89 +838,9 @@ border-image: url(:/images/closepressed.png) - - - - - 4 - 4 - - - - Qt::TextEditorInteraction - - - - - - - - 0 - 0 - - - - - 0 - 68 - - - - - 16777215 - 68 - - - - false - - - QAbstractItemView::SingleSelection - - - false - - - false - - - 22 - - - - - - - - - - 60 - 0 - - - - From: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - - - + @@ -947,7 +880,7 @@ border-image: url(:/images/closepressed.png) - + @@ -975,7 +908,7 @@ border-image: url(:/images/closepressed.png) - + @@ -985,7 +918,7 @@ border-image: url(:/images/closepressed.png) - + @@ -1007,6 +940,69 @@ border-image: url(:/images/closepressed.png) + + + + + 0 + 0 + + + + + + + + + 60 + 0 + + + + From: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 0 + 68 + + + + + 16777215 + 68 + + + + false + + + QAbstractItemView::SingleSelection + + + false + + + false + + + 22 + + + @@ -1227,7 +1223,6 @@ border-image: url(:/images/closepressed.png) - recipientWidget titleEdit msgText msgFileList