Skip to content

Commit

Permalink
Restyle
Browse files Browse the repository at this point in the history
  • Loading branch information
zkovari committed Aug 17, 2023
1 parent c42b161 commit cdc2892
Show file tree
Hide file tree
Showing 8 changed files with 246 additions and 173 deletions.
2 changes: 1 addition & 1 deletion designer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
set -e
export QT_DEBUG_PLUGINS=0

pyqt6-tools designer &
qt6-tools designer &
3 changes: 2 additions & 1 deletion src/main/python/plotlyst/view/board_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from src.main.python.plotlyst.common import PLOTLYST_SECONDARY_COLOR
from src.main.python.plotlyst.core.domain import Novel
from src.main.python.plotlyst.view._view import AbstractNovelView
from src.main.python.plotlyst.view.common import scroll_to_bottom
from src.main.python.plotlyst.view.common import scroll_to_bottom, ButtonPressResizeEventFilter
from src.main.python.plotlyst.view.generated.board_view_ui import Ui_BoardView
from src.main.python.plotlyst.view.icons import IconRegistry
from src.main.python.plotlyst.view.widget.task import BoardWidget
Expand All @@ -38,6 +38,7 @@ def __init__(self, novel: Novel):
self.ui.setupUi(self.widget)

self.ui.btnNew.setIcon(IconRegistry.plus_icon('white'))
self.ui.btnNew.installEventFilter(ButtonPressResizeEventFilter(self.ui.btnNew))
self.ui.btnBoard.setIcon(IconRegistry.from_name('fa5s.columns', color_on=PLOTLYST_SECONDARY_COLOR))
self.ui.btnChart.setIcon(IconRegistry.from_name('mdi.chart-areaspline', color_on=PLOTLYST_SECONDARY_COLOR))
self.ui.btnSettings.setIcon(IconRegistry.cog_icon())
Expand Down
18 changes: 11 additions & 7 deletions src/main/python/plotlyst/view/characters_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
from functools import partial
from typing import Optional, List

import qtanim
from PyQt6.QtCore import QItemSelection, QPoint
from PyQt6.QtGui import QKeySequence
from PyQt6.QtWidgets import QWidget
from overrides import overrides
from qthandy import busy, gc, incr_font, bold, vbox, vspacer, transparent, underline
from qthandy.filter import InstantTooltipEventFilter
from qthandy import busy, gc, incr_font, bold, vbox, vspacer
from qthandy.filter import InstantTooltipEventFilter, OpacityEventFilter
from qtmenu import MenuWidget

from src.main.python.plotlyst.common import PLOTLYST_SECONDARY_COLOR
Expand Down Expand Up @@ -142,20 +144,20 @@ def __init__(self, novel: Novel):
self.ui.cards.setCardsWidth(142)
self._init_cards()

transparent(self.ui.btnComparisonLabel)
underline(self.ui.btnComparisonLabel)
self.ui.btnComparisonLabel.setIcon(IconRegistry.from_name('mdi.compare-horizontal'))
self.ui.btnHorizontalComparison.setIcon(IconRegistry.from_name('ph.columns-bold'))
self.ui.btnVerticalComparison.setIcon(IconRegistry.from_name('ph.rows-bold'))
self.ui.btnGridComparison.setIcon(IconRegistry.from_name('ph.grid-four-bold'))
self.ui.btnSummaryComparison.setIcon(IconRegistry.synopsis_icon())
self.ui.btnBigFiveComparison.setIcon(IconRegistry.big_five_icon())
self.ui.btnSummaryComparison.setIcon(IconRegistry.synopsis_icon(color_on=PLOTLYST_SECONDARY_COLOR))
self.ui.btnBigFiveComparison.setIcon(IconRegistry.big_five_icon(color_on=PLOTLYST_SECONDARY_COLOR))

self.ui.splitterCompTree.setSizes([150, 500])
self._wdgComparison = CharacterComparisonWidget(self.ui.pageComparison)
self.ui.scrollAreaComparisonContent.layout().addWidget(self._wdgComparison)
self._wdgCharactersCompTree = CharactersTreeView(self.novel)
self.ui.wdgCharactersCompTreeParent.layout().addWidget(self._wdgCharactersCompTree)
self.ui.btnCharactersToggle.setIcon(IconRegistry.character_icon())
self.ui.btnCharactersToggle.clicked.connect(
partial(qtanim.toggle_expansion, self.ui.wdgCharactersCompTreeParent))

