From ca3912182691ab65c8d80a428fa4b6c04cdb8709 Mon Sep 17 00:00:00 2001 From: Olivier Keshavjee Date: Thu, 30 Nov 2017 17:18:53 +0100 Subject: [PATCH] UI tweaks --- manuskript/ui/collapsibleDockWidgets.py | 3 +- manuskript/ui/style.py | 39 ++++++++++++++----------- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/manuskript/ui/collapsibleDockWidgets.py b/manuskript/ui/collapsibleDockWidgets.py index cbb6e60..3479f23 100644 --- a/manuskript/ui/collapsibleDockWidgets.py +++ b/manuskript/ui/collapsibleDockWidgets.py @@ -52,6 +52,7 @@ class collapsibleDockWidgets(QToolBar): self.currentGroup = None self.setStyleSheet(style.toolBarSS()) + self.layout().setContentsMargins(0,0,0,0) def _dockWidgets(self): mw = self.parent() @@ -61,7 +62,7 @@ class collapsibleDockWidgets(QToolBar): def addCustomWidget(self, text, widget, group=None, defaultVisibility=True): """ Adds a custom widget to the toolbar. - + `text` is the name that will displayed on the button to switch visibility. `widget` is the widget to control from the toolbar. `group` is an integer (or any hashable) if the current widget should not diff --git a/manuskript/ui/style.py b/manuskript/ui/style.py index dc7232a..dc6b581 100644 --- a/manuskript/ui/style.py +++ b/manuskript/ui/style.py @@ -38,6 +38,7 @@ highlightedTextDark = F.mixColors(highlight, text, .3) highlightedTextLight = F.mixColors(highlight, highlightedText) midlighter = F.mixColors(mid, window, .4) textLight = F.mixColors(window, text) +textLighter = F.mixColors(window, text, .85) #from manuskript.ui import style as S @@ -160,25 +161,25 @@ def mainEditorTabSS(): if not settings.textEditor["backgroundTransparent"]: SS = """ QTabWidget::pane{{ - margin-top: -1px; - border: 1px solid {borderColor}; + margin-top: -{bw}px; + border: {bw}px solid {borderColor}; }} QTabWidget::tab-bar{{ left:50px; }} QTabBar{{ - background: transparent; + background: {bgColor}; border-radius: 0; border: 0px; }} QTabBar::tab{{ padding: 2px 9px; - border: 1px solid {borderColor}; + border: {bw}px solid {borderColor}; border-bottom: 0px; }} QTabBar::tab:selected{{ - border: 1px solid {borderColor}; - background: {bgColor}; + border: {bw}px solid {borderColor}; + background: {bgColorSelected}; border-bottom: 0px; color: {foreground}; }} @@ -187,32 +188,34 @@ def mainEditorTabSS(): color: {highlightedText}; }} """.format( - bgColor=settings.textEditor["background"], + bgColor=textLighter, + bgColorSelected=settings.textEditor["background"], foreground=settings.textEditor["fontColor"], borderColor=mid, highlight=highlight, highlightedText=highlightedText, + bw=0, ) else: # Transparent text view SS = """ QTabWidget::pane{{ - margin-top: -1px; + margin-top: -{bw}px; border: none; }} QTabWidget::tab-bar{{ left:50px; }} QTabBar{{ - background: transparent; + background: {bgColor}; border: 0px; }} QTabBar::tab{{ padding: 2px 9px; - border: 1px solid {borderColor}; + border: {bw}px solid {borderColor}; }} QTabBar::tab:selected{{ - border: 1px solid {borderColor}; + border: {bw}px solid {borderColor}; background: {highlight}; color: {highlightedText}; }} @@ -221,10 +224,12 @@ def mainEditorTabSS(): color: {highlightedText}; }} """.format( - highlight=highlight, - highlightedText=highlightedText, + bgColor=textLighter, + highlight=highlightLight, + highlightedText=text, text=text, borderColor=mid, + bw=0, ) # Add scrollbar @@ -237,9 +242,9 @@ def toolBarSS(): return """ QToolBar{{ background:transparent; - border: 0; - border-left: 1px solid {border}; + border:none; spacing: 0px; + margin-top:40px; }} QToolBar:separator{{ border: none; @@ -251,7 +256,7 @@ def toolBarSS(): def verticalToolButtonSS(): return """ QToolButton{{ - border: none; + border: 0; border-radius: 0px; background: transparent; margin: 0px; @@ -267,7 +272,7 @@ def verticalToolButtonSS(): }} """.format( borderColor=mid, - bgChecked=midlighter, + bgChecked=textLighter, bgHover=highlightLight, )