Skip to content

Commit

Permalink
Use tabs for world-building panel, closes #1358
Browse files Browse the repository at this point in the history
  • Loading branch information
zkovari committed Oct 1, 2024
1 parent e6c2ac2 commit 8e726ee
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 116 deletions.
2 changes: 1 addition & 1 deletion src/main/python/plotlyst/view/style/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@
}
QAbstractButton:hover[transparent-magnolia-rounded-bg-on-hover=true] {
background: #FCF5FE;
background: #F0E6F4;
}
QAbstractButton:hover[top-selector=true] {
Expand Down
12 changes: 5 additions & 7 deletions src/main/python/plotlyst/view/world_building_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'))
Expand Down Expand Up @@ -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'))
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ui/main_window.ui
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="toolTip">
<string>World building</string>
<string>World-building</string>
</property>
<property name="text">
<string/>
Expand Down
155 changes: 48 additions & 107 deletions ui/world_building_view.ui
Original file line number Diff line number Diff line change
Expand Up @@ -24,58 +24,14 @@
<number>0</number>
</property>
<property name="topMargin">
<number>2</number>
<number>15</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item alignment="Qt::AlignHCenter">
<widget class="QWidget" name="widget_3" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_11">
<property name="spacing">
<number>3</number>
</property>
<property name="leftMargin">
<number>5</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>5</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item>
<widget class="QToolButton" name="btnMilieuIcon">
<property name="text">
<string/>
</property>
<property name="transparent" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblTitleMilieu">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Milieu and world-building</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="wdgButtonsHeader" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_4">
Expand Down Expand Up @@ -105,15 +61,15 @@
</spacer>
</item>
<item>
<widget class="QToolButton" name="btnMilieuView">
<widget class="QPushButton" name="btnMilieuView">
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="toolTip">
<string>Milieu entities</string>
</property>
<property name="text">
<string/>
<string>Milieu</string>
</property>
<property name="shortcut">
<string>1</string>
Expand All @@ -124,7 +80,13 @@
<property name="checked">
<bool>false</bool>
</property>
<property name="base" stdset="0">
<property name="transparent-rounded-bg-on-hover" stdset="0">
<bool>true</bool>
</property>
<property name="secondary-selector" stdset="0">
<bool>true</bool>
</property>
<property name="transparent-magnolia-rounded-bg-on-hover" stdset="0">
<bool>true</bool>
</property>
<attribute name="buttonGroup">
Expand All @@ -140,15 +102,15 @@
</widget>
</item>
<item>
<widget class="QToolButton" name="btnWorldView">
<widget class="QPushButton" name="btnWorldView">
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="toolTip">
<string>Worldbuilding bible with articles</string>
</property>
<property name="text">
<string/>
<string>Worldbuilding bible</string>
</property>
<property name="shortcut">
<string>1</string>
Expand All @@ -159,7 +121,13 @@
<property name="checked">
<bool>false</bool>
</property>
<property name="base" stdset="0">
<property name="transparent-rounded-bg-on-hover" stdset="0">
<bool>true</bool>
</property>
<property name="secondary-selector" stdset="0">
<bool>true</bool>
</property>
<property name="transparent-magnolia-rounded-bg-on-hover" stdset="0">
<bool>true</bool>
</property>
<attribute name="buttonGroup">
Expand All @@ -168,15 +136,15 @@
</widget>
</item>
<item>
<widget class="QToolButton" name="btnMapView">
<widget class="QPushButton" name="btnMapView">
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="toolTip">
<string>Map</string>
</property>
<property name="text">
<string/>
<string>Map</string>
</property>
<property name="shortcut">
<string>3</string>
Expand All @@ -187,7 +155,13 @@
<property name="checked">
<bool>false</bool>
</property>
<property name="base" stdset="0">
<property name="transparent-rounded-bg-on-hover" stdset="0">
<bool>true</bool>
</property>
<property name="secondary-selector" stdset="0">
<bool>true</bool>
</property>
<property name="transparent-magnolia-rounded-bg-on-hover" stdset="0">
<bool>true</bool>
</property>
<attribute name="buttonGroup">
Expand All @@ -196,15 +170,15 @@
</widget>
</item>
<item>
<widget class="QToolButton" name="btnHistoryView">
<widget class="QPushButton" name="btnHistoryView">
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="toolTip">
<string>Timeline</string>
</property>
<property name="text">
<string/>
<string>Timeline</string>
</property>
<property name="shortcut">
<string>3</string>
Expand All @@ -215,7 +189,13 @@
<property name="checked">
<bool>false</bool>
</property>
<property name="base" stdset="0">
<property name="transparent-rounded-bg-on-hover" stdset="0">
<bool>true</bool>
</property>
<property name="secondary-selector" stdset="0">
<bool>true</bool>
</property>
<property name="transparent-magnolia-rounded-bg-on-hover" stdset="0">
<bool>true</bool>
</property>
<attribute name="buttonGroup">
Expand All @@ -224,15 +204,15 @@
</widget>
</item>
<item>
<widget class="QToolButton" name="btnGlossaryView">
<widget class="QPushButton" name="btnGlossaryView">
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="toolTip">
<string>Glossary</string>
</property>
<property name="text">
<string/>
<string>Glossary</string>
</property>
<property name="shortcut">
<string>3</string>
Expand All @@ -243,7 +223,13 @@
<property name="checked">
<bool>false</bool>
</property>
<property name="base" stdset="0">
<property name="transparent-rounded-bg-on-hover" stdset="0">
<bool>true</bool>
</property>
<property name="secondary-selector" stdset="0">
<bool>true</bool>
</property>
<property name="transparent-magnolia-rounded-bg-on-hover" stdset="0">
<bool>true</bool>
</property>
<attribute name="buttonGroup">
Expand All @@ -264,29 +250,6 @@
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="iconReaderMode">
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text">
<string/>
</property>
<property name="transparent" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="Toggle" name="readerModeToggle">
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text">
<string>CheckBox</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down Expand Up @@ -505,7 +468,7 @@
<x>0</x>
<y>0</y>
<width>402</width>
<height>559</height>
<height>577</height>
</rect>
</property>
<property name="sizePolicy">
Expand Down Expand Up @@ -1142,36 +1105,14 @@
<extends>QTreeView</extends>
<header>plotlyst.view.widget.world</header>
</customwidget>
<customwidget>
<class>Toggle</class>
<extends>QCheckBox</extends>
<header>plotlyst.view.widget.input</header>
</customwidget>
<customwidget>
<class>LocationsTreeView</class>
<extends>QTreeView</extends>
<header>plotlyst.view.widget.world.milieu</header>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>iconReaderMode</sender>
<signal>clicked()</signal>
<receiver>readerModeToggle</receiver>
<slot>toggle()</slot>
<hints>
<hint type="sourcelabel">
<x>766</x>
<y>24</y>
</hint>
<hint type="destinationlabel">
<x>802</x>
<y>21</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
<buttongroups>
<buttongroup name="buttonGroup"/>
</buttongroups>
Expand Down

0 comments on commit 8e726ee

Please sign in to comment.