self._wdgCharactersCompTree.characterToggled.connect(self._wdgComparison.updateCharacter)
self.ui.btnHorizontalComparison.clicked.connect(lambda: self._wdgComparison.updateLayout(LayoutType.HORIZONTAL))
Expand All @@ -165,6 +167,8 @@ def __init__(self, novel: Novel):
lambda: self._wdgComparison.displayAttribute(CharacterComparisonAttribute.SUMMARY))
self.ui.btnBigFiveComparison.clicked.connect(
lambda: self._wdgComparison.displayAttribute(CharacterComparisonAttribute.BIG_FIVE))
for btn in self.ui.btnGroupComparison.buttons():
btn.installEventFilter(OpacityEventFilter(btn, ignoreCheckedButton=True))

self._relations = RelationsView(self.novel)
self.ui.relationsParent.layout().addWidget(self._relations)
Expand Down
4 changes: 2 additions & 2 deletions src/main/python/plotlyst/view/icons.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ def book_icon(color='black', color_on=PLOTLYST_SECONDARY_COLOR) -> QIcon:
return qtawesome.icon('fa5s.book-open', color_on=color_on, color=color)

@staticmethod
def synopsis_icon() -> QIcon:
return IconRegistry.from_name('mdi.file-document')
def synopsis_icon(**kwargs) -> QIcon:
return IconRegistry.from_name('mdi.file-document', **kwargs)

@staticmethod
def general_info_icon() -> QIcon:
Expand Down
2 changes: 1 addition & 1 deletion src/main/python/plotlyst/view/reports_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def __init__(self, novel: Novel):
btn.installEventFilter(OpacityEventFilter(btn, leaveOpacity=0.7, ignoreCheckedButton=True))
btn.setProperty('transparent-circle-bg-on-hover', True)
btn.setProperty('large', True)
btn.setProperty('analysis-top-selector', True)
btn.setProperty('top-selector', True)

self._page_characters = CharactersReportPage(self.novel)
self.ui.stackedWidget.addWidget(self._page_characters)
Expand Down
23 changes: 13 additions & 10 deletions src/main/python/plotlyst/view/style/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,32 +257,35 @@
padding: 4px;
}
QToolButton[transparent-rounded-bg-on-hover=true] {
QAbstractButton[transparent-rounded-bg-on-hover=true] {
border-radius: 4px;
border: 1px hidden lightgrey;
padding: 2px;
}
QToolButton::menu-indicator[transparent-rounded-bg-on-hover=true] {
QAbstractButton::menu-indicator[transparent-rounded-bg-on-hover=true] {
width:0px;
}
QToolButton:hover[transparent-rounded-bg-on-hover=true] {
QAbstractButton:hover[transparent-rounded-bg-on-hover=true] {
background: #EDEDED;
}
QToolButton:hover[events-sidebar=true] {
QAbstractButton:hover[top-selector=true] {
background: lightgrey;
}
QToolButton:checked[events-sidebar=true] {
background: #D4B8E0
QAbstractButton:checked[top-selector=true] {
background: #D4B8E0;
}
QToolButton:hover[analysis-top-selector=true] {
background: lightgrey;
QAbstractButton:hover[secondary-selector=true] {
border-bottom: 1px solid lightgrey;
}
QToolButton:checked[analysis-top-selector=true] {
background: #D4B8E0
QAbstractButton:checked[secondary-selector=true] {
border-bottom: 2px solid #4B0763;
border-radius: 0px;
color: #4B0763;
}
QToolButton:checked[emotion-very-unhappy=true] {
Expand Down
4 changes: 2 additions & 2 deletions src/main/python/plotlyst/view/widget/events_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,11 +469,11 @@ def __init__(self, novel: Novel, parent=None):

self._btnAddEvent = tool_btn(
IconRegistry.from_name('mdi.calendar-plus'), 'Add new event', True,
icon_resize=False, properties=['transparent-rounded-bg-on-hover', 'events-sidebar'],
icon_resize=False, properties=['transparent-rounded-bg-on-hover', 'top-selector'],
parent=self._controlsNavBar)
self._btnAddCharacter = tool_btn(
IconRegistry.character_icon('#040406'), 'Add new character', True,
icon_resize=False, properties=['transparent-rounded-bg-on-hover', 'events-sidebar'],
icon_resize=False, properties=['transparent-rounded-bg-on-hover', 'top-selector'],
parent=self._controlsNavBar)
self._btnGroup = ExclusiveOptionalButtonGroup()
self._btnGroup.addButton(self._btnAddEvent)
Expand Down
Loading

0 comments on commit cdc2892

Please sign in to comment.