mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-22 06:09:09 -04:00
Added for channel composer default size settings
This commit is contained in:
parent
3ffa362079
commit
6d394c9f55
7 changed files with 149 additions and 91 deletions
|
@ -34,6 +34,7 @@
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
|
#include <QShowEvent>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
@ -67,6 +68,8 @@ GroupTreeWidget::GroupTreeWidget(QWidget *parent) :
|
||||||
connect(ui->treeWidget, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(itemActivated(QTreeWidgetItem*,int)));
|
connect(ui->treeWidget, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(itemActivated(QTreeWidgetItem*,int)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateFontSize();
|
||||||
|
|
||||||
int H = QFontMetricsF(ui->treeWidget->font()).height() ;
|
int H = QFontMetricsF(ui->treeWidget->font()).height() ;
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5,11,0)
|
#if QT_VERSION < QT_VERSION_CHECK(5,11,0)
|
||||||
int W = QFontMetricsF(ui->treeWidget->font()).width("_") ;
|
int W = QFontMetricsF(ui->treeWidget->font()).width("_") ;
|
||||||
|
@ -667,3 +670,26 @@ void GroupTreeWidget::sort()
|
||||||
{
|
{
|
||||||
ui->treeWidget->resort();
|
ui->treeWidget->resort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GroupTreeWidget::showEvent(QShowEvent *event)
|
||||||
|
{
|
||||||
|
if (!event->spontaneous()) {
|
||||||
|
updateFontSize();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupTreeWidget::updateFontSize()
|
||||||
|
{
|
||||||
|
#if defined(Q_OS_DARWIN)
|
||||||
|
int customFontSize = Settings->valueFromGroup("File", "MinimumFontSize", 13).toInt();
|
||||||
|
#else
|
||||||
|
int customFontSize = Settings->valueFromGroup("File", "MinimumFontSize", 11).toInt();
|
||||||
|
#endif
|
||||||
|
QFont newFont = ui->treeWidget->font();
|
||||||
|
if (newFont.pointSize() != customFontSize) {
|
||||||
|
newFont.setPointSize(customFontSize);
|
||||||
|
QFontMetricsF fontMetrics(newFont);
|
||||||
|
ui->treeWidget->setFont(newFont);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ class QToolButton;
|
||||||
class RshareSettings;
|
class RshareSettings;
|
||||||
class RSTreeWidgetItemCompareRole;
|
class RSTreeWidgetItemCompareRole;
|
||||||
class RSTreeWidget;
|
class RSTreeWidget;
|
||||||
|
class QShowEvent;
|
||||||
|
|
||||||
#define GROUPTREEWIDGET_COLOR_STANDARD -1
|
#define GROUPTREEWIDGET_COLOR_STANDARD -1
|
||||||
#define GROUPTREEWIDGET_COLOR_CATEGORY 0
|
#define GROUPTREEWIDGET_COLOR_CATEGORY 0
|
||||||
|
@ -142,6 +143,7 @@ signals:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void changeEvent(QEvent *e);
|
void changeEvent(QEvent *e);
|
||||||
|
virtual void showEvent(QShowEvent *) override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void customContextMenuRequested(const QPoint &pos);
|
void customContextMenuRequested(const QPoint &pos);
|
||||||
|
@ -151,6 +153,7 @@ private slots:
|
||||||
void distantSearch();
|
void distantSearch();
|
||||||
|
|
||||||
void sort();
|
void sort();
|
||||||
|
void updateFontSize();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void calculateScore(QTreeWidgetItem *item, const QString &filterText);
|
void calculateScore(QTreeWidgetItem *item, const QString &filterText);
|
||||||
|
|
|
@ -193,9 +193,6 @@ void GxsGroupFrameDialog::showEvent(QShowEvent* /*event*/)
|
||||||
bool empty = mCachedGroupMetas.empty() || children==0;
|
bool empty = mCachedGroupMetas.empty() || children==0;
|
||||||
|
|
||||||
updateDisplay( empty );
|
updateDisplay( empty );
|
||||||
|
|
||||||
updateFontSize();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GxsGroupFrameDialog::paintEvent(QPaintEvent *pe)
|
void GxsGroupFrameDialog::paintEvent(QPaintEvent *pe)
|
||||||
|
@ -1277,19 +1274,3 @@ void GxsGroupFrameDialog::distantRequestGroupData()
|
||||||
checkRequestGroup(group_id) ;
|
checkRequestGroup(group_id) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GxsGroupFrameDialog::updateFontSize()
|
|
||||||
{
|
|
||||||
#if defined(Q_OS_DARWIN)
|
|
||||||
int customFontSize = Settings->valueFromGroup("File", "MinimumFontSize", 13).toInt();
|
|
||||||
#else
|
|
||||||
int customFontSize = Settings->valueFromGroup("File", "MinimumFontSize", 11).toInt();
|
|
||||||
#endif
|
|
||||||
QFont newFont = ui->groupTreeWidget->font();
|
|
||||||
if (newFont.pointSize() != customFontSize) {
|
|
||||||
newFont.setPointSize(customFontSize);
|
|
||||||
QFontMetricsF fontMetrics(newFont);
|
|
||||||
ui->groupTreeWidget->setFont(newFont);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,6 @@ protected:
|
||||||
|
|
||||||
void updateGroupStatisticsReal(const RsGxsGroupId &groupId);
|
void updateGroupStatisticsReal(const RsGxsGroupId &groupId);
|
||||||
void updateMessageSummaryListReal(RsGxsGroupId groupId);
|
void updateMessageSummaryListReal(RsGxsGroupId groupId);
|
||||||
void updateFontSize();
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void todo();
|
void todo();
|
||||||
|
|
|
@ -17,43 +17,14 @@
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_4">
|
<layout class="QGridLayout" name="gridLayout_4">
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QGroupBox" name="groupBox_3">
|
|
||||||
<property name="title">
|
|
||||||
<string>Distant messages:</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout_3">
|
|
||||||
<item row="0" column="2">
|
|
||||||
<widget class="RSComboBox" name="comboBox">
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Everyone</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Contacts</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Nobody</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QLabel" name="label_2">
|
|
||||||
<property name="text">
|
|
||||||
<string>Accept encrypted distant messages from</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Reading</string>
|
<string>Reading</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -65,40 +36,6 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
|
||||||
<layout class="QHBoxLayout" name="minimumFontSizeHLayout">
|
|
||||||
<item>
|
|
||||||
<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">
|
|
||||||
<string>Minimum font size </string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QSpinBox" name="minimumFontSize_SB">
|
|
||||||
<property name="minimum">
|
|
||||||
<number>10</number>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>64</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QCheckBox" name="loadEmbeddedImages">
|
<widget class="QCheckBox" name="loadEmbeddedImages">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -130,7 +67,7 @@
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="3" column="0" colspan="2">
|
||||||
<widget class="QGroupBox" name="groupBox_2">
|
<widget class="QGroupBox" name="groupBox_2">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Tags</string>
|
<string>Tags</string>
|
||||||
|
@ -206,6 +143,93 @@
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="0" colspan="2">
|
||||||
|
<widget class="QGroupBox" name="groupBox_3">
|
||||||
|
<property name="title">
|
||||||
|
<string>Distant messages:</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
|
<item row="0" column="2">
|
||||||
|
<widget class="RSComboBox" name="comboBox">
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Everyone</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Contacts</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Nobody</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>Accept encrypted distant messages from</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QGroupBox" name="groupBox_4">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>Fonts</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="minimumFontSizeHLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="minimumFontSizeLabel">
|
||||||
|
<property name="layoutDirection">
|
||||||
|
<enum>Qt::LeftToRight</enum>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Minimum font size </string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="minimumFontSize_SB">
|
||||||
|
<property name="minimum">
|
||||||
|
<number>10</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>64</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<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>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
|
|
|
@ -614,3 +614,26 @@ void RichTextEdit::checkLength(){
|
||||||
void RichTextEdit::setPlaceHolderTextPosted() {
|
void RichTextEdit::setPlaceHolderTextPosted() {
|
||||||
f_textedit->setPlaceholderText(tr("Text (optional)"));
|
f_textedit->setPlaceholderText(tr("Text (optional)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RichTextEdit::showEvent(QShowEvent *event)
|
||||||
|
{
|
||||||
|
if (!event->spontaneous()) {
|
||||||
|
updateFontSize();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void RichTextEdit::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 = f_textedit->font();
|
||||||
|
if (newFont.pointSize() != customFontSize) {
|
||||||
|
newFont.setPointSize(customFontSize);
|
||||||
|
QFontMetricsF fontMetrics(newFont);
|
||||||
|
f_textedit->setFont(newFont);
|
||||||
|
f_fontsize->setCurrentIndex(f_fontsize->findText(QString::number(newFont.pointSize())));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -69,6 +69,7 @@ signals:
|
||||||
void insertImage();
|
void insertImage();
|
||||||
void textSource();
|
void textSource();
|
||||||
void checkLength();
|
void checkLength();
|
||||||
|
void updateFontSize();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void mergeFormatOnWordOrSelection(const QTextCharFormat &format);
|
void mergeFormatOnWordOrSelection(const QTextCharFormat &format);
|
||||||
|
@ -78,6 +79,7 @@ signals:
|
||||||
void list(bool checked, QTextListFormat::Style style);
|
void list(bool checked, QTextListFormat::Style style);
|
||||||
void indent(int delta);
|
void indent(int delta);
|
||||||
void focusInEvent(QFocusEvent *event);
|
void focusInEvent(QFocusEvent *event);
|
||||||
|
virtual void showEvent(QShowEvent *);
|
||||||
|
|
||||||
QStringList m_paragraphItems;
|
QStringList m_paragraphItems;
|
||||||
int m_fontsize_h1;
|
int m_fontsize_h1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue