Commits

Brendan Howell committed 23d3cc9 Merge
  • Participants
  • Parent commits cc96d4d, 0b709db

Comments (0)

Files changed (1)

         tmp, self.logFile = tempfile.mkstemp()
         os.close(tmp)
 
-        self.resize(960, 500)
+        self.resize(1024, 500)
         self.setWindowTitle('PyCessing')
         self.fileName = None
         self.cwd = os.path.dirname(os.path.abspath(sys.argv[0]))
         lexer.setFont(font)
         self.textEdit.setLexer(lexer)
         
+        #TODO: make style 1 - python comments - italic
+        #self.textEdit.SendScintilla(Qsci.QsciScintilla.SCI_STYLESETFONT, 1, 'Courier')
+        
         self.textEdit.setAutoIndent(True)
         self.textEdit.setIndentationWidth(4)
         self.textEdit.setIndentationsUseTabs(False)
-        
+        self.textEdit.setMarginsFont(font)
         self.textEdit.setMarginWidth(0, fontMetrics.width("00000") + 5)
         self.textEdit.setMarginLineNumbers(0,True)
         
+        self.textEdit.setCaretLineVisible(True)
+        self.textEdit.setCaretLineBackgroundColor(QtGui.QColor("#ffe4e4"))
+        
         self.textEdit.setEdgeMode(Qsci.QsciScintilla.EdgeLine)
         self.textEdit.setEdgeColumn(80)
         self.textEdit.setWrapMode(Qsci.QsciScintilla.WrapNone)
         self.textEdit.setBraceMatching(Qsci.QsciScintilla.SloppyBraceMatch)
         
         self.splitter.addWidget(self.textEdit)
-        size = self.textEdit.sizeHint()
-        size.setWidth(80)
-        if size.height() < 300:
-            size.setHeight(300)
-        print "size: " + str(size.width()) + " x " + str(size.height())
+        #size = self.textEdit.sizeHint()
+        #size.setWidth(8)
+        #if size.height() < 300:
+        #    size.setHeight(300)
+        #print "size: " + str(size.width()) + " x " + str(size.height())
+        self.textEdit.SendScintilla(Qsci.QsciScintilla.SCI_SETHSCROLLBAR, 0)
+        self.textEdit.setMinimumSize(600,450)
+
         self.textEdit.resize(800,500)
         
     def setupMessageBox(self):
         
         self.helpwindow = QtGui.QDockWidget("Doc Browser")
         self.helpwindow.setAllowedAreas(QtCore.Qt.RightDockWidgetArea)
-        self.helpwindow.setMinimumWidth(400)
+        #self.helpwindow.setMinimumWidth(400)
         self.helpwindow.setFeatures(QtGui.QDockWidget.DockWidgetClosable | QtGui.QDockWidget.DockWidgetFloatable)
         helpAction = self.helpwindow.toggleViewAction()
         helpAction.setText("&Help Browser")
         helpAction.setShortcut(QtGui.QKeySequence("F1"))
         helpMenu.addAction(helpAction)
+ 
         self.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.helpwindow)
+        #self.helpwindow.resize(400, self.height())       
         
         helpbrowser = QtWebKit.QWebView(self.helpwindow)
         indexpath = resource_filename(__name__,"help/index.html")
         url = QtCore.QUrl("file://" + indexpath)
         helpbrowser.load(url)
-        helpbrowser.resize(400, self.helpwindow.height())
         helpbrowser.show()
+        helpbrowser.updateGeometry()
+        helpbrowser.update()
+        
+        helpbrowser.setMinimumWidth(400)
+        helpbrowser.setMinimumHeight( self.helpwindow.height())
+        sizepolicy = helpbrowser.sizePolicy()
+        sizepolicy.setVerticalPolicy(QtGui.QSizePolicy.MinimumExpanding)
+        sizepolicy.setHorizontalPolicy(QtGui.QSizePolicy.MinimumExpanding)
+
+        #sizepolicy = self.helpwindow.sizePolicy()
+        #sizepolicy.setVerticalStretch(QtGui.QSizePolicy.Expanding)
+        
+
         
 ##        helpbrowser = QtGui.QTextBrowser(self.helpwindow)
 ##        csspath = resource_filename(__name__,"help/media/css/style.css")