From c2fa48ba901dfb8e2616e50ccc808ff892f3ef37 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Sun, 24 Jan 2021 20:52:43 -0800 Subject: [PATCH] Disabled base geometry-list resizing since it makes the list unusable on HDP monitors. --- .../Resources/panels/PageBaseGeometryEdit.ui | 180 +++++++++--------- src/Mod/Path/PathScripts/PathOpGui.py | 23 ++- 2 files changed, 98 insertions(+), 105 deletions(-) diff --git a/src/Mod/Path/Gui/Resources/panels/PageBaseGeometryEdit.ui b/src/Mod/Path/Gui/Resources/panels/PageBaseGeometryEdit.ui index 3ea92feef0b2..42441cbc2c34 100644 --- a/src/Mod/Path/Gui/Resources/panels/PageBaseGeometryEdit.ui +++ b/src/Mod/Path/Gui/Resources/panels/PageBaseGeometryEdit.ui @@ -6,8 +6,8 @@ 0 0 - 400 - 250 + 476 + 342 @@ -23,94 +23,28 @@ :/icons/Path_BaseGeometry.svg:/icons/Path_BaseGeometry.svg - - - - - - - Import - - - - - - - <html><head/><body><p>Remove the selected list items from the list of base geometries. The operation will not be applied to them.</p></body></html> - - - Remove - - - - - - - - 0 - 0 - - - - <html><head/><body><p>List of operations with Base Geometry in current Job.</p></body></html> - - - - - - - true - - - - 0 - 0 - - - - <html><head/><body><p>Select one or more features in the 3d view and press 'Add' to add them as the base items for this operation.</p><p><br/></p><p>Selected features can be deleted entirely.</p></body></html> - - - QAbstractItemView::ExtendedSelection - - - - - - - <html><head/><body><p>Clears list of base geometries.</p></body></html> - - - Clear - - - - - - - <html><head/><body><p>Add selected features to the list of base geometries for this operation.</p></body></html> - - - Add - - - - - - - All objects will be processed using the same operation properties - - - Qt::AlignCenter - - - true - - - - + + + + + <html><head/><body><p>Add selected features to the list of base geometries for this operation.</p></body></html> + + + Add + + + + + + + <html><head/><body><p>Remove the selected list items from the list of base geometries. The operation will not be applied to them.</p></body></html> + + + Remove + + - + Qt::Vertical @@ -123,14 +57,70 @@ + + + + <html><head/><body><p>Clears list of base geometries.</p></body></html> + + + Clear + + + + + + + All objects will be processed using the same operation properties + + + Qt::AlignCenter + + + true + + + + + + + true + + + + 0 + 0 + + + + <html><head/><body><p>Select one or more features in the 3d view and press 'Add' to add them as the base items for this operation.</p><p><br/></p><p>Selected features can be deleted entirely.</p></body></html> + + + QAbstractItemView::ExtendedSelection + + + + + + + Import + + + + + + + + 0 + 0 + + + + <html><head/><body><p>List of operations with Base Geometry in current Job.</p></body></html> + + + - - baseList - addBase - deleteBase - clearBase - diff --git a/src/Mod/Path/PathScripts/PathOpGui.py b/src/Mod/Path/PathScripts/PathOpGui.py index 64d93f2966ac..87e5f9b1e659 100644 --- a/src/Mod/Path/PathScripts/PathOpGui.py +++ b/src/Mod/Path/PathScripts/PathOpGui.py @@ -42,13 +42,8 @@ __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 @@ def addBaseGeometry(self, selection): 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 @@ def resizeBaseList(self): # 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):