mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-26 23:36:59 -05:00
fixed color Buttons with basic html functions
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@406 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
06cb4cf01f
commit
ba87009a25
@ -73,6 +73,9 @@ ChatDialog::ChatDialog(QWidget *parent)
|
|||||||
ui.msgSendList->header()->hide();
|
ui.msgSendList->header()->hide();
|
||||||
|
|
||||||
textColor = Qt::black;
|
textColor = Qt::black;
|
||||||
|
QPixmap pxm(24,24);
|
||||||
|
pxm.fill(textColor);
|
||||||
|
ui.colorChatButton->setIcon(pxm);
|
||||||
|
|
||||||
|
|
||||||
/* Hide platform specific features */
|
/* Hide platform specific features */
|
||||||
@ -278,6 +281,9 @@ void ChatDialog::setColor()
|
|||||||
textColor = QColorDialog::getColor(Qt::black, this);
|
textColor = QColorDialog::getColor(Qt::black, this);
|
||||||
QPixmap pxm(24,24);
|
QPixmap pxm(24,24);
|
||||||
pxm.fill(textColor);
|
pxm.fill(textColor);
|
||||||
|
ui.lineEdit->setText(QString(tr("<a style=\"color:")) + (textColor.name()));
|
||||||
|
this->insertAutour(tr("\">"), tr("</style>"));
|
||||||
|
this->ui.lineEdit->setFocus();
|
||||||
ui.colorChatButton->setIcon(pxm);
|
ui.colorChatButton->setIcon(pxm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,6 +100,7 @@ PopupChatDialog::PopupChatDialog(std::string id, std::string name,
|
|||||||
ui.fontButton->setMenu(fontmenu);
|
ui.fontButton->setMenu(fontmenu);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Destructor. */
|
/** Destructor. */
|
||||||
@ -117,7 +118,7 @@ void PopupChatDialog::show()
|
|||||||
if(!this->isVisible()) {
|
if(!this->isVisible()) {
|
||||||
QMainWindow::show();
|
QMainWindow::show();
|
||||||
} else {
|
} else {
|
||||||
//QMainWindow::activateWindow();
|
QMainWindow::activateWindow();
|
||||||
setWindowState(windowState() & ~Qt::WindowMinimized | Qt::WindowActive);
|
setWindowState(windowState() & ~Qt::WindowMinimized | Qt::WindowActive);
|
||||||
QMainWindow::raise();
|
QMainWindow::raise();
|
||||||
}
|
}
|
||||||
@ -136,6 +137,9 @@ void PopupChatDialog::setColor()
|
|||||||
if (col.isValid()) {
|
if (col.isValid()) {
|
||||||
|
|
||||||
ui.colorButton->setPalette(QPalette(col));
|
ui.colorButton->setPalette(QPalette(col));
|
||||||
|
ui.lineEdit->setText(QString(tr("<a style=\"color:")) + (col.name()));
|
||||||
|
this->insertAutour(tr("\">"), tr("</style>"));
|
||||||
|
this->ui.lineEdit->setFocus();
|
||||||
QTextCharFormat fmt;
|
QTextCharFormat fmt;
|
||||||
fmt.setForeground(col);
|
fmt.setForeground(col);
|
||||||
colorChanged(col);
|
colorChanged(col);
|
||||||
@ -316,3 +320,5 @@ void PopupChatDialog::insertAutour(QString leftTruc,QString rightTruc)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -61,6 +61,7 @@ public slots:
|
|||||||
void insertStrike();
|
void insertStrike();
|
||||||
void insertAutour(QString leftTruc,QString rightTruc);
|
void insertAutour(QString leftTruc,QString rightTruc);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void closeEvent (QCloseEvent * event);
|
void closeEvent (QCloseEvent * event);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user