mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-25 15:39:27 -05:00
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:
parent
77418bd4b6
commit
005cf957f8
@ -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;
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>295</width>
|
||||
<width>236</width>
|
||||
<height>482</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -27,127 +27,147 @@
|
||||
</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">
|
||||
<item row="0" column="0">
|
||||
<widget class="QToolButton" name="avatarButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>70</width>
|
||||
<height>70</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>70</width>
|
||||
<height>70</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Click to Change your Avatar</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QToolButton#avatarButton{border-image: url(:/images/mystatus_bg.png);}</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="images.qrc">
|
||||
<normaloff>:/images/user/personal64.png</normaloff>:/images/user/personal64.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QPushButton" name="statusButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>70</width>
|
||||
<height>70</height>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>70</width>
|
||||
<height>70</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Click to Change your Avatar</string>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>11</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QToolButton#avatarButton{border-image: url(:/images/mystatus_bg.png);}</string>
|
||||
<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="icon">
|
||||
<iconset resource="images.qrc">
|
||||
<normaloff>:/images/user/personal64.png</normaloff>:/images/user/personal64.png</iconset>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<property name="flat">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QGridLayout">
|
||||
<property name="margin">
|
||||
<number>4</number>
|
||||
<item row="0" column="2">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<item row="1" column="0">
|
||||
<widget class="QComboBox" name="statuscomboBox">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><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;">Change your Status and your display</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">picture here.</p></body></html></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">
|
||||
<widget class="QLineEdit" name="messagelineEdit">
|
||||
<property name="toolTip">
|
||||
<string>Change your Personal Status here...</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border: 1px solid #CCCCCC;</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="nicklabel">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="3">
|
||||
<widget class="QLineEdit" name="messagelineEdit">
|
||||
<property name="toolTip">
|
||||
<string>Change your Personal Status here...</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border: 1px solid #CCCCCC;</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user