From 005cf957f85f1e4caac3a61083ca89627b823df0 Mon Sep 17 00:00:00 2001 From: defnax Date: Mon, 30 Aug 2010 19:10:07 +0000 Subject: [PATCH] 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 --- retroshare-gui/src/gui/MessengerWindow.cpp | 15 +- retroshare-gui/src/gui/MessengerWindow.ui | 219 ++++++++++++--------- 2 files changed, 128 insertions(+), 106 deletions(-) diff --git a/retroshare-gui/src/gui/MessengerWindow.cpp b/retroshare-gui/src/gui/MessengerWindow.cpp index cd62c5e99..8497c1320 100644 --- a/retroshare-gui/src/gui/MessengerWindow.cpp +++ b/retroshare-gui/src/gui/MessengerWindow.cpp @@ -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("%1"); - 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; diff --git a/retroshare-gui/src/gui/MessengerWindow.ui b/retroshare-gui/src/gui/MessengerWindow.ui index c3a214eab..52f7801be 100644 --- a/retroshare-gui/src/gui/MessengerWindow.ui +++ b/retroshare-gui/src/gui/MessengerWindow.ui @@ -6,7 +6,7 @@ 0 0 - 295 + 236 482 @@ -27,127 +27,147 @@ + + + 16777215 + 82 + + - #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); -} - + QFrame#messengerframetop{ +background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, +stop:0 #05538B, stop:1 #E4F1E5); +} - QFrame::StyledPanel + QFrame::NoFrame QFrame::Raised - - + + 6 - - 6 - - - 6 - - - 2 - - - 0 - - - - - + + + + + 70 + 70 + + + + + 70 + 70 + + + + Click to Change your Avatar + + + QToolButton#avatarButton{border-image: url(:/images/mystatus_bg.png);} + + + + :/images/user/personal64.png:/images/user/personal64.png + + + + 50 + 50 + + + + true + + + + + + + - 70 - 70 + 100 + 0 - - - 70 - 70 - - - - Click to Change your Avatar + + + 11 + - QToolButton#avatarButton{border-image: url(:/images/mystatus_bg.png);} + 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 */ + } - - - :/images/user/personal64.png:/images/user/personal64.png + + - - - 50 - 50 - - - + true - - - - 4 + + + + Qt::Horizontal - - 6 + + + 50 + 20 + - - - - true - - - <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> - - - QComboBox::NoInsert - - - true - - - 0 - - - - - - - Change your Personal Status here... - - - border: 1px solid #CCCCCC; - - - - - - - TextLabel - - - - + + + + + + Change your Personal Status here... + + + border: 1px solid #CCCCCC; + + + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -423,6 +443,9 @@ border: 1px solid #CCCCCC; false + + false + @@ -435,8 +458,8 @@ border: 1px solid #CCCCCC; 0 0 - 295 - 21 + 236 + 20