mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-17 10:31:05 -04:00
The standard font is now used for new chat lobbies.
Added a new menu item to set the font of a private chat and chat lobby to the default font. Fixed german language. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4926 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
f441f4a407
commit
d828d23ca7
9 changed files with 215 additions and 186 deletions
|
@ -119,8 +119,8 @@ FriendsDialog::FriendsDialog(QWidget *parent)
|
|||
connect(ui.textboldChatButton, SIGNAL(clicked()), this, SLOT(setFont()));
|
||||
connect(ui.textunderlineChatButton, SIGNAL(clicked()), this, SLOT(setFont()));
|
||||
connect(ui.textitalicChatButton, SIGNAL(clicked()), this, SLOT(setFont()));
|
||||
connect(ui.fontsButton, SIGNAL(clicked()), this, SLOT(getFont()));
|
||||
connect(ui.colorChatButton, SIGNAL(clicked()), this, SLOT(setColor()));
|
||||
connect(ui.fontsButton, SIGNAL(clicked()), this, SLOT(chooseFont()));
|
||||
connect(ui.colorChatButton, SIGNAL(clicked()), this, SLOT(chooseColor()));
|
||||
connect(ui.actionSave_History, SIGNAL(triggered()), this, SLOT(fileSaveAs()));
|
||||
|
||||
connect(ui.hashBox, SIGNAL(fileHashingFinished(QList<HashedFile>)), this, SLOT(fileHashingFinished(QList<HashedFile>)));
|
||||
|
@ -130,8 +130,9 @@ FriendsDialog::FriendsDialog(QWidget *parent)
|
|||
mCurrentColor = Qt::black;
|
||||
mCurrentFont.fromString(Settings->getChatScreenFont());
|
||||
|
||||
colorChanged(mCurrentColor);
|
||||
fontChanged(mCurrentFont);
|
||||
colorChanged();
|
||||
fontChanged();
|
||||
setColorAndFont();
|
||||
|
||||
style.setStyleFromSettings(ChatStyle::TYPE_PUBLIC);
|
||||
|
||||
|
@ -150,14 +151,14 @@ FriendsDialog::FriendsDialog(QWidget *parent)
|
|||
}
|
||||
}
|
||||
|
||||
QMenu * grpchatmenu = new QMenu();
|
||||
grpchatmenu->addAction(ui.actionClear_Chat_History);
|
||||
grpchatmenu->addAction(ui.actionDelete_Chat_History);
|
||||
grpchatmenu->addAction(ui.actionSave_History);
|
||||
grpchatmenu->addAction(ui.actionMessageHistory);
|
||||
ui.menuButton->setMenu(grpchatmenu);
|
||||
|
||||
QMenu *menu = new QMenu();
|
||||
menu->addAction(ui.actionClear_Chat_History);
|
||||
menu->addAction(ui.actionDelete_Chat_History);
|
||||
menu->addAction(ui.actionSave_History);
|
||||
menu->addAction(ui.actionMessageHistory);
|
||||
ui.menuButton->setMenu(menu);
|
||||
|
||||
menu = new QMenu();
|
||||
menu->addAction(ui.actionAdd_Friend);
|
||||
menu->addAction(ui.actionAdd_Group);
|
||||
menu->addAction(ui.actionCreate_new_Chat_lobby);
|
||||
|
@ -493,7 +494,7 @@ void FriendsDialog::sendMsg()
|
|||
// QTextEdit::clear() does not reset the CharFormat if document contains hyperlinks that have been accessed.
|
||||
ui.lineEdit->setCurrentCharFormat(QTextCharFormat ());
|
||||
|
||||
setFont();
|
||||
setColorAndFont();
|
||||
|
||||
/* redraw send list */
|
||||
insertSendList();
|
||||
|
@ -590,56 +591,60 @@ void FriendsDialog::insertSendList()
|
|||
|
||||
//============================================================================
|
||||
|
||||
void FriendsDialog::setColor()
|
||||
void FriendsDialog::chooseColor()
|
||||
{
|
||||
bool ok;
|
||||
QRgb color = QColorDialog::getRgba(ui.lineEdit->textColor().rgba(), &ok, this);
|
||||
if (ok) {
|
||||
mCurrentColor = QColor(color);
|
||||
colorChanged(mCurrentColor);
|
||||
colorChanged();
|
||||
setColorAndFont();
|
||||
}
|
||||
setFont();
|
||||
}
|
||||
|
||||
void FriendsDialog::colorChanged(const QColor &c)
|
||||
void FriendsDialog::colorChanged()
|
||||
{
|
||||
QPixmap pxm(16,16);
|
||||
pxm.fill(c);
|
||||
pxm.fill(mCurrentColor);
|
||||
ui.colorChatButton->setIcon(pxm);
|
||||
}
|
||||
|
||||
void FriendsDialog::getFont()
|
||||
void FriendsDialog::chooseFont()
|
||||
{
|
||||
bool ok;
|
||||
mCurrentFont = QFontDialog::getFont(&ok, mCurrentFont, this);
|
||||
QFont font = QFontDialog::getFont(&ok, mCurrentFont, this);
|
||||
if (ok) {
|
||||
fontChanged(mCurrentFont);
|
||||
mCurrentFont = font;
|
||||
fontChanged();
|
||||
setFont();
|
||||
}
|
||||
}
|
||||
|
||||
void FriendsDialog::fontChanged(const QFont &font)
|
||||
void FriendsDialog::fontChanged()
|
||||
{
|
||||
mCurrentFont = font;
|
||||
|
||||
ui.textboldChatButton->setChecked(mCurrentFont.bold());
|
||||
ui.textunderlineChatButton->setChecked(mCurrentFont.underline());
|
||||
ui.textitalicChatButton->setChecked(mCurrentFont.italic());
|
||||
|
||||
setFont();
|
||||
}
|
||||
|
||||
void FriendsDialog::setFont()
|
||||
void FriendsDialog::setColorAndFont()
|
||||
{
|
||||
mCurrentFont.setBold(ui.textboldChatButton->isChecked());
|
||||
mCurrentFont.setUnderline(ui.textunderlineChatButton->isChecked());
|
||||
mCurrentFont.setItalic(ui.textitalicChatButton->isChecked());
|
||||
|
||||
ui.lineEdit->setFont(mCurrentFont);
|
||||
ui.lineEdit->setTextColor(mCurrentColor);
|
||||
Settings->setChatScreenFont(mCurrentFont.toString());
|
||||
|
||||
ui.lineEdit->setFocus();
|
||||
}
|
||||
|
||||
void FriendsDialog::setFont()
|
||||
{
|
||||
setColorAndFont();
|
||||
Settings->setChatScreenFont(mCurrentFont.toString());
|
||||
}
|
||||
|
||||
// Update Chat Info information
|
||||
void FriendsDialog::setChatInfo(QString info, QColor color)
|
||||
{
|
||||
|
|
|
@ -86,14 +86,14 @@ private slots:
|
|||
|
||||
void addFriend();
|
||||
|
||||
void setColor();
|
||||
void chooseColor();
|
||||
void insertSendList();
|
||||
void sendMsg();
|
||||
|
||||
void statusmessage();
|
||||
|
||||
void setFont();
|
||||
void getFont();
|
||||
void chooseFont();
|
||||
|
||||
void getAvatar();
|
||||
|
||||
|
@ -122,8 +122,9 @@ private:
|
|||
void processSettings(bool bLoad);
|
||||
void addChatMsg(bool incoming, bool history, const QString &name, const QDateTime &sendTime, const QDateTime &recvTime, const QString &message);
|
||||
|
||||
void colorChanged(const QColor &c);
|
||||
void fontChanged(const QFont &font);
|
||||
void colorChanged();
|
||||
void fontChanged();
|
||||
void setColorAndFont();
|
||||
|
||||
QString fileName;
|
||||
|
||||
|
|
|
@ -864,9 +864,6 @@ border: 1px solid #CCCCCC;}</string>
|
|||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="images.qrc">
|
||||
<normaloff>:/images/emoticons/kopete/kopete020.png</normaloff>:/images/emoticons/kopete/kopete020.png</iconset>
|
||||
|
@ -908,9 +905,6 @@ border: 1px solid #CCCCCC;}</string>
|
|||
<property name="toolTip">
|
||||
<string>Bold</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="images.qrc">
|
||||
<normaloff>:/images/edit-bold.png</normaloff>:/images/edit-bold.png</iconset>
|
||||
|
@ -990,9 +984,6 @@ border: 1px solid #CCCCCC;}</string>
|
|||
<property name="toolTip">
|
||||
<string>Italic</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="images.qrc">
|
||||
<normaloff>:/images/edit-italic.png</normaloff>:/images/edit-italic.png</iconset>
|
||||
|
@ -1031,9 +1022,6 @@ border: 1px solid #CCCCCC;}</string>
|
|||
<property name="toolTip">
|
||||
<string>Font</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="images.qrc">
|
||||
<normaloff>:/images/fonts.png</normaloff>:/images/fonts.png</iconset>
|
||||
|
@ -1069,16 +1057,13 @@ border: 1px solid #CCCCCC;}</string>
|
|||
<property name="toolTip">
|
||||
<string>Text Color</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="menuButton">
|
||||
<widget class="QToolButton" name="menuButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
|
@ -1100,24 +1085,6 @@ border: 1px solid #CCCCCC;}</string>
|
|||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton::menu-indicator {
|
||||
subcontrol-origin: padding;
|
||||
subcontrol-position: bottom right;
|
||||
}
|
||||
|
||||
QPushButton::menu-indicator:pressed, QPushButton::menu-indicator:open {
|
||||
position: relative;
|
||||
top: 1px; left: 1px; /* shift the arrow by 2 px */
|
||||
}
|
||||
|
||||
QPushButton:hover {
|
||||
border: 1px solid #CCCCCC;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="images.qrc">
|
||||
<normaloff>:/images/configure.png</normaloff>:/images/configure.png</iconset>
|
||||
|
@ -1128,7 +1095,10 @@ border: 1px solid #CCCCCC;}</string>
|
|||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<property name="popupMode">
|
||||
<enum>QToolButton::InstantPopup</enum>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
|
@ -1159,9 +1129,6 @@ border: 1px solid #CCCCCC;}</string>
|
|||
<property name="toolTip">
|
||||
<string>Attach File</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="images.qrc">
|
||||
<normaloff>:/images/add-share24.png</normaloff>:/images/add-share24.png</iconset>
|
||||
|
@ -1445,6 +1412,16 @@ background: white;}</string>
|
|||
<string>Friend Recommendations</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionChooseFont">
|
||||
<property name="text">
|
||||
<string>Choose Font</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionResetFont">
|
||||
<property name="text">
|
||||
<string>Reset font to default</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
|
|
@ -71,13 +71,14 @@ ChatWidget::ChatWidget(QWidget *parent) :
|
|||
connect(ui->textunderlineButton, SIGNAL(clicked()), this, SLOT(setFont()));
|
||||
connect(ui->textitalicButton, SIGNAL(clicked()), this, SLOT(setFont()));
|
||||
connect(ui->attachPictureButton, SIGNAL(clicked()), this, SLOT(addExtraPicture()));
|
||||
connect(ui->fontButton, SIGNAL(clicked()), this, SLOT(getFont()));
|
||||
connect(ui->colorButton, SIGNAL(clicked()), this, SLOT(setColor()));
|
||||
connect(ui->colorButton, SIGNAL(clicked()), this, SLOT(chooseColor()));
|
||||
connect(ui->emoteiconButton, SIGNAL(clicked()), this, SLOT(smileyWidget()));
|
||||
connect(ui->actionSaveChatHistory, SIGNAL(triggered()), this, SLOT(fileSaveAs()));
|
||||
connect(ui->actionClearChatHistory, SIGNAL(triggered()), this, SLOT(clearChatHistory()));
|
||||
connect(ui->actionDeleteChatHistory, SIGNAL(triggered()), this, SLOT(deleteChatHistory()));
|
||||
connect(ui->actionMessageHistory, SIGNAL(triggered()), this, SLOT(messageHistory()));
|
||||
connect(ui->actionChooseFont, SIGNAL(triggered()), this, SLOT(chooseFont()));
|
||||
connect(ui->actionResetFont, SIGNAL(triggered()), this, SLOT(resetFont()));
|
||||
|
||||
connect(ui->hashBox, SIGNAL(fileHashingFinished(QList<HashedFile>)), this, SLOT(fileHashingFinished(QList<HashedFile>)));
|
||||
|
||||
|
@ -89,27 +90,22 @@ ChatWidget::ChatWidget(QWidget *parent) :
|
|||
ui->infoframe->setVisible(false);
|
||||
ui->statusmessagelabel->hide();
|
||||
|
||||
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->fontButton->setIcon(QIcon(QString(":/images/fonts.png")));
|
||||
ui->emoteiconButton->setIcon(QIcon(QString(":/images/emoticons/kopete/kopete020.png")));
|
||||
|
||||
ui->textboldButton->setCheckable(true);
|
||||
ui->textunderlineButton->setCheckable(true);
|
||||
ui->textitalicButton->setCheckable(true);
|
||||
|
||||
setAcceptDrops(true);
|
||||
ui->chattextEdit->setAcceptDrops(false);
|
||||
ui->hashBox->setDropWidget(this);
|
||||
ui->hashBox->setAutoHide(true);
|
||||
|
||||
QMenu *toolmenu = new QMenu();
|
||||
toolmenu->addAction(ui->actionClearChatHistory);
|
||||
toolmenu->addAction(ui->actionDeleteChatHistory);
|
||||
toolmenu->addAction(ui->actionSaveChatHistory);
|
||||
toolmenu->addAction(ui->actionMessageHistory);
|
||||
ui->pushtoolsButton->setMenu(toolmenu);
|
||||
QMenu *menu = new QMenu();
|
||||
menu->addAction(ui->actionChooseFont);
|
||||
menu->addAction(ui->actionResetFont);
|
||||
ui->fontButton->setMenu(menu);
|
||||
|
||||
menu = new QMenu();
|
||||
menu->addAction(ui->actionClearChatHistory);
|
||||
menu->addAction(ui->actionDeleteChatHistory);
|
||||
menu->addAction(ui->actionSaveChatHistory);
|
||||
menu->addAction(ui->actionMessageHistory);
|
||||
ui->pushtoolsButton->setMenu(menu);
|
||||
|
||||
ui->chattextEdit->installEventFilter(this);
|
||||
|
||||
|
@ -148,8 +144,9 @@ void ChatWidget::init(const std::string &peerId, const QString &title)
|
|||
currentColor.setNamedColor(PeerSettings->getPrivateChatColor(peerId));
|
||||
currentFont.fromString(PeerSettings->getPrivateChatFont(peerId));
|
||||
|
||||
colorChanged(currentColor);
|
||||
fontChanged(currentFont);
|
||||
colorChanged();
|
||||
fontChanged();
|
||||
setColorAndFont();
|
||||
|
||||
// load style
|
||||
PeerSettings->getStyle(peerId, "ChatWidget", style);
|
||||
|
@ -407,7 +404,7 @@ void ChatWidget::sendChat()
|
|||
// QTextEdit::clear() does not reset the CharFormat if document contains hyperlinks that have been accessed.
|
||||
chatWidget->setCurrentCharFormat(QTextCharFormat ());
|
||||
|
||||
setFont();
|
||||
setColorAndFont();
|
||||
}
|
||||
|
||||
void ChatWidget::on_closeInfoFrameButton_clicked()
|
||||
|
@ -415,46 +412,51 @@ void ChatWidget::on_closeInfoFrameButton_clicked()
|
|||
ui->infoframe->setVisible(false);
|
||||
}
|
||||
|
||||
void ChatWidget::setColor()
|
||||
void ChatWidget::chooseColor()
|
||||
{
|
||||
bool ok;
|
||||
QRgb color = QColorDialog::getRgba(ui->chattextEdit->textColor().rgba(), &ok, window());
|
||||
if (ok) {
|
||||
currentColor = QColor(color);
|
||||
PeerSettings->setPrivateChatColor(peerId, currentColor.name());
|
||||
colorChanged(currentColor);
|
||||
colorChanged();
|
||||
setColorAndFont();
|
||||
}
|
||||
setFont();
|
||||
}
|
||||
|
||||
void ChatWidget::colorChanged(const QColor &c)
|
||||
void ChatWidget::colorChanged()
|
||||
{
|
||||
QPixmap pix(16, 16);
|
||||
pix.fill(c);
|
||||
pix.fill(currentColor);
|
||||
ui->colorButton->setIcon(pix);
|
||||
}
|
||||
|
||||
void ChatWidget::getFont()
|
||||
void ChatWidget::chooseFont()
|
||||
{
|
||||
bool ok;
|
||||
QFont font = QFontDialog::getFont(&ok, currentFont, this);
|
||||
if (ok) {
|
||||
fontChanged(font);
|
||||
currentFont = font;
|
||||
fontChanged();
|
||||
setFont();
|
||||
}
|
||||
}
|
||||
|
||||
void ChatWidget::fontChanged(const QFont &font)
|
||||
void ChatWidget::resetFont()
|
||||
{
|
||||
currentFont = font;
|
||||
|
||||
ui->textboldButton->setChecked(currentFont.bold());
|
||||
ui->textunderlineButton->setChecked(currentFont.underline());
|
||||
ui->textitalicButton->setChecked(currentFont.italic());
|
||||
|
||||
currentFont.fromString(Settings->getChatScreenFont());
|
||||
fontChanged();
|
||||
setFont();
|
||||
}
|
||||
|
||||
void ChatWidget::setFont()
|
||||
void ChatWidget::fontChanged()
|
||||
{
|
||||
ui->textboldButton->setChecked(currentFont.bold());
|
||||
ui->textunderlineButton->setChecked(currentFont.underline());
|
||||
ui->textitalicButton->setChecked(currentFont.italic());
|
||||
}
|
||||
|
||||
void ChatWidget::setColorAndFont()
|
||||
{
|
||||
currentFont.setBold(ui->textboldButton->isChecked());
|
||||
currentFont.setUnderline(ui->textunderlineButton->isChecked());
|
||||
|
@ -464,7 +466,11 @@ void ChatWidget::setFont()
|
|||
ui->chattextEdit->setTextColor(currentColor);
|
||||
|
||||
ui->chattextEdit->setFocus();
|
||||
}
|
||||
|
||||
void ChatWidget::setFont()
|
||||
{
|
||||
setColorAndFont();
|
||||
PeerSettings->setPrivateChatFont(peerId, currentFont.toString());
|
||||
}
|
||||
|
||||
|
|
|
@ -101,8 +101,9 @@ private slots:
|
|||
void addExtraPicture();
|
||||
void on_closeInfoFrameButton_clicked();
|
||||
|
||||
void setColor();
|
||||
void getFont();
|
||||
void chooseColor();
|
||||
void chooseFont();
|
||||
void resetFont();
|
||||
void setFont();
|
||||
|
||||
void sendChat();
|
||||
|
@ -117,8 +118,9 @@ private:
|
|||
void updateStatusTyping();
|
||||
void setCurrentFileName(const QString &fileName);
|
||||
|
||||
void colorChanged(const QColor &c);
|
||||
void fontChanged(const QFont &font);
|
||||
void colorChanged();
|
||||
void fontChanged();
|
||||
void setColorAndFont();
|
||||
void processSettings(bool load);
|
||||
|
||||
std::string peerId;
|
||||
|
|
|
@ -288,6 +288,10 @@ background: white;}</string>
|
|||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/emoticons/kopete/kopete020.png</normaloff>:/images/emoticons/kopete/kopete020.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
|
@ -319,8 +323,12 @@ background: white;}</string>
|
|||
<property name="toolTip">
|
||||
<string>Bold</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/edit-bold.png</normaloff>:/images/edit-bold.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
|
@ -347,8 +355,12 @@ background: white;}</string>
|
|||
<property name="toolTip">
|
||||
<string>Underline</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/edit-underline.png</normaloff>:/images/edit-underline.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
|
@ -375,8 +387,12 @@ background: white;}</string>
|
|||
<property name="toolTip">
|
||||
<string>Italic</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/edit-italic.png</normaloff>:/images/edit-italic.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
|
@ -387,13 +403,13 @@ background: white;}</string>
|
|||
<widget class="QToolButton" name="fontButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<width>32</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<width>32</width>
|
||||
<height>28</height>
|
||||
</size>
|
||||
</property>
|
||||
|
@ -403,8 +419,12 @@ background: white;}</string>
|
|||
<property name="toolTip">
|
||||
<string>Font</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/fonts.png</normaloff>:/images/fonts.png</iconset>
|
||||
</property>
|
||||
<property name="popupMode">
|
||||
<enum>QToolButton::InstantPopup</enum>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
|
@ -456,9 +476,6 @@ background: white;}</string>
|
|||
<property name="toolTip">
|
||||
<string>Attach a Picture</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/add_image24.png</normaloff>:/images/add_image24.png</iconset>
|
||||
|
@ -488,9 +505,6 @@ background: white;}</string>
|
|||
<property name="toolTip">
|
||||
<string>Add a File for your Friend</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/add-share24.png</normaloff>:/images/add-share24.png</iconset>
|
||||
|
@ -507,7 +521,7 @@ background: white;}</string>
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushtoolsButton">
|
||||
<widget class="QToolButton" name="pushtoolsButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
|
@ -523,24 +537,6 @@ background: white;}</string>
|
|||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton::menu-indicator {
|
||||
subcontrol-origin: padding;
|
||||
subcontrol-position: bottom right;
|
||||
}
|
||||
|
||||
QPushButton::menu-indicator:pressed, QPushButton::menu-indicator:open {
|
||||
position: relative;
|
||||
top: 1px; left: 1px; /* shift the arrow by 2 px */
|
||||
}
|
||||
|
||||
QPushButton:hover {
|
||||
border: 1px solid #CCCCCC;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/configure.png</normaloff>:/images/configure.png</iconset>
|
||||
|
@ -551,7 +547,10 @@ border: 1px solid #CCCCCC;
|
|||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<property name="popupMode">
|
||||
<enum>QToolButton::InstantPopup</enum>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
|
@ -651,6 +650,16 @@ border: 1px solid #CCCCCC;
|
|||
<string>Deletes all stored and displayed chat history</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionChooseFont">
|
||||
<property name="text">
|
||||
<string>Choose font</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionResetFont">
|
||||
<property name="text">
|
||||
<string>Reset font to default</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include <retroshare/rsmsgs.h>
|
||||
|
||||
#include "RsharePeerSettings.h"
|
||||
#include "rsharesettings.h"
|
||||
#include "gui/style/RSStyle.h"
|
||||
|
||||
/** The file in which all settings of he peers will read and written. */
|
||||
|
@ -144,7 +145,11 @@ void RsharePeerSettings::set(const std::string &peerId, const QString &key, cons
|
|||
}
|
||||
|
||||
beginGroup(QString::fromStdString(settingsId));
|
||||
setValue(key, value);
|
||||
if (value.isNull()) {
|
||||
remove(key);
|
||||
} else {
|
||||
setValue(key, value);
|
||||
}
|
||||
endGroup();
|
||||
}
|
||||
|
||||
|
@ -160,12 +165,16 @@ void RsharePeerSettings::setPrivateChatColor(const std::string &peerId, const QS
|
|||
|
||||
QString RsharePeerSettings::getPrivateChatFont(const std::string &peerId)
|
||||
{
|
||||
return get(peerId, "PrivateChatFont", QFont("Comic Sans MS", 10).toString()).toString();
|
||||
return get(peerId, "PrivateChatFont", Settings->getChatScreenFont()).toString();
|
||||
}
|
||||
|
||||
void RsharePeerSettings::setPrivateChatFont(const std::string &peerId, const QString &value)
|
||||
{
|
||||
set(peerId, "PrivateChatFont", value);
|
||||
if (Settings->getChatScreenFont() == value) {
|
||||
set(peerId, "PrivateChatFont", QVariant());
|
||||
} else {
|
||||
set(peerId, "PrivateChatFont", value);
|
||||
}
|
||||
}
|
||||
|
||||
bool RsharePeerSettings::getPrivateChatOnTop(const std::string &peerId)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue