Add a custom widgets subpackage

This commit is contained in:
Veronica Berglyd Olsen
2023-02-21 16:06:41 +01:00
parent 06407a44d3
commit 7a60d8d867
16 changed files with 677 additions and 554 deletions
+7 -7
View File
@@ -40,8 +40,8 @@ from PyQt5.QtWidgets import (
from novelwriter.enum import nwAlert
from novelwriter.error import formatException
from novelwriter.common import formatTime, checkInt, checkIntTuple, minmax
from novelwriter.custom import QSwitch
from novelwriter.constants import nwConst, nwFiles
from novelwriter.custom.switch import NSwitch
logger = logging.getLogger(__name__)
@@ -190,37 +190,37 @@ class GuiWritingStats(QDialog):
self.filterForm = QGridLayout(self)
self.filterBox.setLayout(self.filterForm)
self.incNovel = QSwitch(width=2*sPx, height=sPx)
self.incNovel = NSwitch(width=2*sPx, height=sPx)
self.incNovel.setChecked(
pOptions.getBool("GuiWritingStats", "incNovel", True)
)
self.incNovel.clicked.connect(self._updateListBox)
self.incNotes = QSwitch(width=2*sPx, height=sPx)
self.incNotes = NSwitch(width=2*sPx, height=sPx)
self.incNotes.setChecked(
pOptions.getBool("GuiWritingStats", "incNotes", True)
)
self.incNotes.clicked.connect(self._updateListBox)
self.hideZeros = QSwitch(width=2*sPx, height=sPx)
self.hideZeros = NSwitch(width=2*sPx, height=sPx)
self.hideZeros.setChecked(
pOptions.getBool("GuiWritingStats", "hideZeros", True)
)
self.hideZeros.clicked.connect(self._updateListBox)
self.hideNegative = QSwitch(width=2*sPx, height=sPx)
self.hideNegative = NSwitch(width=2*sPx, height=sPx)
self.hideNegative.setChecked(
pOptions.getBool("GuiWritingStats", "hideNegative", False)
)
self.hideNegative.clicked.connect(self._updateListBox)
self.groupByDay = QSwitch(width=2*sPx, height=sPx)
self.groupByDay = NSwitch(width=2*sPx, height=sPx)
self.groupByDay.setChecked(
pOptions.getBool("GuiWritingStats", "groupByDay", False)
)
self.groupByDay.clicked.connect(self._updateListBox)
self.showIdleTime = QSwitch(width=2*sPx, height=sPx)
self.showIdleTime = NSwitch(width=2*sPx, height=sPx)
self.showIdleTime.setChecked(
pOptions.getBool("GuiWritingStats", "showIdleTime", False)
)