mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-02 11:16:34 -04:00
Merge pull request #2619 from chelovechishko/chat_amusement
gui: chat: add auto shrink chattextedit
This commit is contained in:
commit
52dffddf64
16 changed files with 238 additions and 16 deletions
|
@ -241,10 +241,6 @@ SharedFilesDialog::SharedFilesDialog(bool remote_mode, QWidget *parent)
|
|||
/* Set Multi Selection */
|
||||
ui.dirTreeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||
|
||||
QFontMetricsF fontMetrics(ui.dirTreeView->font());
|
||||
int iconHeight = fontMetrics.height() * 1.5;
|
||||
ui.dirTreeView->setIconSize(QSize(iconHeight, iconHeight));
|
||||
|
||||
/* Hide platform specific features */
|
||||
copylinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Links to Clipboard" ), this );
|
||||
connect( copylinkAct , SIGNAL( triggered() ), this, SLOT( copyLink() ) );
|
||||
|
@ -323,7 +319,7 @@ void SharedFilesDialog::hideEvent(QHideEvent *)
|
|||
model->setVisible(false) ;
|
||||
}
|
||||
|
||||
void SharedFilesDialog::showEvent(QShowEvent *)
|
||||
void SharedFilesDialog::showEvent(QShowEvent *event)
|
||||
{
|
||||
if(model!=NULL)
|
||||
{
|
||||
|
@ -336,6 +332,10 @@ void SharedFilesDialog::showEvent(QShowEvent *)
|
|||
|
||||
restoreExpandedPathsAndSelection(expanded_indexes,hidden_indexes,selected_indexes);
|
||||
}
|
||||
|
||||
if (!event->spontaneous()) {
|
||||
updateFontSize();
|
||||
}
|
||||
}
|
||||
RemoteSharedFilesDialog::~RemoteSharedFilesDialog()
|
||||
{
|
||||
|
@ -1686,3 +1686,16 @@ bool SharedFilesDialog::tree_FilterItem(const QModelIndex &index, const QString
|
|||
return (visible || visibleChildCount);
|
||||
}
|
||||
#endif
|
||||
|
||||
void SharedFilesDialog::updateFontSize()
|
||||
{
|
||||
int customFontSize = Settings->valueFromGroup("File", "MinimumFontSize", 11).toInt();
|
||||
QFont newFont = ui.dirTreeView->font();
|
||||
if (newFont.pointSize() != customFontSize) {
|
||||
newFont.setPointSize(customFontSize);
|
||||
QFontMetricsF fontMetrics(newFont);
|
||||
int iconHeight = fontMetrics.height();
|
||||
ui.dirTreeView->setFont(newFont);
|
||||
ui.dirTreeView->setIconSize(QSize(iconHeight, iconHeight));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -117,6 +117,8 @@ protected:
|
|||
|
||||
QModelIndexList getSelected();
|
||||
|
||||
void updateFontSize();
|
||||
|
||||
/** Defines the actions for the context menu for QTreeWidget */
|
||||
QAction* copylinkAct;
|
||||
QAction* sendlinkAct;
|
||||
|
|
|
@ -356,11 +356,6 @@ border-image: url(:/images/closepressed.png)
|
|||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>11</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue