Skip to content

Commit

Permalink
Fix layout issue in DraftGui's _inputfield.
Browse files Browse the repository at this point in the history
  • Loading branch information
f3nix committed Jan 21, 2017
1 parent ad57478 commit 37b7513
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Mod/Draft/DraftGui.py
Expand Up @@ -334,13 +334,14 @@ def _lineedit (self,name, layout, hide=True, width=None):
return lineedit

def _inputfield (self,name, layout, hide=True, width=None):
p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/General")
bsize = p.GetInt("ToolbarIconSize",24)-2
inputfield = self.uiloader.createWidget("Gui::InputField")
inputfield.setObjectName(name)
if hide: inputfield.hide()
if not width: width = 800
inputfield.setMaximumSize(QtCore.QSize(width,bsize))
if not width:
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred)
inputfield.setSizePolicy(sizePolicy)
else:
inputfield.setMaximumWidth(width)
layout.addWidget(inputfield)
return inputfield

Expand Down

0 comments on commit 37b7513

Please sign in to comment.