Disabled base geometry-list resizing since it makes the list unusable on HDP monitors.
This commit is contained in:
@@ -42,13 +42,8 @@ __author__ = "sliptonic (Brad Collette)"
|
||||
__url__ = "https://www.freecadweb.org"
|
||||
__doc__ = "Base classes and framework for Path operation's UI"
|
||||
|
||||
LOGLEVEL = False
|
||||
|
||||
if LOGLEVEL:
|
||||
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
|
||||
PathLog.trackModule(PathLog.thisModule())
|
||||
else:
|
||||
PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule())
|
||||
PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule())
|
||||
# PathLog.trackModule(PathLog.thisModule())
|
||||
|
||||
|
||||
def translate(context, text, disambig=None):
|
||||
@@ -566,6 +561,7 @@ class TaskPanelBaseGeometryPage(TaskPanelPage):
|
||||
return False
|
||||
|
||||
def addBase(self):
|
||||
PathLog.track()
|
||||
if self.addBaseGeometry(FreeCADGui.Selection.getSelectionEx()):
|
||||
# self.obj.Proxy.execute(self.obj)
|
||||
self.setFields(self.obj)
|
||||
@@ -636,11 +632,18 @@ class TaskPanelBaseGeometryPage(TaskPanelPage):
|
||||
# Set base geometry list window to resize based on contents
|
||||
# Code reference:
|
||||
# https://stackoverflow.com/questions/6337589/qlistwidget-adjust-size-to-content
|
||||
# ml: disabling this logic because I can't get it to work on HPD monitor.
|
||||
# On my systems the values returned by the list object are also incorrect on
|
||||
# creation, leading to a list object of size 15. count() always returns 0 until
|
||||
# the list is actually displayed. The same is true for sizeHintForRow(0), which
|
||||
# returns -1 until the widget is rendered. The widget claims to have a size of
|
||||
# (100, 30), once it becomes visible the size is (535, 192).
|
||||
# Leaving the framework here in case somebody figures out how to set this up
|
||||
# properly.
|
||||
qList = self.form.baseList
|
||||
# qList.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
|
||||
col = qList.width() # 300
|
||||
row = (qList.count() + qList.frameWidth()) * 15
|
||||
qList.setFixedSize(col, row)
|
||||
#qList.setMinimumHeight(row)
|
||||
PathLog.debug("baseList({}, {}) {} * {}".format(qList.size(), row, qList.count(), qList.sizeHintForRow(0)))
|
||||
|
||||
|
||||
class TaskPanelBaseLocationPage(TaskPanelPage):
|
||||
|
||||
Reference in New Issue
Block a user