mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-03 06:35:08 -04:00
* Fixed Colors and Fonts for Private and Group Chat.
* Fixed Chat Delay. * Cleaned up Options->Server, removing unneccessary stuff. * Cleaned up Config Friend, removing stuff. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@472 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
cb795b3c67
commit
65bb6a65d7
9 changed files with 453 additions and 501 deletions
|
@ -101,15 +101,16 @@ PopupChatDialog::PopupChatDialog(std::string id, std::string name,
|
|||
fontmenu->addAction(ui.actionItalic);
|
||||
fontmenu->addAction(ui.actionStrike);
|
||||
ui.fontButton->setMenu(fontmenu);*/
|
||||
|
||||
QPixmap pxm(24,24);
|
||||
pxm.fill(Qt::black);
|
||||
ui.colorButton->setIcon(pxm);
|
||||
|
||||
QFont font = QFont("Comic Sans MS", 10);
|
||||
|
||||
}
|
||||
|
||||
|
||||
mCurrentColor = Qt::black;
|
||||
mCurrentFont = QFont("Comic Sans MS", 12);
|
||||
|
||||
colorChanged(mCurrentColor);
|
||||
setFont();
|
||||
|
||||
|
||||
}
|
||||
|
||||
/** Destructor. */
|
||||
PopupChatDialog::~PopupChatDialog()
|
||||
{
|
||||
|
@ -258,7 +259,8 @@ void PopupChatDialog::sendChat()
|
|||
ci.name = dialogName;
|
||||
|
||||
rsMsgs -> ChatSend(ci);
|
||||
chatWidget ->clear();
|
||||
chatWidget ->clear();
|
||||
setFont();
|
||||
|
||||
/* redraw send list */
|
||||
}
|
||||
|
@ -279,22 +281,19 @@ void PopupChatDialog::showAvatarFrame(bool show)
|
|||
ui.avatarFrameButton->setToolTip(tr("Show Avatar"));
|
||||
ui.avatarFrameButton->setIcon(QIcon(tr(":images/show_toolbox_frame.png")));
|
||||
}
|
||||
}
|
||||
|
||||
void PopupChatDialog::setColor()
|
||||
{
|
||||
bool ok;
|
||||
QRgb color = QColorDialog::getRgba(ui.chattextEdit->textColor().rgba(), &ok, this);
|
||||
if (ok) {
|
||||
|
||||
currentColor = QColor(color);
|
||||
ui.chattextEdit->setTextColor(currentColor);
|
||||
colorChanged(currentColor);
|
||||
}
|
||||
ui.chattextEdit->setFocus();
|
||||
QTextCursor cursor = ui.chattextEdit->textCursor();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void PopupChatDialog::setColor()
|
||||
{
|
||||
bool ok;
|
||||
QRgb color = QColorDialog::getRgba(ui.chattextEdit->textColor().rgba(), &ok, this);
|
||||
if (ok) {
|
||||
mCurrentColor = QColor(color);
|
||||
colorChanged(mCurrentColor);
|
||||
}
|
||||
setFont();
|
||||
}
|
||||
|
||||
void PopupChatDialog::colorChanged(const QColor &c)
|
||||
{
|
||||
QPixmap pix(16, 16);
|
||||
|
@ -302,24 +301,27 @@ void PopupChatDialog::colorChanged(const QColor &c)
|
|||
ui.colorButton->setIcon(pix);
|
||||
}
|
||||
|
||||
void PopupChatDialog::getFont()
|
||||
{
|
||||
bool ok;
|
||||
QFont font = QFontDialog::getFont(&ok, QFont(ui.chattextEdit->toHtml()), this);
|
||||
if (ok) {
|
||||
ui.chattextEdit->setFont(font);
|
||||
}
|
||||
}
|
||||
|
||||
void PopupChatDialog::setFont()
|
||||
{
|
||||
QFont font = QFont("Comic Sans MS", 10);
|
||||
font.setBold(ui.textboldButton->isChecked());
|
||||
font.setUnderline(ui.textunderlineButton->isChecked());
|
||||
font.setItalic(ui.textitalicButton->isChecked());
|
||||
ui.chattextEdit->setFont(font);
|
||||
}
|
||||
|
||||
void PopupChatDialog::getFont()
|
||||
{
|
||||
bool ok;
|
||||
mCurrentFont = QFontDialog::getFont(&ok, mCurrentFont, this);
|
||||
setFont();
|
||||
}
|
||||
|
||||
void PopupChatDialog::setFont()
|
||||
{
|
||||
|
||||
mCurrentFont.setBold(ui.textboldButton->isChecked());
|
||||
mCurrentFont.setUnderline(ui.textunderlineButton->isChecked());
|
||||
mCurrentFont.setItalic(ui.textitalicButton->isChecked());
|
||||
|
||||
ui.chattextEdit->setFont(mCurrentFont);
|
||||
ui.chattextEdit->setTextColor(mCurrentColor);
|
||||
|
||||
ui.chattextEdit->setFocus();
|
||||
|
||||
}
|
||||
|
||||
void PopupChatDialog::loadEmoticons()
|
||||
{
|
||||
QDir smdir(QApplication::applicationDirPath() + "/emoticons/kopete");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue