Add option to hide scrollbars on all major GUI areas
This commit is contained in:
@@ -102,6 +102,10 @@ class Config:
|
|||||||
self.outlnPanePos = [500, 150]
|
self.outlnPanePos = [500, 150]
|
||||||
self.isFullScreen = False
|
self.isFullScreen = False
|
||||||
|
|
||||||
|
## Features
|
||||||
|
self.hideVScroll = False # Hide vertical scroll bars on main widgets
|
||||||
|
self.hideHScroll = False # Hide horizontal scroll bars on main widgets
|
||||||
|
|
||||||
## Project
|
## Project
|
||||||
self.autoSaveProj = 60
|
self.autoSaveProj = 60
|
||||||
self.autoSaveDoc = 30
|
self.autoSaveDoc = 30
|
||||||
|
|||||||
+10
-2
@@ -450,10 +450,12 @@ class GuiBuildNovel(QDialog):
|
|||||||
# Tool Box Scroll Area
|
# Tool Box Scroll Area
|
||||||
self.toolsArea = QScrollArea()
|
self.toolsArea = QScrollArea()
|
||||||
self.toolsArea.setMinimumWidth(self.mainConf.pxInt(250))
|
self.toolsArea.setMinimumWidth(self.mainConf.pxInt(250))
|
||||||
self.toolsArea.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded)
|
|
||||||
self.toolsArea.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
|
|
||||||
self.toolsArea.setWidgetResizable(True)
|
self.toolsArea.setWidgetResizable(True)
|
||||||
self.toolsArea.setWidget(self.toolsWidget)
|
self.toolsArea.setWidget(self.toolsWidget)
|
||||||
|
if self.mainConf.hideVScroll:
|
||||||
|
self.toolsArea.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||||
|
if self.mainConf.hideHScroll:
|
||||||
|
self.toolsArea.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||||
|
|
||||||
# Tools and Buttons Layout
|
# Tools and Buttons Layout
|
||||||
self.innerBox = QVBoxLayout()
|
self.innerBox = QVBoxLayout()
|
||||||
@@ -1116,6 +1118,12 @@ class GuiBuildNovelDocView(QTextBrowser):
|
|||||||
else:
|
else:
|
||||||
self.setTabStopWidth(self.mainConf.getTabWidth())
|
self.setTabStopWidth(self.mainConf.getTabWidth())
|
||||||
|
|
||||||
|
# Scroll bars
|
||||||
|
if self.mainConf.hideVScroll:
|
||||||
|
self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||||
|
if self.mainConf.hideHScroll:
|
||||||
|
self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||||
|
|
||||||
docPalette = self.palette()
|
docPalette = self.palette()
|
||||||
docPalette.setColor(QPalette.Base, QColor(255, 255, 255))
|
docPalette.setColor(QPalette.Base, QColor(255, 255, 255))
|
||||||
docPalette.setColor(QPalette.Text, QColor(0, 0, 0))
|
docPalette.setColor(QPalette.Text, QColor(0, 0, 0))
|
||||||
|
|||||||
@@ -224,6 +224,12 @@ class GuiDocEditor(QTextEdit):
|
|||||||
|
|
||||||
self.qDocument.setDefaultTextOption(theOpt)
|
self.qDocument.setDefaultTextOption(theOpt)
|
||||||
|
|
||||||
|
# Scroll bars
|
||||||
|
if self.mainConf.hideVScroll:
|
||||||
|
self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||||
|
if self.mainConf.hideHScroll:
|
||||||
|
self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||||
|
|
||||||
# Refresh the tab stops
|
# Refresh the tab stops
|
||||||
if self.mainConf.verQtValue >= 51000:
|
if self.mainConf.verQtValue >= 51000:
|
||||||
self.setTabStopDistance(self.mainConf.getTabWidth())
|
self.setTabStopDistance(self.mainConf.getTabWidth())
|
||||||
|
|||||||
@@ -124,6 +124,12 @@ class GuiDocViewer(QTextBrowser):
|
|||||||
theOpt.setAlignment(Qt.AlignJustify)
|
theOpt.setAlignment(Qt.AlignJustify)
|
||||||
self.qDocument.setDefaultTextOption(theOpt)
|
self.qDocument.setDefaultTextOption(theOpt)
|
||||||
|
|
||||||
|
# Scroll bars
|
||||||
|
if self.mainConf.hideVScroll:
|
||||||
|
self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||||
|
if self.mainConf.hideHScroll:
|
||||||
|
self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||||
|
|
||||||
# Refresh the tab stops
|
# Refresh the tab stops
|
||||||
if self.mainConf.verQtValue >= 51000:
|
if self.mainConf.verQtValue >= 51000:
|
||||||
self.setTabStopDistance(self.mainConf.getTabWidth())
|
self.setTabStopDistance(self.mainConf.getTabWidth())
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ class GuiOutline(QTreeWidget):
|
|||||||
self.colIndex = {}
|
self.colIndex = {}
|
||||||
self.treeNCols = 0
|
self.treeNCols = 0
|
||||||
|
|
||||||
|
self.initOutline()
|
||||||
self.clearOutline()
|
self.clearOutline()
|
||||||
self.headerMenu.setHiddenState(self.colHidden)
|
self.headerMenu.setHiddenState(self.colHidden)
|
||||||
|
|
||||||
@@ -125,6 +126,17 @@ class GuiOutline(QTreeWidget):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def initOutline(self):
|
||||||
|
"""Set or update outline settings.
|
||||||
|
"""
|
||||||
|
# Scroll bars
|
||||||
|
if self.mainConf.hideVScroll:
|
||||||
|
self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||||
|
if self.mainConf.hideHScroll:
|
||||||
|
self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
def clearOutline(self):
|
def clearOutline(self):
|
||||||
"""Clear the tree and header and set the default values for the
|
"""Clear the tree and header and set the default values for the
|
||||||
columns arrays.
|
columns arrays.
|
||||||
|
|||||||
@@ -224,10 +224,23 @@ class GuiOutlineDetails(QScrollArea):
|
|||||||
self.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
|
self.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
|
||||||
self.setWidgetResizable(True)
|
self.setWidgetResizable(True)
|
||||||
|
|
||||||
|
self.initDetails()
|
||||||
|
|
||||||
logger.debug("GuiOutlineDetails initialisation complete")
|
logger.debug("GuiOutlineDetails initialisation complete")
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def initDetails(self):
|
||||||
|
"""Set or update outline settings.
|
||||||
|
"""
|
||||||
|
# Scroll bars
|
||||||
|
if self.mainConf.hideVScroll:
|
||||||
|
self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||||
|
if self.mainConf.hideHScroll:
|
||||||
|
self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
def showItem(self, tHandle, sTitle):
|
def showItem(self, tHandle, sTitle):
|
||||||
"""Update the content of the tree with the given handle and line
|
"""Update the content of the tree with the given handle and line
|
||||||
number pointing to a header.
|
number pointing to a header.
|
||||||
|
|||||||
@@ -115,6 +115,9 @@ class GuiProjectTree(QTreeWidget):
|
|||||||
# The last column should just auto-scale
|
# The last column should just auto-scale
|
||||||
self.resizeColumnToContents(self.C_FLAGS)
|
self.resizeColumnToContents(self.C_FLAGS)
|
||||||
|
|
||||||
|
# Set custom settings
|
||||||
|
self.initTree()
|
||||||
|
|
||||||
logger.debug("GuiProjectTree initialisation complete")
|
logger.debug("GuiProjectTree initialisation complete")
|
||||||
|
|
||||||
# Internal Mapping
|
# Internal Mapping
|
||||||
@@ -122,6 +125,17 @@ class GuiProjectTree(QTreeWidget):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def initTree(self):
|
||||||
|
"""Set or update tree widget settings.
|
||||||
|
"""
|
||||||
|
# Scroll bars
|
||||||
|
if self.mainConf.hideVScroll:
|
||||||
|
self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||||
|
if self.mainConf.hideHScroll:
|
||||||
|
self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
##
|
##
|
||||||
# Class Methods
|
# Class Methods
|
||||||
##
|
##
|
||||||
|
|||||||
@@ -790,6 +790,9 @@ class GuiMain(QMainWindow):
|
|||||||
self.saveDocument()
|
self.saveDocument()
|
||||||
self.docEditor.initEditor()
|
self.docEditor.initEditor()
|
||||||
self.docViewer.initViewer()
|
self.docViewer.initViewer()
|
||||||
|
self.treeView.initTree()
|
||||||
|
self.projView.initOutline()
|
||||||
|
self.projMeta.initDetails()
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user