From 8e726ee370bdc9b4cc3c1fafc2a10e3d55a211ce Mon Sep 17 00:00:00 2001 From: Zsolt Kovari Date: Tue, 1 Oct 2024 11:44:09 +0200 Subject: [PATCH] Use tabs for world-building panel, closes #1358 --- src/main/python/plotlyst/view/style/button.py | 2 +- .../plotlyst/view/world_building_view.py | 12 +- ui/main_window.ui | 2 +- ui/world_building_view.ui | 155 ++++++------------ 4 files changed, 55 insertions(+), 116 deletions(-) diff --git a/src/main/python/plotlyst/view/style/button.py b/src/main/python/plotlyst/view/style/button.py index 73828a46c..58dcb20e3 100644 --- a/src/main/python/plotlyst/view/style/button.py +++ b/src/main/python/plotlyst/view/style/button.py @@ -352,7 +352,7 @@ } QAbstractButton:hover[transparent-magnolia-rounded-bg-on-hover=true] { - background: #FCF5FE; + background: #F0E6F4; } QAbstractButton:hover[top-selector=true] { diff --git a/src/main/python/plotlyst/view/world_building_view.py b/src/main/python/plotlyst/view/world_building_view.py index f2599cb06..70e853acd 100644 --- a/src/main/python/plotlyst/view/world_building_view.py +++ b/src/main/python/plotlyst/view/world_building_view.py @@ -25,7 +25,7 @@ from PyQt6.QtSvg import QSvgRenderer from PyQt6.QtWidgets import QWidget, QGraphicsColorizeEffect from overrides import overrides -from qthandy import bold +from qthandy import bold, incr_icon, incr_font from qthandy.filter import OpacityEventFilter from plotlyst.common import PLOTLYST_SECONDARY_COLOR, RELAXED_WHITE_COLOR @@ -91,9 +91,6 @@ def __init__(self, novel: Novel): self._entity: Optional[WorldBuildingEntity] = None - self.ui.btnMilieuIcon.setIcon(IconRegistry.world_building_icon()) - bold(self.ui.lblTitleMilieu) - self.ui.btnNew.setIcon(IconRegistry.plus_icon(color=RELAXED_WHITE_COLOR)) self.ui.btnNew.installEventFilter(ButtonPressResizeEventFilter(self.ui.btnNew)) self.ui.btnTreeToggle.setIcon(IconRegistry.from_name('mdi.file-tree-outline')) @@ -138,7 +135,6 @@ def __init__(self, novel: Novel): self._additionMenu = EntityAdditionMenu(self.novel, self.ui.btnNew) self._additionMenu.entityTriggered.connect(self.ui.treeWorld.addEntity) self._additionMenu.topicsSelected.connect(self.ui.treeWorld.addEntities) - self.ui.iconReaderMode.setIcon(IconRegistry.from_name('fa5s.eye')) self.ui.btnMilieuView.setIcon(IconRegistry.world_building_icon()) self.ui.btnWorldView.setIcon(IconRegistry.from_name('ri.quill-pen-fill')) @@ -147,6 +143,10 @@ def __init__(self, novel: Novel): IconRegistry.from_name('mdi.timeline-outline', color_on=PLOTLYST_SECONDARY_COLOR)) self.ui.btnGlossaryView.setIcon(IconRegistry.from_name('mdi.book-alphabet', color_on=PLOTLYST_SECONDARY_COLOR)) + for btn in self.ui.buttonGroup.buttons(): + incr_icon(btn, 2) + incr_font(btn, 2) + self.ui.splitterNav.setSizes([150, 500]) font = self.ui.lineName.font() font.setPointSize(32) @@ -188,8 +188,6 @@ def __init__(self, novel: Novel): (self.ui.btnGlossaryView, self.ui.pageGlossary)]) self.ui.btnMilieuView.setChecked(True) - self.ui.iconReaderMode.setHidden(True) - self.ui.readerModeToggle.setHidden(True) self.ui.btnHistoryView.setHidden(True) @overrides diff --git a/ui/main_window.ui b/ui/main_window.ui index b63be874d..61b829cac 100644 --- a/ui/main_window.ui +++ b/ui/main_window.ui @@ -248,7 +248,7 @@ PointingHandCursor - World building + World-building diff --git a/ui/world_building_view.ui b/ui/world_building_view.ui index f961a2967..f836c0ab8 100644 --- a/ui/world_building_view.ui +++ b/ui/world_building_view.ui @@ -24,7 +24,7 @@ 0 - 2 + 15 0 @@ -32,50 +32,6 @@ 0 - - - - - 3 - - - 5 - - - 2 - - - 5 - - - 2 - - - - - - - - true - - - - - - - - 0 - 0 - - - - Milieu and world-building - - - - - - @@ -105,7 +61,7 @@ - + PointingHandCursor @@ -113,7 +69,7 @@ Milieu entities - + Milieu 1 @@ -124,7 +80,13 @@ false - + + true + + + true + + true @@ -140,7 +102,7 @@ - + PointingHandCursor @@ -148,7 +110,7 @@ Worldbuilding bible with articles - + Worldbuilding bible 1 @@ -159,7 +121,13 @@ false - + + true + + + true + + true @@ -168,7 +136,7 @@ - + PointingHandCursor @@ -176,7 +144,7 @@ Map - + Map 3 @@ -187,7 +155,13 @@ false - + + true + + + true + + true @@ -196,7 +170,7 @@ - + PointingHandCursor @@ -204,7 +178,7 @@ Timeline - + Timeline 3 @@ -215,7 +189,13 @@ false - + + true + + + true + + true @@ -224,7 +204,7 @@ - + PointingHandCursor @@ -232,7 +212,7 @@ Glossary - + Glossary 3 @@ -243,7 +223,13 @@ false - + + true + + + true + + true @@ -264,29 +250,6 @@ - - - - PointingHandCursor - - - - - - true - - - - - - - PointingHandCursor - - - CheckBox - - - @@ -505,7 +468,7 @@ 0 0 402 - 559 + 577 @@ -1142,11 +1105,6 @@ QTreeView
plotlyst.view.widget.world
- - Toggle - QCheckBox -
plotlyst.view.widget.input
-
LocationsTreeView QTreeView @@ -1154,24 +1112,7 @@ - - - iconReaderMode - clicked() - readerModeToggle - toggle() - - - 766 - 24 - - - 802 - 21 - - - - +