From 2d40e6cef45510aa090219f79057ab55c28b1ba7 Mon Sep 17 00:00:00 2001 From: rwoodruff91 Date: Tue, 29 Apr 2008 19:19:07 +0000 Subject: [PATCH] Added the ability to have bold, underlined or font in italics. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@529 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/BlogDialog.cpp | 23 +- retroshare-gui/src/gui/BlogDialog.h | 8 + retroshare-gui/src/gui/BlogDialog.ui | 484 +++++++++++++++----------- 3 files changed, 308 insertions(+), 207 deletions(-) diff --git a/retroshare-gui/src/gui/BlogDialog.cpp b/retroshare-gui/src/gui/BlogDialog.cpp index 2d11eb4d0..660b706f8 100644 --- a/retroshare-gui/src/gui/BlogDialog.cpp +++ b/retroshare-gui/src/gui/BlogDialog.cpp @@ -29,7 +29,12 @@ BlogDialog::BlogDialog(QWidget *parent) /* Invoke the Qt Designer generated object setup routine */ setupUi(this); - connect(Sendbtn, SIGNAL(clicked()), this, SLOT(sendMsg())); + connect(sendBtn, SIGNAL(clicked()), this, SLOT(sendMsg())); + connect(boldBtn, SIGNAL(clicked()), this, SLOT(setFont())); + connect(underlineBtn, SIGNAL(clicked()), this, SLOT(setFont())); + connect(italicBtn, SIGNAL(clicked()), this, SLOT(setFont())); + + mCurrentFont = QFont("Comic Sans MS", 8); } @@ -37,9 +42,25 @@ void BlogDialog::sendMsg() { QString msg = lineEdit->toPlainText(); + msgText->setCurrentFont(mCurrentFont); + /* Write text into windows */ msgText->append(msg); /* Clear lineEdit */ lineEdit->clear(); + } + +void BlogDialog::setFont() +{ + mCurrentFont.setUnderline(underlineBtn->isChecked()); + mCurrentFont.setItalic(italicBtn->isChecked()); + mCurrentFont.setBold(boldBtn->isChecked()); + lineEdit->setFont(mCurrentFont); + lineEdit->setFocus(); +} + + + + diff --git a/retroshare-gui/src/gui/BlogDialog.h b/retroshare-gui/src/gui/BlogDialog.h index 33007cd4f..fd1b4f10e 100644 --- a/retroshare-gui/src/gui/BlogDialog.h +++ b/retroshare-gui/src/gui/BlogDialog.h @@ -39,6 +39,14 @@ public: public slots: void sendMsg(); + void setFont(); + +private slots: +/*nothing here yet */ + +private: + +QFont mCurrentFont; }; #endif diff --git a/retroshare-gui/src/gui/BlogDialog.ui b/retroshare-gui/src/gui/BlogDialog.ui index 6f20f5fb3..33107c0d4 100644 --- a/retroshare-gui/src/gui/BlogDialog.ui +++ b/retroshare-gui/src/gui/BlogDialog.ui @@ -5,8 +5,8 @@ 0 0 - 479 - 320 + 471 + 418 @@ -504,211 +504,283 @@ - - - 6 + + + + 0 + 0 + 463 + 403 + - - 0 - - - 6 - - - 0 - - - - - - 2 - 0 - - - - Qt::Horizontal - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 6 - - - 6 - - - - - Qt::Horizontal - - - - 181 - 20 - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 6 - - - 6 - - - - - - - - :/images/chat.png - - - - - - - - 10 - 75 - true - - - - Blog Feed: - - - - - - - - - - - - 0 - 0 - - - - Qt::DefaultContextMenu - - - false - - - true - - - - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 100 - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - - - - Qt::Horizontal - - - - 321 - 20 - - - - - - - - Send - - - - - - + + + 0 + + + -1 + + + 1 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 6 + + + 6 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 6 + + + 6 + + + + + + + + :/images/chat.png + + + + + + + + 10 + 75 + true + + + + Blog Feed: + + + + + + + + + Qt::Horizontal + + + + 360 + 16 + + + + + + + + + + + 0 + 0 + + + + Qt::DefaultContextMenu + + + false + + + true + + + + + + + + + 1 + + + + + Qt::Horizontal + + + + 355 + 20 + + + + + + + + + 24 + 24 + + + + + 24 + 24 + + + + Bold + + + + + + :/images/edit-bold.png + + + true + + + + + + + + 24 + 24 + + + + + 24 + 24 + + + + Italic + + + + + + :/images/edit-underline.png + + + true + + + + + + + + 24 + 24 + + + + + 24 + 24 + + + + Underline + + + + + + :/images/edit-italic.png + + + true + + + + + + + + 0 + 0 + + + + + 16777215 + 100 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + + + + Qt::Horizontal + + + + 321 + 20 + + + + + + + + Send + + + + + + + Send