|
@@ -5,6 +5,7 @@ import collections
|
5
|
5
|
import logging
|
6
|
6
|
import os
|
7
|
7
|
import sys
|
|
8
|
+from math import ceil, sqrt
|
8
|
9
|
|
9
|
10
|
import qdarkstyle
|
10
|
11
|
|
|
@@ -148,7 +149,8 @@ class NameButtons(QWidget):
|
148
|
149
|
LOG.debug("Initializing NameButtons.")
|
149
|
150
|
|
150
|
151
|
ps = Person.get_all(True)
|
151
|
|
- num_columns = round(len(ps) / 10) + 1
|
|
152
|
+ # num_columns = round(len(ps) / 10) + 1
|
|
153
|
+ num_columns = min(5, ceil(sqrt(len(ps))))
|
152
|
154
|
|
153
|
155
|
if self.layout:
|
154
|
156
|
LOG.debug("Removing %s widgets for rebuild", self.layout.count())
|