Skip to content

Commit

Permalink
Add resize splitter for console
Browse files Browse the repository at this point in the history
as it was from f15b4e1
  • Loading branch information
slarosa committed Oct 31, 2012
1 parent d6e832d commit 06da4e8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
26 changes: 13 additions & 13 deletions python/console.py
Expand Up @@ -88,6 +88,11 @@ def __init__(self, parent=None):

self.options = optionsDialog(self)

self.splitter = QSplitter(self)
self.splitter.setOrientation(Qt.Vertical)
self.splitter.setHandleWidth(3)
self.splitter.setChildrenCollapsible(False)

self.toolBar = QToolBar()
self.toolBar.setEnabled(True)
self.toolBar.setFocusPolicy(Qt.NoFocus)
Expand Down Expand Up @@ -262,25 +267,20 @@ def __init__(self, parent=None):
sizePolicy.setHeightForWidth(self.widgetButton.sizePolicy().hasHeightForWidth())
self.widgetButton.setSizePolicy(sizePolicy)

self.consoleFrame = QFrame(self)
self.consoleFrame.setObjectName("consoleFrame")
self.consoleLayout = QVBoxLayout(self.consoleFrame)
self.consoleLayout.setSpacing(0)
self.consoleLayout.setMargin(0)
self.splitter.addWidget(self.textEditOut)
self.splitter.addWidget(self.edit)

sizes = self.splitter.sizes()
self.splitter.setSizes(sizes)

self.f.addWidget(self.widgetButton, 0, 0)
self.f.addWidget(self.splitter, 0, 1)

sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.textEditOut.sizePolicy().hasHeightForWidth())
self.textEditOut.setSizePolicy(sizePolicy)
self.consoleLayout.addWidget(self.textEditOut)

self.edit.setMinimumSize(QSize(0, 32))
self.edit.setMaximumSize(QSize(16777215, 32))
self.consoleLayout.addWidget(self.edit)

self.f.addWidget(self.widgetButton, 0, 0)
self.f.addWidget(self.consoleFrame, 0, 1)

self.clearButton.triggered.connect(self.textEditOut.clearConsole)
self.optionsButton.triggered.connect(self.openSettings)
Expand Down
1 change: 1 addition & 0 deletions python/console_output.py
Expand Up @@ -94,6 +94,7 @@ def __init__(self, parent=None):
self.setCaretLineVisible(True)
self.setCaretLineBackgroundColor(QColor("#fcf3ed"))

self.setMinimumHeight(80)

# Folding
#self.setFolding(QsciScintilla.BoxedTreeFoldStyle)
Expand Down
7 changes: 3 additions & 4 deletions python/console_sci.py
Expand Up @@ -50,7 +50,7 @@ def __init__(self, parent=None):

self.buffer = []

#self.insertInitText()
self.insertInitText()
self.displayPrompt(False)

for line in _init_commands:
Expand Down Expand Up @@ -94,10 +94,9 @@ def __init__(self, parent=None):
self.SendScintilla(QsciScintilla.SCI_SETHSCROLLBAR, 0)
self.SendScintilla(QsciScintilla.SCI_SETVSCROLLBAR, 0)


# not too small
#self.setMinimumSize(500, 300)
self.setMinimumHeight(32)
self.setMinimumHeight(50)

self.SendScintilla(QsciScintilla.SCI_SETWRAPMODE, 2)
self.SendScintilla(QsciScintilla.SCI_EMPTYUNDOBUFFER)
Expand Down Expand Up @@ -553,6 +552,6 @@ def write(self, txt):

def write_stdout(self, txt):
if len(txt) > 0:
getCmdString = self.text()
getCmdString = self.text(2)
prompt = getCmdString[0:4]
sys.stdout.write(prompt+txt+'\n')

0 comments on commit 06da4e8

Please sign in to comment.