mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-21 21:59:02 -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 <QMenu>
|
||||
#include <QToolButton>
|
||||
#include <QShowEvent>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
@ -67,6 +68,8 @@ GroupTreeWidget::GroupTreeWidget(QWidget *parent) :
|
|||
connect(ui->treeWidget, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(itemActivated(QTreeWidgetItem*,int)));
|
||||
}
|
||||
|
||||
updateFontSize();
|
||||
|
||||
int H = QFontMetricsF(ui->treeWidget->font()).height() ;
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5,11,0)
|
||||
int W = QFontMetricsF(ui->treeWidget->font()).width("_") ;
|
||||
|
@ -667,3 +670,26 @@ void GroupTreeWidget::sort()
|
|||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue