Added a Button for display own nick and set a menu for the status, removed nick label and status Combobox

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3409 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2010-08-30 19:10:07 +00:00
parent 77418bd4b6
commit 005cf957f8
2 changed files with 128 additions and 106 deletions

View File

@ -200,7 +200,6 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WFlags flags)
_rsLogoBarmessenger = new LogoBar(ui.logoframe);
Widget::createLayout(ui.logoframe)->addWidget(_rsLogoBarmessenger);
ui.statuscomboBox->setMinimumWidth(20);
ui.messagelineEdit->setMinimumWidth(20);
itemFont = QFont("ARIAL", 10);
@ -214,14 +213,14 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WFlags flags)
// add self nick
RsPeerDetails pd;
if (rsPeers->getPeerDetails(rsPeers->getOwnId(),pd)) {
QString titleStr("<span style=\"font-size:14pt; font-weight:500;"
"color:#FFFFFF;\">%1</span>");
ui.nicklabel->setText(titleStr.arg(QString::fromStdString(pd.name) + tr(" - ") + QString::fromStdString(pd.location)));
ui.statusButton->setText(QString::fromStdString(pd.name) + tr(" - ") + QString::fromStdString(pd.location));
}
MainWindow *pMainWindow = MainWindow::getInstance();
if (pMainWindow) {
pMainWindow->initializeStatusObject(ui.statuscomboBox, true);
QMenu *pStatusMenu = new QMenu();
pMainWindow->initializeStatusObject(pStatusMenu, true);
ui.statusButton->setMenu(pStatusMenu);
}
insertPeers();
updateAvatar();
@ -243,7 +242,7 @@ MessengerWindow::~MessengerWindow ()
MainWindow *pMainWindow = MainWindow::getInstance();
if (pMainWindow) {
pMainWindow->removeStatusObject(ui.statuscomboBox);
pMainWindow->removeStatusObject(ui.statusButton);
}
_instance = NULL;
@ -500,7 +499,7 @@ void MessengerWindow::insertPeers()
gpg_item -> setTextAlignment(COLUMN_NAME, Qt::AlignLeft | Qt::AlignVCenter );
gpg_item -> setSizeHint(COLUMN_NAME, QSize( 27,27 ) );
gpg_item -> setSizeHint(COLUMN_NAME, QSize( 34,34 ) );
/* not displayed, used to find back the item */
gpg_item -> setData(COLUMN_DATA, ROLE_ID, QString::fromStdString(detail.id));
@ -653,7 +652,7 @@ void MessengerWindow::insertPeers()
QPixmap avatar ;
avatar.loadFromData(data,size,"PNG") ;
QIcon avatar_icon(avatar);
QSize av_icon_size(100, 100);
QSize av_icon_size(32, 32);
gpg_item-> setIcon(1, avatar_icon);
delete[] data;

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>295</width>
<width>236</width>
<height>482</height>
</rect>
</property>
@ -27,40 +27,28 @@
</property>
<item row="0" column="0">
<widget class="QFrame" name="messengerframetop">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>82</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">#messengerframetop {
border: none;
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #a6a6a6, stop: 0.08 #7f7f7f,
stop: 0.39999 #717171, stop: 0.4 #626262,
stop: 0.9 #4c4c4c, stop: 1 #333333);
}
</string>
<string notr="true">QFrame#messengerframetop{
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #05538B, stop:1 #E4F1E5);
}</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout">
<property name="leftMargin">
<layout class="QGridLayout" name="gridLayout_5">
<property name="margin">
<number>6</number>
</property>
<property name="topMargin">
<number>6</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0" colspan="2">
<layout class="QGridLayout">
<item row="0" column="0">
<widget class="QToolButton" name="avatarButton">
<property name="minimumSize">
@ -97,37 +85,65 @@ stop: 0.9 #4c4c4c, stop: 1 #333333);
</widget>
</item>
<item row="0" column="1">
<layout class="QGridLayout">
<property name="margin">
<number>4</number>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0" colspan="2">
<widget class="QPushButton" name="statusButton">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="spacing">
<number>6</number>
<property name="font">
<font>
<pointsize>11</pointsize>
</font>
</property>
<item row="1" column="0">
<widget class="QComboBox" name="statuscomboBox">
<property name="enabled">
<property name="styleSheet">
<string notr="true">QPushButton:hover {
border: 2px solid #8f8f91;
border-radius: 6px;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #f6f7fa, stop: 1 #dadbde);
min-width: 80px;
}
QPushButton:pressed {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #dadbde, stop: 1 #f6f7fa);
}
QPushButton:flat {
border: none; /* no border for a flat push button */
}
QPushButton:default {
border-color: navy; /* make the default button prominent */
}</string>
</property>
<property name="text">
<string/>
</property>
<property name="flat">
<bool>true</bool>
</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;Change your Status and your display&lt;/p&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;picture here.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="insertPolicy">
<enum>QComboBox::NoInsert</enum>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="modelColumn">
<number>0</number>
</property>
</widget>
</item>
<item row="2" column="0">
<item row="0" column="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>50</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0" colspan="3">
<widget class="QLineEdit" name="messagelineEdit">
<property name="toolTip">
<string>Change your Personal Status here...</string>
@ -137,16 +153,20 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="nicklabel">
<property name="text">
<string>TextLabel</string>
</layout>
</item>
<item row="1" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
</layout>
</item>
</layout>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
@ -423,6 +443,9 @@ border: 1px solid #CCCCCC;
<attribute name="headerShowSortIndicator" stdset="0">
<bool>false</bool>
</attribute>
<attribute name="headerShowSortIndicator" stdset="0">
<bool>false</bool>
</attribute>
</widget>
</item>
</layout>
@ -435,8 +458,8 @@ border: 1px solid #CCCCCC;
<rect>
<x>0</x>
<y>0</y>
<width>295</width>
<height>21</height>
<width>236</width>
<height>20</height>
</rect>
</property>
</widget>