1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

SearchEnginesDialog: Set sensible size for columns

This commit is contained in:
David Rosca 2016-12-29 14:27:18 +01:00
parent a5002d9311
commit f225399739
3 changed files with 23 additions and 1 deletions

View File

@ -229,6 +229,24 @@ void SearchEnginesDialog::reloadEngines()
}
}
void SearchEnginesDialog::showEvent(QShowEvent *e)
{
QDialog::showEvent(e);
resizeViewHeader();
}
void SearchEnginesDialog::resizeEvent(QResizeEvent *e)
{
QDialog::resizeEvent(e);
resizeViewHeader();
}
void SearchEnginesDialog::resizeViewHeader()
{
const int headerWidth = ui->treeWidget->header()->width();
ui->treeWidget->header()->resizeSection(0, headerWidth - headerWidth / 4);
}
void SearchEnginesDialog::accept()
{
if (ui->treeWidget->topLevelItemCount() < 1) {

View File

@ -63,6 +63,10 @@ private:
void reloadEngines();
void showEvent(QShowEvent *e) override;
void resizeEvent(QResizeEvent *e) override;
void resizeViewHeader();
Ui::SearchEnginesDialog* ui;
SearchEnginesManager* m_manager;
};

View File

@ -79,7 +79,7 @@
<bool>true</bool>
</property>
<attribute name="headerDefaultSectionSize">
<number>200</number>
<number>0</number>
</attribute>
<column>
<property name="text">