From 51c2e5b6425e4511c643442761fd432158282745 Mon Sep 17 00:00:00 2001 From: defnax Date: Fri, 22 Jan 2010 01:05:45 +0000 Subject: [PATCH] little layout improvements for messages git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2111 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/MessagesDialog.cpp | 53 +++- retroshare-gui/src/gui/MessagesDialog.h | 4 + retroshare-gui/src/gui/MessagesDialog.ui | 323 +++++++++++++++------- 3 files changed, 280 insertions(+), 100 deletions(-) diff --git a/retroshare-gui/src/gui/MessagesDialog.cpp b/retroshare-gui/src/gui/MessagesDialog.cpp index aecd73731..9fd1c7322 100644 --- a/retroshare-gui/src/gui/MessagesDialog.cpp +++ b/retroshare-gui/src/gui/MessagesDialog.cpp @@ -83,6 +83,11 @@ MessagesDialog::MessagesDialog(QWidget *parent) connect( ui.msgText, SIGNAL( anchorClicked(const QUrl &)), SLOT(anchorClicked(const QUrl &))); + connect(ui.actionTextBesideIcon, SIGNAL(triggered()), this, SLOT(buttonstextbesideicon())); + connect(ui.actionIconOnly, SIGNAL(triggered()), this, SLOT(buttonsicononly())); + connect(ui.actionTextUnderIcon, SIGNAL(triggered()), this, SLOT(buttonstextundericon())); + + mCurrCertId = ""; mCurrMsgId = ""; @@ -112,13 +117,6 @@ MessagesDialog::MessagesDialog(QWidget *parent) msglheader->resizeSection ( 1, 100 ); msglheader->resizeSection ( 2, 100 ); msglheader->resizeSection ( 3, 200 ); - - ui.newmessageButton->setIcon(QIcon(QString(":/images/folder-draft24-pressed.png"))); - ui.replymessageButton->setIcon(QIcon(QString(":/images/replymail-pressed.png"))); - ui.replyallmessageButton->setIcon(QIcon(QString(":/images/replymailall24-hover.png"))); - ui.forwardmessageButton->setIcon(QIcon(QString(":/images/mailforward24-hover.png"))); - ui.removemessageButton->setIcon(QIcon(QString(":/images/deletemail-pressed.png"))); - ui.printbutton->setIcon(QIcon(QString(":/images/print24.png"))); ui.forwardmessageButton->setToolTip(tr("Forward selected Message")); ui.replyallmessageButton->setToolTip(tr("Reply to All")); @@ -127,6 +125,12 @@ MessagesDialog::MessagesDialog(QWidget *parent) printmenu->addAction(ui.actionPrint); printmenu->addAction(ui.actionPrintPreview); ui.printbutton->setMenu(printmenu); + + QMenu * viewmenu = new QMenu(); + viewmenu->addAction(ui.actionTextBesideIcon); + viewmenu->addAction(ui.actionIconOnly); + viewmenu->addAction(ui.actionTextUnderIcon); + ui.viewtoolButton->setMenu(viewmenu); ui.msgWidget->setSelectionMode(QAbstractItemView::ExtendedSelection); ui.msgWidget->sortItems( 3, Qt::DescendingOrder ); @@ -957,4 +961,39 @@ void MessagesDialog::anchorClicked (const QUrl& link ) newAddress.prepend("http://"); QDesktopServices::openUrl(QUrl(newAddress)); } +} + +void MessagesDialog::buttonsicononly() +{ + ui.newmessageButton->setToolButtonStyle(Qt::ToolButtonIconOnly); + ui.removemessageButton->setToolButtonStyle(Qt::ToolButtonIconOnly); + ui.replymessageButton->setToolButtonStyle(Qt::ToolButtonIconOnly); + ui.replyallmessageButton->setToolButtonStyle(Qt::ToolButtonIconOnly); + ui.forwardmessageButton->setToolButtonStyle(Qt::ToolButtonIconOnly); + ui.printbutton->setToolButtonStyle(Qt::ToolButtonIconOnly); + ui.viewtoolButton->setToolButtonStyle(Qt::ToolButtonIconOnly); +} + +void MessagesDialog::buttonstextbesideicon() +{ + ui.newmessageButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + ui.removemessageButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + ui.replymessageButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + ui.replyallmessageButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + ui.forwardmessageButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + ui.printbutton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + ui.viewtoolButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + +} + +void MessagesDialog::buttonstextundericon() +{ + ui.newmessageButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); + ui.removemessageButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); + ui.replymessageButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); + ui.replyallmessageButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); + ui.forwardmessageButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); + ui.printbutton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); + ui.viewtoolButton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); + } \ No newline at end of file diff --git a/retroshare-gui/src/gui/MessagesDialog.h b/retroshare-gui/src/gui/MessagesDialog.h index 985ec24ed..86dcf3082 100644 --- a/retroshare-gui/src/gui/MessagesDialog.h +++ b/retroshare-gui/src/gui/MessagesDialog.h @@ -67,6 +67,10 @@ private slots: /* handle splitter */ void togglefileview(); + + void buttonstextbesideicon(); + void buttonsicononly(); + void buttonstextundericon(); private: diff --git a/retroshare-gui/src/gui/MessagesDialog.ui b/retroshare-gui/src/gui/MessagesDialog.ui index 43369844b..f3d91a045 100644 --- a/retroshare-gui/src/gui/MessagesDialog.ui +++ b/retroshare-gui/src/gui/MessagesDialog.ui @@ -511,6 +511,12 @@ + + + 0 + 0 + + QFrame#frame{ background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, @@ -528,55 +534,37 @@ border: 1px solid #CCCCCC;} 2 - - - + + + + Qt::Horizontal + + - 44 - 28 + 529 + 20 - - - 28 - 28 - - - - <html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Arial'; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">New Message</p></body></html> - - - - - - - - - - 24 - 24 - - - - false - - + - - + + + + + 0 + 0 + + - 44 - 28 + 0 + 0 - 28 - 28 + 16777 + 16777 @@ -586,12 +574,14 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">reply to selected message</p></body></html> - - - + - + Reply + + + + :/images/replymail-pressed.png:/images/replymail-pressed.png @@ -599,49 +589,34 @@ p, li { white-space: pre-wrap; } 24 - - - - - - - 44 - 28 - + + Qt::ToolButtonIconOnly - - - 28 - 28 - - - - - - - - 24 - 24 - + + true - + - 44 - 28 + 0 + 0 - 28 - 28 + 16777 + 16777 - + Reply all + + + + :/images/replymailall24-hover.png:/images/replymailall24-hover.png @@ -649,20 +624,61 @@ p, li { white-space: pre-wrap; } 24 + + Qt::ToolButtonIconOnly + + + true + - + - 44 - 28 + 0 + 0 - 28 - 28 + 16777 + 16777 + + + + Foward + + + + :/images/mailforward24-hover.png:/images/mailforward24-hover.png + + + + 24 + 24 + + + + Qt::ToolButtonIconOnly + + + true + + + + + + + + 0 + 0 + + + + + 16777 + 16777 @@ -675,7 +691,11 @@ p, li { white-space: pre-wrap; } - + Delete + + + + :/images/deletemail24.png:/images/deletemail24.png @@ -683,30 +703,98 @@ p, li { white-space: pre-wrap; } 24 + + Qt::ToolButtonIconOnly + + + true + + + + + + + + 0 + 0 + + + + + 167777 + 167777 + + + + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Arial'; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">New Message</p></body></html> + + + + + + Compose + + + + :/images/folder-draft24.png:/images/folder-draft24.png + + + + 24 + 24 + + + + Qt::ToolButtonIconOnly + + + true + + + + + + + Qt::Vertical + - + + + Qt::Vertical + + + + + - + 0 0 - 44 - 28 + 0 + 0 - 28 - 28 + 16777 + 16777 - + Print + + + + :/images/print24.png:/images/print24.png @@ -714,20 +802,45 @@ p, li { white-space: pre-wrap; } 24 + + QToolButton::MenuButtonPopup + + + Qt::ToolButtonIconOnly + + + true + - - - - Qt::Horizontal + + + + + 0 + 0 + - + + Display + + + + :/images/looknfeel.png:/images/looknfeel.png + + - 529 - 20 + 24 + 24 - + + QToolButton::MenuButtonPopup + + + true + + @@ -1283,6 +1396,30 @@ p, li { white-space: pre-wrap; } PrintPreview + + + Buttons Icon Only + + + Buttons Icon Only + + + + + Buttons Text Beside Icon + + + Buttons with Text + + + + + Buttons Text Under Icon + + + Set Text Under Icon + + newmessageButton