aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/widgets/KeyTable.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-12-20 19:44:31 +0000
committersaturneric <[email protected]>2024-12-20 19:44:31 +0000
commitee3491860f86c65e6af1bc3549e6228c053e34f3 (patch)
tree8229a918f7ca8f0360bc3df402cbfc763e662a8b /src/ui/widgets/KeyTable.cpp
parentfix: try to add all platform plugins for AppImage (diff)
downloadGpgFrontend-ee3491860f86c65e6af1bc3549e6228c053e34f3.tar.gz
GpgFrontend-ee3491860f86c65e6af1bc3549e6228c053e34f3.zip
fix: adjust the width of key list cell correctly
Diffstat (limited to 'src/ui/widgets/KeyTable.cpp')
-rw-r--r--src/ui/widgets/KeyTable.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ui/widgets/KeyTable.cpp b/src/ui/widgets/KeyTable.cpp
index bda294a4..6fe2d966 100644
--- a/src/ui/widgets/KeyTable.cpp
+++ b/src/ui/widgets/KeyTable.cpp
@@ -54,7 +54,7 @@ KeyTable::KeyTable(QWidget* parent, QSharedPointer<GpgKeyTableModel> model,
verticalHeader()->hide();
horizontalHeader()->setStretchLastSection(false);
- setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
+ horizontalHeader()->setResizeContentsPrecision(1000);
setShowGrid(false);
sortByColumn(2, Qt::AscendingOrder);
@@ -68,6 +68,10 @@ KeyTable::KeyTable(QWidget* parent, QSharedPointer<GpgKeyTableModel> model,
setAlternatingRowColors(true);
setSortingEnabled(true);
+ for (int i = 1; i < proxy_model_.columnCount(); ++i) {
+ this->resizeColumnToContents(i);
+ }
+
connect(CommonUtils::GetInstance(), &CommonUtils::SignalFavoritesChanged,
&proxy_model_, &GpgKeyTableProxyModel::SignalFavoritesChanged);
connect(this, &KeyTable::SignalColumnTypeChange, this,
@@ -146,4 +150,5 @@ void KeyTable::UncheckAll() {
return selected_indexes.first().row();
}
+
} // namespace GpgFrontend::UI \ No newline at end of file