Skip to content

Commit

Permalink
Add muted bg color
Browse files Browse the repository at this point in the history
  • Loading branch information
zkovari committed Oct 3, 2024
1 parent c6a6ed6 commit deac1b0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/main/python/plotlyst/view/style/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from PyQt6.QtWidgets import QWidget
from qtmenu import MenuWidget

from plotlyst.view.style.theme import BG_PRIMARY_COLOR, BG_SECONDARY_COLOR
from plotlyst.view.style.theme import BG_PRIMARY_COLOR, BG_SECONDARY_COLOR, BG_MUTED_COLOR

style = f'''
* {{
Expand All @@ -51,7 +51,7 @@
}}
QWidget[darker-bg=true] {{
background-color: #E5E5EE;
background-color: {BG_MUTED_COLOR};
}}
QWidget[white-bg=true] {{
Expand Down
1 change: 1 addition & 0 deletions src/main/python/plotlyst/view/style/theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@

BG_PRIMARY_COLOR: str = '#EFEFF4'
BG_SECONDARY_COLOR: str = '#F5F6F8'
BG_MUTED_COLOR: str = '#E5E5EE'

TEXT_COLOR_ON_DARK_BG: str = BG_SECONDARY_COLOR
22 changes: 14 additions & 8 deletions src/main/python/plotlyst/view/widget/character/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ class SectionContext:
def has_white_bg(self) -> bool:
return False

def has_muted_bg(self) -> bool:
return False

def has_bg(self) -> bool:
return self.has_white_bg() or self.has_muted_bg()

def has_addition(self) -> bool:
return False

Expand Down Expand Up @@ -310,12 +316,12 @@ def __init__(self, section: CharacterProfileSectionReference, context: SectionCo

self.wdgContainer = QFrame()
vbox(self.wdgContainer, 5)
if self.context.has_white_bg():
if app_env.is_mac():
self.wdgContainer.setProperty('relaxed-white-bg', True)
else:
self.wdgContainer.setProperty('white-bg', True)
if self.context.has_bg():
self.wdgContainer.setProperty('rounded', True)
if self.context.has_white_bg():
self.wdgContainer.setProperty('relaxed-white-bg', True)
elif self.context.has_muted_bg():
self.wdgContainer.setProperty('darker-bg', True)
else:
margins(self.wdgContainer, left=20)

Expand All @@ -324,7 +330,7 @@ def __init__(self, section: CharacterProfileSectionReference, context: SectionCo
margins(self.wdgBottom, left=20)

self.layout().addWidget(self.wdgHeader)
if self.context.has_white_bg():
if self.context.has_bg():
self.layout().addWidget(wrap(self.wdgContainer, margin_left=20))
else:
self.layout().addWidget(self.wdgContainer)
Expand Down Expand Up @@ -987,7 +993,7 @@ def _valueChanged(self):
class StrengthsSectionContext(SectionContext):

@overrides
def has_white_bg(self) -> bool:
def has_muted_bg(self) -> bool:
return True


Expand All @@ -1001,7 +1007,7 @@ def has_white_bg(self) -> bool:
class MultiAttributeSectionContext(SectionContext):

@overrides
def has_white_bg(self) -> bool:
def has_muted_bg(self) -> bool:
return True

@overrides
Expand Down
5 changes: 3 additions & 2 deletions src/main/python/plotlyst/view/widget/plot/progression.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from qthandy.filter import VisibilityToggleEventFilter
from qtmenu import MenuWidget, ActionTooltipDisplayMode

from plotlyst.common import WHITE_COLOR, RELAXED_WHITE_COLOR
from plotlyst.common import RELAXED_WHITE_COLOR
from plotlyst.core.domain import Novel, PlotType, PlotProgressionItem, \
PlotProgressionItemType, DynamicPlotPrincipleGroupType, DynamicPlotPrinciple, DynamicPlotPrincipleType, Plot, \
DynamicPlotPrincipleGroup, LayoutType, Character
Expand All @@ -39,6 +39,7 @@
from plotlyst.view.icons import IconRegistry
from plotlyst.view.layout import group
from plotlyst.view.style.button import apply_button_palette_color
from plotlyst.view.style.theme import BG_MUTED_COLOR
from plotlyst.view.widget.characters import CharacterSelectorButton
from plotlyst.view.widget.confirm import confirmed
from plotlyst.view.widget.display import IconText
Expand Down Expand Up @@ -426,7 +427,7 @@ def __init__(self, novel: Novel, principleGroup: DynamicPlotPrincipleGroup, pare
#frame {{
border: 1px solid lightgrey;
border-radius: 8px;
background: {WHITE_COLOR};
background: {BG_MUTED_COLOR};
}}
''')

Expand Down

0 comments on commit deac1b0

Please sign in to comment.