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.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 = ""; mCurrCertId = "";
mCurrMsgId = ""; mCurrMsgId = "";
@ -113,13 +118,6 @@ MessagesDialog::MessagesDialog(QWidget *parent)
msglheader->resizeSection ( 2, 100 ); msglheader->resizeSection ( 2, 100 );
msglheader->resizeSection ( 3, 200 ); 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.forwardmessageButton->setToolTip(tr("Forward selected Message"));
ui.replyallmessageButton->setToolTip(tr("Reply to All")); ui.replyallmessageButton->setToolTip(tr("Reply to All"));
@ -128,6 +126,12 @@ MessagesDialog::MessagesDialog(QWidget *parent)
printmenu->addAction(ui.actionPrintPreview); printmenu->addAction(ui.actionPrintPreview);
ui.printbutton->setMenu(printmenu); 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->setSelectionMode(QAbstractItemView::ExtendedSelection);
ui.msgWidget->sortItems( 3, Qt::DescendingOrder ); ui.msgWidget->sortItems( 3, Qt::DescendingOrder );
@ -958,3 +962,38 @@ void MessagesDialog::anchorClicked (const QUrl& link )
QDesktopServices::openUrl(QUrl(newAddress)); 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

@ -68,6 +68,10 @@ private slots:
/* handle splitter */ /* handle splitter */
void togglefileview(); void togglefileview();
void buttonstextbesideicon();
void buttonsicononly();
void buttonstextundericon();
private: private:
bool getCurrentMsg(std::string &cid, std::string &mid); bool getCurrentMsg(std::string &cid, std::string &mid);

View file

@ -511,6 +511,12 @@
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QFrame" name="frame"> <widget class="QFrame" name="frame">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">QFrame#frame{ <string notr="true">QFrame#frame{
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
@ -528,55 +534,37 @@ border: 1px solid #CCCCCC;}</string>
<property name="margin"> <property name="margin">
<number>2</number> <number>2</number>
</property> </property>
<item row="0" column="0"> <item row="0" column="9">
<widget class="QPushButton" name="newmessageButton"> <spacer>
<property name="minimumSize"> <property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size> <size>
<width>44</width> <width>529</width>
<height>28</height> <height>20</height>
</size> </size>
</property> </property>
<property name="maximumSize"> </spacer>
<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>
</item> </item>
<item row="0" column="1"> <item row="0" column="2">
<widget class="QPushButton" name="replymessageButton"> <widget class="QToolButton" name="replymessageButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>44</width> <width>0</width>
<height>28</height> <height>0</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>28</width> <width>16777</width>
<height>28</height> <height>16777</height>
</size> </size>
</property> </property>
<property name="toolTip"> <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> &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>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true"> <string notr="true"/>
</string>
</property> </property>
<property name="text"> <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>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -599,49 +589,34 @@ p, li { white-space: pre-wrap; }
<height>24</height> <height>24</height>
</size> </size>
</property> </property>
</widget> <property name="toolButtonStyle">
</item> <enum>Qt::ToolButtonIconOnly</enum>
<item row="0" column="2">
<widget class="QPushButton" name="replyallmessageButton">
<property name="minimumSize">
<size>
<width>44</width>
<height>28</height>
</size>
</property> </property>
<property name="maximumSize"> <property name="autoRaise">
<size> <bool>true</bool>
<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> </property>
</widget> </widget>
</item> </item>
<item row="0" column="3"> <item row="0" column="3">
<widget class="QPushButton" name="forwardmessageButton"> <widget class="QToolButton" name="replyallmessageButton">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>44</width> <width>0</width>
<height>28</height> <height>0</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>28</width> <width>16777</width>
<height>28</height> <height>16777</height>
</size> </size>
</property> </property>
<property name="text"> <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>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -649,20 +624,61 @@ p, li { white-space: pre-wrap; }
<height>24</height> <height>24</height>
</size> </size>
</property> </property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget> </widget>
</item> </item>
<item row="0" column="4"> <item row="0" column="4">
<widget class="QPushButton" name="removemessageButton"> <widget class="QToolButton" name="forwardmessageButton">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>44</width> <width>0</width>
<height>28</height> <height>0</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>28</width> <width>16777</width>
<height>28</height> <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> </size>
</property> </property>
<property name="toolTip"> <property name="toolTip">
@ -675,7 +691,11 @@ p, li { white-space: pre-wrap; }
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="text"> <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>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -683,30 +703,98 @@ p, li { white-space: pre-wrap; }
<height>24</height> <height>24</height>
</size> </size>
</property> </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> </widget>
</item> </item>
<item row="0" column="5"> <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"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>44</width> <width>0</width>
<height>28</height> <height>0</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>28</width> <width>16777</width>
<height>28</height> <height>16777</height>
</size> </size>
</property> </property>
<property name="text"> <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>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -714,20 +802,45 @@ p, li { white-space: pre-wrap; }
<height>24</height> <height>24</height>
</size> </size>
</property> </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> </widget>
</item> </item>
<item row="0" column="6"> <item row="0" column="8">
<spacer> <widget class="QToolButton" name="viewtoolButton">
<property name="orientation"> <property name="sizePolicy">
<enum>Qt::Horizontal</enum> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </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> <size>
<width>529</width> <width>24</width>
<height>20</height> <height>24</height>
</size> </size>
</property> </property>
</spacer> <property name="popupMode">
<enum>QToolButton::MenuButtonPopup</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>
@ -1283,6 +1396,30 @@ p, li { white-space: pre-wrap; }
<string>PrintPreview</string> <string>PrintPreview</string>
</property> </property>
</action> </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> </widget>
<tabstops> <tabstops>
<tabstop>newmessageButton</tabstop> <tabstop>newmessageButton</tabstop>