diff --git a/retroshare-gui/src/gui/MessagesDialog.cpp b/retroshare-gui/src/gui/MessagesDialog.cpp index 43d5df056..2d4560ee4 100644 --- a/retroshare-gui/src/gui/MessagesDialog.cpp +++ b/retroshare-gui/src/gui/MessagesDialog.cpp @@ -78,7 +78,8 @@ MessagesDialog::MessagesDialog(QWidget *parent) QHeaderView * msgwheader = ui.msgWidget->header () ; msgwheader->setResizeMode (0, QHeaderView::Interactive); - msgwheader->resizeSection ( 0, 125 ); + msgwheader->resizeSection ( 0, 140 ); + msgwheader->resizeSection ( 2, 150 ); /* Set header resize modes and initial section sizes */ QHeaderView * msglheader = ui.msgList->header () ; @@ -87,10 +88,10 @@ MessagesDialog::MessagesDialog(QWidget *parent) msglheader->setResizeMode (2, QHeaderView::Interactive); msglheader->setResizeMode (3, QHeaderView::Interactive); - msglheader->resizeSection ( 0, 125 ); + msglheader->resizeSection ( 0, 200 ); msglheader->resizeSection ( 1, 100 ); - msglheader->resizeSection ( 2, 250 ); - msglheader->resizeSection ( 3, 50 ); + msglheader->resizeSection ( 2, 100 ); + msglheader->resizeSection ( 3, 200 ); /* Hide platform specific features */ diff --git a/retroshare-gui/src/gui/MessagesDialog.ui b/retroshare-gui/src/gui/MessagesDialog.ui index 36ff3952d..f7d8d9cc8 100644 --- a/retroshare-gui/src/gui/MessagesDialog.ui +++ b/retroshare-gui/src/gui/MessagesDialog.ui @@ -780,7 +780,7 @@ border-image: url(:/images/deletemail-pressed.png); - + @@ -1130,6 +1130,12 @@ p, li { white-space: pre-wrap; } + + <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;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Download all Recommended Files</p></body></html> + diff --git a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp index 5e71071c2..502b82d93 100644 --- a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp +++ b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp @@ -58,12 +58,16 @@ PopupChatDialog::PopupChatDialog(std::string id, std::string name, connect(ui.sendButton, SIGNAL(clicked( ) ), this, SLOT(sendChat( ) )); connect(ui.colorButton, SIGNAL(clicked()), this, SLOT(setColor())); + connect(ui.fontButton, SIGNAL(clicked()), this, SLOT(setFont())); + + connect(ui.textboldButton, SIGNAL(triggered()), this, SLOT(insertBold())); + connect(ui.textunderlineButton, SIGNAL(triggered()), this, SLOT(insertUnderline())); + connect(ui.textitalicButton, SIGNAL(triggered()), this, SLOT(insertItalic())); - connect(ui.textboldButton, SIGNAL(clicked()), this, SLOT(textBold())); - - connect(ui.textunderlineButton, SIGNAL(clicked()), this, SLOT(textUnderline())); - - connect(ui.textitalicButton, SIGNAL(clicked()), this, SLOT(textItalic())); + //connect(ui.actionBold, SIGNAL(triggered()), this, SLOT(insertBold())); + //connect(ui.actionItalic, SIGNAL(triggered()), this, SLOT(insertItalic())); + //connect(ui.actionStrike, SIGNAL(triggered()), this, SLOT(insertStrike())); + //connect(ui.actionUnderline, SIGNAL(triggered()), this, SLOT(insertUnderline())); // Create the status bar std::ostringstream statusstr; @@ -80,7 +84,12 @@ PopupChatDialog::PopupChatDialog(std::string id, std::string name, setWindowIcon(QIcon(QString(":/images/rstray3.png"))); ui.textboldButton->setIcon(QIcon(QString(":/images/edit-bold.png"))); ui.textunderlineButton->setIcon(QIcon(QString(":/images/edit-underline.png"))); - ui.textitalicButton->setIcon(QIcon(QString(":/images/edit-italic.png"))); + ui.textitalicButton->setIcon(QIcon(QString(":/images/edit-italic.png"))); + ui.fontButton->setIcon(QIcon(QString(":/images/fonts.png"))); + + //QMenu * fontmenu = new QMenu(); + //fontmenu->addAction(actionBold); + //ui.fontButton->setMenu(fontmenu); } @@ -121,57 +130,20 @@ void PopupChatDialog::setColor() ui.colorButton->setPalette(QPalette(col)); QTextCharFormat fmt; fmt.setForeground(col); - mergeFormatOnWordOrSelection(fmt); colorChanged(col); } } -void PopupChatDialog::textBold() +void PopupChatDialog::setFont() { - QTextCharFormat fmt; - fmt.setFontWeight(ui.textboldButton->isChecked() ? QFont::Bold : QFont::Normal); - mergeFormatOnWordOrSelection(fmt); + bool ok; + QFont font = QFontDialog::getFont(&ok, QFont(ui.lineEdit->text()), this); + if (ok) { + //ui.lineEdit->setText(font.key()); + ui.lineEdit->setFont(font); + } } -void PopupChatDialog::textUnderline() -{ - QTextCharFormat fmt; - fmt.setFontUnderline(ui.textunderlineButton->isChecked()); - mergeFormatOnWordOrSelection(fmt); -} - -void PopupChatDialog::textItalic() -{ - QTextCharFormat fmt; - fmt.setFontItalic(ui.textitalicButton->isChecked()); - mergeFormatOnWordOrSelection(fmt); -} - -void PopupChatDialog::currentCharFormatChanged(const QTextCharFormat &format) -{ - fontChanged(format.font()); - colorChanged(format.foreground().color()); -} - -void PopupChatDialog::mergeFormatOnWordOrSelection(const QTextCharFormat &format) -{ - QTextCursor cursor = ui.textBrowser->textCursor(); - if (!cursor.hasSelection()) - cursor.select(QTextCursor::WordUnderCursor); - cursor.mergeCharFormat(format); - ui.textBrowser->mergeCurrentCharFormat(format); -} - -void PopupChatDialog::fontChanged(const QFont &f) -{ - //comboFont->setCurrentIndex(comboFont->findText(QFontInfo(f).family())); - //comboSize->setCurrentIndex(comboSize->findText(QString::number(f.pointSize()))); - ui.textboldButton->setChecked(f.bold()); - ui.textunderlineButton->setChecked(f.italic()); - ui.textitalicButton->setChecked(f.underline()); -} - - void PopupChatDialog::colorChanged(const QColor &c) { @@ -190,7 +162,6 @@ void PopupChatDialog::updateChat() } - void PopupChatDialog::addChatMsg(ChatInfo *ci) { QTextBrowser *msgWidget = ui.textBrowser; @@ -294,3 +265,46 @@ void PopupChatDialog::showAvatarFrame(bool show) ui.avatarFrameButton->setIcon(QIcon(tr(":images/show_toolbox_frame.png"))); } } + +void PopupChatDialog::insertBold() +{ + + this->insertAutour(tr(""), tr("")); + this->ui.lineEdit->setFocus(); + +} + +void PopupChatDialog::insertItalic() +{ + + this->insertAutour(tr(""), tr("")); + this->ui.lineEdit->setFocus(); + +} + +void PopupChatDialog::insertUnderline() +{ + + this->insertAutour(tr(""), tr("")); + this->ui.lineEdit->setFocus(); + +} + +void PopupChatDialog::insertStrike() +{ + + this->insertAutour(tr(""), tr("")); + this->ui.lineEdit->setFocus(); + +} + +void PopupChatDialog::insertAutour(QString leftTruc,QString rightTruc) +{ + int p0 = ui.lineEdit->cursorPosition(); + QString stringToInsert = leftTruc ; + stringToInsert.append(rightTruc); + ui.lineEdit->insert(stringToInsert); + ui.lineEdit->setCursorPosition(p0 + leftTruc.size()); + +} + diff --git a/retroshare-gui/src/gui/chat/PopupChatDialog.h b/retroshare-gui/src/gui/chat/PopupChatDialog.h index 8051197e1..b93bc7d23 100644 --- a/retroshare-gui/src/gui/chat/PopupChatDialog.h +++ b/retroshare-gui/src/gui/chat/PopupChatDialog.h @@ -49,6 +49,12 @@ public: void updateChat(); void addChatMsg(ChatInfo *ci); + + void insertBold(); + void insertItalic(); + void insertUnderline(); + void insertStrike(); + void insertAutour(QString leftTruc,QString rightTruc); public slots: /** Overloaded QWidget.show */ @@ -61,23 +67,13 @@ private slots: void showAvatarFrame(bool show); - void setColor(); - - void textBold(); - void textUnderline(); - void textItalic(); - - void sendChat(); + void setColor(); + void setFont(); - void currentCharFormatChanged(const QTextCharFormat &format); - - + void sendChat(); private: - - void mergeFormatOnWordOrSelection(const QTextCharFormat &format); - void fontChanged(const QFont &f); void colorChanged(const QColor &c); diff --git a/retroshare-gui/src/gui/chat/PopupChatDialog.ui b/retroshare-gui/src/gui/chat/PopupChatDialog.ui index f2db1cbc5..400a935f3 100644 --- a/retroshare-gui/src/gui/chat/PopupChatDialog.ui +++ b/retroshare-gui/src/gui/chat/PopupChatDialog.ui @@ -82,18 +82,6 @@ - - 0 - - - 8 - - - 6 - - - 8 - @@ -101,8 +89,8 @@ - 261 - 20 + 291 + 24 @@ -128,7 +116,7 @@ C:/Dokumente und Einstellungen/Linux/.designer/backup - true + false @@ -153,7 +141,7 @@ C:/Dokumente und Einstellungen/Linux/.designer/backup - true + false @@ -178,11 +166,36 @@ C:/Dokumente und Einstellungen/Linux/.designer/backup - true + false + + + + 24 + 24 + + + + + 24 + 24 + + + + + + + C:/Dokumente und Einstellungen/Linux/.designer/backup + + + false + + + + diff --git a/retroshare-gui/src/gui/images.qrc b/retroshare-gui/src/gui/images.qrc index 5314445c9..821af3b4e 100644 --- a/retroshare-gui/src/gui/images.qrc +++ b/retroshare-gui/src/gui/images.qrc @@ -4,6 +4,7 @@ help/licence.html help/thanks.html images/addfriendlabel.png + images/backgroundl.png images/blockdevice.png images/channels.png images/channeldelete.png @@ -16,6 +17,7 @@ images/FileTypePicture.png images/FileTypeProgram.png images/FileTypeVideo.png + images/fonts.png images/RetroShare16.png images/add-friend24.png images/add-share24.png diff --git a/retroshare-gui/src/gui/images/backgroundl.png b/retroshare-gui/src/gui/images/backgroundl.png new file mode 100644 index 000000000..13d166dbe Binary files /dev/null and b/retroshare-gui/src/gui/images/backgroundl.png differ diff --git a/retroshare-gui/src/gui/images/fonts.png b/retroshare-gui/src/gui/images/fonts.png new file mode 100644 index 000000000..267a732e6 Binary files /dev/null and b/retroshare-gui/src/gui/images/fonts.png differ