mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-22 14:10:54 -04:00
Added for Composer fonts settings
This commit is contained in:
parent
b168110a58
commit
3ffa362079
5 changed files with 82 additions and 9 deletions
|
@ -2933,3 +2933,26 @@ void MessageComposer::checkLength()
|
||||||
ui.actionSend->setEnabled(true);
|
ui.actionSend->setEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MessageComposer::showEvent(QShowEvent *event)
|
||||||
|
{
|
||||||
|
if (!event->spontaneous()) {
|
||||||
|
updateFontSize();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MessageComposer::updateFontSize()
|
||||||
|
{
|
||||||
|
#if defined(Q_OS_DARWIN)
|
||||||
|
int customFontSize = Settings->valueFromGroup("Messages", "MinimumFontSize", 13).toInt();
|
||||||
|
#else
|
||||||
|
int customFontSize = Settings->valueFromGroup("Messages", "MinimumFontSize", 12).toInt();
|
||||||
|
#endif
|
||||||
|
QFont newFont = ui.msgText->font();
|
||||||
|
if (newFont.pointSize() != customFontSize) {
|
||||||
|
newFont.setPointSize(customFontSize);
|
||||||
|
QFontMetricsF fontMetrics(newFont);
|
||||||
|
ui.msgText->setFont(newFont);
|
||||||
|
ui.comboSize->setCurrentIndex(ui.comboSize->findText(QString::number(newFont.pointSize())));
|
||||||
|
}
|
||||||
|
}
|
|
@ -95,6 +95,7 @@ public slots:
|
||||||
protected:
|
protected:
|
||||||
void closeEvent (QCloseEvent * event);
|
void closeEvent (QCloseEvent * event);
|
||||||
bool eventFilter(QObject *obj, QEvent *ev);
|
bool eventFilter(QObject *obj, QEvent *ev);
|
||||||
|
virtual void showEvent(QShowEvent *) ;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
/* toggle Contacts DockWidget */
|
/* toggle Contacts DockWidget */
|
||||||
|
@ -169,6 +170,7 @@ private slots:
|
||||||
static QString inviteMessage();
|
static QString inviteMessage();
|
||||||
|
|
||||||
void checkLength();
|
void checkLength();
|
||||||
|
void updateFontSize();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static QString buildReplyHeader(const MessageInfo &msgInfo);
|
static QString buildReplyHeader(const MessageInfo &msgInfo);
|
||||||
|
|
|
@ -55,6 +55,7 @@ MessagePage::MessagePage(QWidget * parent, Qt::WindowFlags flags)
|
||||||
connect(ui.loadEmbeddedImages, SIGNAL(toggled(bool)), this,SLOT(updateLoadEmbededImages() ));
|
connect(ui.loadEmbeddedImages, SIGNAL(toggled(bool)), this,SLOT(updateLoadEmbededImages() ));
|
||||||
connect(ui.openComboBox, SIGNAL(currentIndexChanged(int)),this,SLOT(updateMsgOpen() ));
|
connect(ui.openComboBox, SIGNAL(currentIndexChanged(int)),this,SLOT(updateMsgOpen() ));
|
||||||
connect(ui.emoticonscheckBox, SIGNAL(toggled(bool)), this,SLOT(updateLoadEmoticons() ));
|
connect(ui.emoticonscheckBox, SIGNAL(toggled(bool)), this,SLOT(updateLoadEmoticons() ));
|
||||||
|
connect(ui.minimumFontSize_SB, SIGNAL(valueChanged(int)), this, SLOT(updateFontSize())) ;
|
||||||
|
|
||||||
mTagEventHandlerId = 0;
|
mTagEventHandlerId = 0;
|
||||||
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> event) { RsQThreadUtils::postToObject( [this,event]() { handleEvent_main_thread(event); }); }, mTagEventHandlerId, RsEventType::MAIL_TAG );
|
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> event) { RsQThreadUtils::postToObject( [this,event]() { handleEvent_main_thread(event); }); }, mTagEventHandlerId, RsEventType::MAIL_TAG );
|
||||||
|
@ -121,6 +122,11 @@ MessagePage::load()
|
||||||
whileBlocking(ui.loadEmbeddedImages)->setChecked(Settings->getMsgLoadEmbeddedImages());
|
whileBlocking(ui.loadEmbeddedImages)->setChecked(Settings->getMsgLoadEmbeddedImages());
|
||||||
whileBlocking(ui.openComboBox)->setCurrentIndex(ui.openComboBox->findData(Settings->getMsgOpen()));
|
whileBlocking(ui.openComboBox)->setCurrentIndex(ui.openComboBox->findData(Settings->getMsgOpen()));
|
||||||
whileBlocking(ui.emoticonscheckBox)->setChecked(Settings->value("Emoticons", true).toBool());
|
whileBlocking(ui.emoticonscheckBox)->setChecked(Settings->value("Emoticons", true).toBool());
|
||||||
|
#if defined(Q_OS_DARWIN)
|
||||||
|
whileBlocking(ui.minimumFontSize_SB)->setValue( Settings->value("MinimumFontSize", 13 ).toInt());
|
||||||
|
#else
|
||||||
|
whileBlocking(ui.minimumFontSize_SB)->setValue( Settings->value("MinimumFontSize", 12 ).toInt());
|
||||||
|
#endif
|
||||||
Settings->endGroup();
|
Settings->endGroup();
|
||||||
|
|
||||||
// state of filter combobox
|
// state of filter combobox
|
||||||
|
@ -298,3 +304,10 @@ void MessagePage::currentRowChangedTag(int row)
|
||||||
ui.deletepushButton->setEnabled(bDeleteEnable);
|
ui.deletepushButton->setEnabled(bDeleteEnable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MessagePage::updateFontSize()
|
||||||
|
{
|
||||||
|
Settings->beginGroup(QString("Messages"));
|
||||||
|
Settings->setValue("MinimumFontSize", ui.minimumFontSize_SB->value());
|
||||||
|
Settings->endGroup();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,7 @@ private slots:
|
||||||
void updateDistantMsgs() ;
|
void updateDistantMsgs() ;
|
||||||
void updateMsgTags() ;
|
void updateMsgTags() ;
|
||||||
void updateLoadEmoticons();
|
void updateLoadEmoticons();
|
||||||
|
void updateFontSize();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void handleEvent_main_thread(std::shared_ptr<const RsEvent> event);
|
void handleEvent_main_thread(std::shared_ptr<const RsEvent> event);
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QGridLayout" name="gridLayout_4">
|
||||||
<item>
|
<item row="0" column="0">
|
||||||
<widget class="QGroupBox" name="groupBox_3">
|
<widget class="QGroupBox" name="groupBox_3">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Distant messages:</string>
|
<string>Distant messages:</string>
|
||||||
|
@ -52,7 +52,7 @@
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="1" column="0">
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Reading</string>
|
<string>Reading</string>
|
||||||
|
@ -65,17 +65,37 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="0" column="1">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="minimumFontSizeHLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="openLabel">
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="minimumFontSizeLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Open messages in</string>
|
<string>Minimum font size </string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="RSComboBox" name="openComboBox"/>
|
<widget class="QSpinBox" name="minimumFontSize_SB">
|
||||||
|
<property name="minimum">
|
||||||
|
<number>10</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>64</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
@ -93,10 +113,24 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
<item row="3" column="0" colspan="2">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="openLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Open messages in</string>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
<widget class="RSComboBox" name="openComboBox"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
<widget class="QGroupBox" name="groupBox_2">
|
<widget class="QGroupBox" name="groupBox_2">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Tags</string>
|
<string>Tags</string>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue