little layout improvements for messages

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2111 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2010-01-22 01:05:45 +00:00
parent 09acb717a0
commit 51c2e5b642
3 changed files with 280 additions and 100 deletions

View File

@ -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);
}

View File

@ -67,6 +67,10 @@ private slots:
/* handle splitter */
void togglefileview();
void buttonstextbesideicon();
void buttonsicononly();
void buttonstextundericon();
private:

View File

@ -511,6 +511,12 @@
</property>
<item row="0" column="0">
<widget class="QFrame" name="frame">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QFrame#frame{
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
@ -528,55 +534,37 @@ border: 1px solid #CCCCCC;}</string>
<property name="margin">
<number>2</number>
</property>
<item row="0" column="0">
<widget class="QPushButton" name="newmessageButton">
<property name="minimumSize">
<item row="0" column="9">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>44</width>
<height>28</height>
<width>529</width>
<height>20</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Arial'; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;New Message&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string/>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="default">
<bool>false</bool>
</property>
</widget>
</spacer>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="replymessageButton">
<item row="0" column="2">
<widget class="QToolButton" name="replymessageButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>44</width>
<height>28</height>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>28</width>
<height>28</height>
<width>16777</width>
<height>16777</height>
</size>
</property>
<property name="toolTip">
@ -586,12 +574,14 @@ p, li { white-space: pre-wrap; }
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;reply to selected message&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="styleSheet">
<string notr="true">
</string>
<string notr="true"/>
</property>
<property name="text">
<string/>
<string>Reply</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/replymail-pressed.png</normaloff>:/images/replymail-pressed.png</iconset>
</property>
<property name="iconSize">
<size>
@ -599,49 +589,34 @@ p, li { white-space: pre-wrap; }
<height>24</height>
</size>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="replyallmessageButton">
<property name="minimumSize">
<size>
<width>44</width>
<height>28</height>
</size>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
</property>
<property name="maximumSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QPushButton" name="forwardmessageButton">
<widget class="QToolButton" name="replyallmessageButton">
<property name="minimumSize">
<size>
<width>44</width>
<height>28</height>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>28</width>
<height>28</height>
<width>16777</width>
<height>16777</height>
</size>
</property>
<property name="text">
<string/>
<string>Reply all</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/replymailall24-hover.png</normaloff>:/images/replymailall24-hover.png</iconset>
</property>
<property name="iconSize">
<size>
@ -649,20 +624,61 @@ p, li { white-space: pre-wrap; }
<height>24</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QPushButton" name="removemessageButton">
<widget class="QToolButton" name="forwardmessageButton">
<property name="minimumSize">
<size>
<width>44</width>
<height>28</height>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>28</width>
<height>28</height>
<width>16777</width>
<height>16777</height>
</size>
</property>
<property name="text">
<string>Foward</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/mailforward24-hover.png</normaloff>:/images/mailforward24-hover.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="6">
<widget class="QToolButton" name="removemessageButton">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777</width>
<height>16777</height>
</size>
</property>
<property name="toolTip">
@ -675,7 +691,11 @@ p, li { white-space: pre-wrap; }
<string notr="true"/>
</property>
<property name="text">
<string/>
<string>Delete</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/deletemail24.png</normaloff>:/images/deletemail24.png</iconset>
</property>
<property name="iconSize">
<size>
@ -683,30 +703,98 @@ p, li { white-space: pre-wrap; }
<height>24</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QToolButton" name="newmessageButton">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>167777</width>
<height>167777</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Arial'; font-size:8pt; font-weight:400; font-style:normal; text-decoration:none;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;New Message&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>Compose</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/folder-draft24.png</normaloff>:/images/folder-draft24.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="QPushButton" name="printbutton">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="0" column="7">
<widget class="QToolButton" name="printbutton">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>44</width>
<height>28</height>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>28</width>
<height>28</height>
<width>16777</width>
<height>16777</height>
</size>
</property>
<property name="text">
<string/>
<string>Print</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/print24.png</normaloff>:/images/print24.png</iconset>
</property>
<property name="iconSize">
<size>
@ -714,20 +802,45 @@ p, li { white-space: pre-wrap; }
<height>24</height>
</size>
</property>
<property name="popupMode">
<enum>QToolButton::MenuButtonPopup</enum>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="6">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
<item row="0" column="8">
<widget class="QToolButton" name="viewtoolButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeHint" stdset="0">
<property name="text">
<string>Display</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/looknfeel.png</normaloff>:/images/looknfeel.png</iconset>
</property>
<property name="iconSize">
<size>
<width>529</width>
<height>20</height>
<width>24</width>
<height>24</height>
</size>
</property>
</spacer>
<property name="popupMode">
<enum>QToolButton::MenuButtonPopup</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
@ -1283,6 +1396,30 @@ p, li { white-space: pre-wrap; }
<string>PrintPreview</string>
</property>
</action>
<action name="actionIconOnly">
<property name="text">
<string>Buttons Icon Only</string>
</property>
<property name="toolTip">
<string>Buttons Icon Only</string>
</property>
</action>
<action name="actionTextBesideIcon">
<property name="text">
<string>Buttons Text Beside Icon</string>
</property>
<property name="toolTip">
<string>Buttons with Text</string>
</property>
</action>
<action name="actionTextUnderIcon">
<property name="text">
<string>Buttons Text Under Icon</string>
</property>
<property name="toolTip">
<string>Set Text Under Icon</string>
</property>
</action>
</widget>
<tabstops>
<tabstop>newmessageButton</tabstop>