mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-23 05:41:24 -05:00
Merge pull request #1938 from defnax/forum-fonts-settings
Added forum settings for Font size & contrast
This commit is contained in:
commit
4f25ab3fe8
@ -1165,16 +1165,14 @@ void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg)
|
||||
flags |= RSHTML_OPTIMIZEHTML_MASK;
|
||||
|
||||
QColor backgroundColor = ui->postText->palette().base().color();
|
||||
qreal desiredContrast = Settings->valueFromGroup("Chat",
|
||||
qreal desiredContrast = Settings->valueFromGroup("Forum",
|
||||
"MinimumContrast", 4.5).toDouble();
|
||||
int desiredMinimumFontSize = Settings->valueFromGroup("Chat",
|
||||
int desiredMinimumFontSize = Settings->valueFromGroup("Forum",
|
||||
"MinimumFontSize", 10).toInt();
|
||||
|
||||
QString extraTxt = RsHtml().formatText(ui->postText->document(),
|
||||
QString::fromUtf8(msg.mMsg.c_str()), flags
|
||||
#ifndef DEBUG_FORUMS \
|
||||
, backgroundColor, desiredContrast, desiredMinimumFontSize
|
||||
#endif
|
||||
);
|
||||
ui->postText->setHtml(extraTxt);
|
||||
}
|
||||
|
@ -506,6 +506,11 @@
|
||||
<verstretch>10</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>MS Sans Serif</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
|
@ -35,6 +35,8 @@ ForumPage::ForumPage(QWidget * parent, Qt::WindowFlags flags)
|
||||
connect(ui.expandNewMessages , SIGNAL(toggled(bool)), this, SLOT( updateExpandNewMessages()));
|
||||
connect(ui.loadEmbeddedImages , SIGNAL(toggled(bool)), this, SLOT(updateLoadEmbeddedImages() ));
|
||||
connect(ui.loadEmoticons , SIGNAL(toggled(bool)), this, SLOT( updateLoadEmoticons() ));
|
||||
connect(ui.minimumFontSize , SIGNAL(valueChanged(int)), this, SLOT(updateFonts()));
|
||||
connect(ui.minimumContrast , SIGNAL(valueChanged(int)), this, SLOT(updateFonts()));
|
||||
|
||||
ui.groupFrameSettingsWidget->setType(GroupFrameSettings::Forum) ;
|
||||
}
|
||||
@ -51,10 +53,22 @@ void ForumPage::updateLoadEmoticons() { Settings->setForumLoadEmoticons(
|
||||
/** Loads the settings for this page */
|
||||
void ForumPage::load()
|
||||
{
|
||||
Settings->beginGroup(QString("Forum"));
|
||||
whileBlocking(ui.setMsgToReadOnActivate)->setChecked(Settings->getForumMsgSetToReadOnActivate());
|
||||
whileBlocking(ui.expandNewMessages)->setChecked(Settings->getForumExpandNewMessages());
|
||||
whileBlocking(ui.loadEmbeddedImages)->setChecked(Settings->getForumLoadEmbeddedImages());
|
||||
whileBlocking(ui.loadEmoticons)->setChecked(Settings->getForumLoadEmoticons());
|
||||
whileBlocking(ui.minimumFontSize)->setValue(Settings->value("MinimumFontSize", 10).toInt());
|
||||
whileBlocking(ui.minimumContrast)->setValue(Settings->value("MinimumContrast", 4.5).toDouble());
|
||||
Settings->endGroup();
|
||||
|
||||
ui.groupFrameSettingsWidget->loadSettings(GroupFrameSettings::Forum);
|
||||
}
|
||||
|
||||
void ForumPage::updateFonts()
|
||||
{
|
||||
Settings->beginGroup(QString("Forum"));
|
||||
Settings->setValue("MinimumFontSize", ui.minimumFontSize->value());
|
||||
Settings->setValue("MinimumContrast", ui.minimumContrast->value());
|
||||
Settings->endGroup();
|
||||
}
|
||||
|
@ -45,6 +45,9 @@ protected slots:
|
||||
void updateLoadEmbeddedImages();
|
||||
void updateLoadEmoticons();
|
||||
|
||||
private slots:
|
||||
void updateFonts();
|
||||
|
||||
private:
|
||||
Ui::ForumPage ui;
|
||||
};
|
||||
|
@ -17,6 +17,16 @@
|
||||
<string>Misc</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="loadEmoticons">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>This option is costly and it's in the dev's plans to improve it. In the mean time it's disabled by default. If you enable it and long forum posts take a while to display, then disable it again. </p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Load emoticons (costly)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="setMsgToReadOnActivate">
|
||||
<property name="text">
|
||||
@ -38,15 +48,71 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="loadEmoticons">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>This option is costly and it's in the dev's plans to improve it. In the mean time it's disabled by default. If you enable it and long forum posts take a while to display, then disable it again. </p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Load emoticons (costly)</string>
|
||||
</property>
|
||||
</widget>
|
||||
<item row="4" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="minimumFontSizeLabel">
|
||||
<property name="text">
|
||||
<string>Minimum font size</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="minimumFontSize">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>64</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2" rowspan="2">
|
||||
<spacer name="minimumFontSizeHSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>38</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="minimumContrastLabel">
|
||||
<property name="text">
|
||||
<string>Minimum text contrast</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QDoubleSpinBox" name="minimumContrast">
|
||||
<property name="minimum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>21.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.500000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QGroupBox" name="tabsGroupBox">
|
||||
<property name="title">
|
||||
<string>Tabs</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="GroupFrameSettingsWidget" name="groupFrameSettingsWidget" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
@ -64,18 +130,6 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QGroupBox" name="tabsGroupBox">
|
||||
<property name="title">
|
||||
<string>Tabs</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="GroupFrameSettingsWidget" name="groupFrameSettingsWidget" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
|
Loading…
Reference in New Issue
Block a user