novelWriter 2.6.2__py3-none-any.whl → 2.7b1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- novelwriter/__init__.py +84 -74
- novelwriter/assets/i18n/nw_cs_CZ.qm +0 -0
- novelwriter/assets/i18n/nw_de_DE.qm +0 -0
- novelwriter/assets/i18n/nw_en_US.qm +0 -0
- novelwriter/assets/i18n/nw_es_419.qm +0 -0
- novelwriter/assets/i18n/nw_fr_FR.qm +0 -0
- novelwriter/assets/i18n/nw_it_IT.qm +0 -0
- novelwriter/assets/i18n/nw_ja_JP.qm +0 -0
- novelwriter/assets/i18n/nw_nb_NO.qm +0 -0
- novelwriter/assets/i18n/nw_nl_NL.qm +0 -0
- novelwriter/assets/i18n/nw_pl_PL.qm +0 -0
- novelwriter/assets/i18n/nw_pt_BR.qm +0 -0
- novelwriter/assets/i18n/nw_ru_RU.qm +0 -0
- novelwriter/assets/i18n/nw_zh_CN.qm +0 -0
- novelwriter/assets/i18n/project_en_GB.json +1 -0
- novelwriter/assets/icons/font_awesome.icons +109 -0
- novelwriter/assets/icons/material_filled_bold.icons +109 -0
- novelwriter/assets/icons/material_filled_normal.icons +109 -0
- novelwriter/assets/icons/material_filled_thin.icons +109 -0
- novelwriter/assets/icons/material_rounded_bold.icons +109 -0
- novelwriter/assets/icons/material_rounded_normal.icons +109 -0
- novelwriter/assets/icons/material_rounded_thin.icons +109 -0
- novelwriter/assets/icons/remix_filled.icons +108 -0
- novelwriter/assets/icons/remix_outline.icons +108 -0
- novelwriter/assets/manual.pdf +0 -0
- novelwriter/assets/{manual_fr_FR.pdf → manual_fr.pdf} +0 -0
- novelwriter/assets/sample.zip +0 -0
- novelwriter/assets/syntax/cyberpunk_night.conf +1 -1
- novelwriter/assets/text/credits_en.htm +6 -6
- novelwriter/assets/themes/cyberpunk_night.conf +23 -7
- novelwriter/assets/themes/default_dark.conf +20 -4
- novelwriter/assets/themes/default_light.conf +21 -5
- novelwriter/assets/themes/dracula.conf +20 -4
- novelwriter/assets/themes/solarized_dark.conf +24 -8
- novelwriter/assets/themes/solarized_light.conf +22 -6
- novelwriter/common.py +33 -26
- novelwriter/config.py +118 -127
- novelwriter/constants.py +75 -56
- novelwriter/core/buildsettings.py +23 -16
- novelwriter/core/coretools.py +11 -7
- novelwriter/core/docbuild.py +19 -13
- novelwriter/core/document.py +2 -2
- novelwriter/core/index.py +142 -432
- novelwriter/core/indexdata.py +403 -0
- novelwriter/core/item.py +35 -28
- novelwriter/core/itemmodel.py +27 -26
- novelwriter/core/novelmodel.py +223 -0
- novelwriter/core/options.py +1 -1
- novelwriter/core/project.py +10 -11
- novelwriter/core/projectdata.py +5 -5
- novelwriter/core/projectxml.py +1 -1
- novelwriter/core/sessions.py +3 -2
- novelwriter/core/spellcheck.py +4 -3
- novelwriter/core/status.py +12 -15
- novelwriter/core/storage.py +1 -1
- novelwriter/core/tree.py +46 -8
- novelwriter/dialogs/about.py +19 -22
- novelwriter/dialogs/docmerge.py +21 -23
- novelwriter/dialogs/docsplit.py +20 -23
- novelwriter/dialogs/editlabel.py +9 -13
- novelwriter/dialogs/preferences.py +111 -48
- novelwriter/dialogs/projectsettings.py +48 -54
- novelwriter/dialogs/quotes.py +14 -19
- novelwriter/dialogs/wordlist.py +25 -30
- novelwriter/enum.py +8 -0
- novelwriter/error.py +16 -16
- novelwriter/extensions/configlayout.py +18 -18
- novelwriter/extensions/eventfilters.py +9 -5
- novelwriter/extensions/modified.py +34 -15
- novelwriter/extensions/novelselector.py +18 -5
- novelwriter/extensions/pagedsidebar.py +39 -49
- novelwriter/extensions/progressbars.py +10 -8
- novelwriter/extensions/statusled.py +6 -13
- novelwriter/extensions/switch.py +19 -30
- novelwriter/extensions/switchbox.py +7 -3
- novelwriter/extensions/versioninfo.py +4 -4
- novelwriter/formats/shared.py +1 -1
- novelwriter/formats/todocx.py +14 -10
- novelwriter/formats/tohtml.py +7 -5
- novelwriter/formats/tokenizer.py +36 -33
- novelwriter/formats/tomarkdown.py +6 -2
- novelwriter/formats/toodt.py +27 -22
- novelwriter/formats/toqdoc.py +19 -14
- novelwriter/formats/toraw.py +6 -2
- novelwriter/gui/doceditor.py +216 -265
- novelwriter/gui/dochighlight.py +46 -45
- novelwriter/gui/docviewer.py +102 -104
- novelwriter/gui/docviewerpanel.py +47 -51
- novelwriter/gui/editordocument.py +8 -5
- novelwriter/gui/itemdetails.py +15 -18
- novelwriter/gui/mainmenu.py +147 -146
- novelwriter/gui/noveltree.py +239 -405
- novelwriter/gui/outline.py +137 -76
- novelwriter/gui/projtree.py +138 -132
- novelwriter/gui/search.py +33 -31
- novelwriter/gui/sidebar.py +13 -18
- novelwriter/gui/statusbar.py +13 -15
- novelwriter/gui/theme.py +533 -430
- novelwriter/guimain.py +27 -29
- novelwriter/shared.py +32 -23
- novelwriter/text/comments.py +70 -0
- novelwriter/text/patterns.py +4 -4
- novelwriter/tools/dictionaries.py +20 -29
- novelwriter/tools/lipsum.py +16 -17
- novelwriter/tools/manusbuild.py +39 -42
- novelwriter/tools/manuscript.py +113 -126
- novelwriter/tools/manussettings.py +78 -83
- novelwriter/tools/noveldetails.py +51 -64
- novelwriter/tools/welcome.py +56 -75
- novelwriter/tools/writingstats.py +44 -57
- novelwriter/types.py +5 -7
- {novelWriter-2.6.2.dist-info → novelwriter-2.7b1.dist-info}/METADATA +6 -6
- novelwriter-2.7b1.dist-info/RECORD +159 -0
- {novelWriter-2.6.2.dist-info → novelwriter-2.7b1.dist-info}/WHEEL +1 -1
- novelWriter-2.6.2.dist-info/RECORD +0 -363
- novelwriter/assets/icons/typicons_dark/README.md +0 -29
- novelwriter/assets/icons/typicons_dark/icons.conf +0 -134
- novelwriter/assets/icons/typicons_dark/mixed_copy.svg +0 -4
- novelwriter/assets/icons/typicons_dark/mixed_document-chapter.svg +0 -12
- novelwriter/assets/icons/typicons_dark/mixed_document-new.svg +0 -6
- novelwriter/assets/icons/typicons_dark/mixed_document-note.svg +0 -12
- novelwriter/assets/icons/typicons_dark/mixed_document-scene.svg +0 -12
- novelwriter/assets/icons/typicons_dark/mixed_document-section.svg +0 -12
- novelwriter/assets/icons/typicons_dark/mixed_document-title.svg +0 -12
- novelwriter/assets/icons/typicons_dark/mixed_edit.svg +0 -4
- novelwriter/assets/icons/typicons_dark/mixed_import.svg +0 -5
- novelwriter/assets/icons/typicons_dark/mixed_input-checked.svg +0 -5
- novelwriter/assets/icons/typicons_dark/mixed_input-none.svg +0 -5
- novelwriter/assets/icons/typicons_dark/mixed_input-unchecked.svg +0 -5
- novelwriter/assets/icons/typicons_dark/mixed_margin-bottom.svg +0 -6
- novelwriter/assets/icons/typicons_dark/mixed_margin-left.svg +0 -6
- novelwriter/assets/icons/typicons_dark/mixed_margin-right.svg +0 -6
- novelwriter/assets/icons/typicons_dark/mixed_margin-top.svg +0 -6
- novelwriter/assets/icons/typicons_dark/mixed_search-replace.svg +0 -6
- novelwriter/assets/icons/typicons_dark/mixed_size-height.svg +0 -6
- novelwriter/assets/icons/typicons_dark/mixed_size-width.svg +0 -6
- novelwriter/assets/icons/typicons_dark/nw_deco-h0.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_deco-h1.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_deco-h2-narrow.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_deco-h2.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_deco-h3-narrow.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_deco-h3.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_deco-h4-narrow.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_deco-h4.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_deco-note.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_deco-noveltree-more.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_font.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_panel.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_quote.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_search-case.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_search-preserve.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_search-regex.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_search-word.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_tb-bold-md.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_tb-bold.svg +0 -6
- novelwriter/assets/icons/typicons_dark/nw_tb-italic-md.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_tb-italic.svg +0 -6
- novelwriter/assets/icons/typicons_dark/nw_tb-mark.svg +0 -7
- novelwriter/assets/icons/typicons_dark/nw_tb-strike-md.svg +0 -4
- novelwriter/assets/icons/typicons_dark/nw_tb-strike.svg +0 -6
- novelwriter/assets/icons/typicons_dark/nw_tb-subscript.svg +0 -7
- novelwriter/assets/icons/typicons_dark/nw_tb-superscript.svg +0 -7
- novelwriter/assets/icons/typicons_dark/nw_tb-underline.svg +0 -7
- novelwriter/assets/icons/typicons_dark/nw_toolbar.svg +0 -5
- novelwriter/assets/icons/typicons_dark/typ_arrow-down-thick-grey.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_arrow-forward.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_arrow-maximise.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_arrow-minimise.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_arrow-repeat-grey.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_book-grey.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_book.svg +0 -6
- novelwriter/assets/icons/typicons_dark/typ_bookmark.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_calendar.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_cancel-grey.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_cancel.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_chart-bar-grey.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_chevron-down.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_chevron-left.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_chevron-right.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_chevron-up.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_cog.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_delete-full.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_delete.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_directions-full.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_document-add.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_document-text.svg +0 -8
- novelwriter/assets/icons/typicons_dark/typ_document.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_export-grey.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_export.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_eye.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_flag.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_folder-open.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_folder.svg +0 -5
- novelwriter/assets/icons/typicons_dark/typ_globe-grey.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_key.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_lightbulb-full.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_location.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_media-pause-grey.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_media-record-outline.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_media-record.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_minus.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_pencil.svg +0 -5
- novelwriter/assets/icons/typicons_dark/typ_pin-outline.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_pin.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_plus.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_puzzle-outline.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_puzzle.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_refresh-flipped.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_refresh.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_search-grey.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_search.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_star.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_stopwatch-grey.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_th-dot-menu.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_th-dot-more.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_th-list-grey.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_th-list.svg +0 -9
- novelwriter/assets/icons/typicons_dark/typ_times.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_trash.svg +0 -5
- novelwriter/assets/icons/typicons_dark/typ_unfold-hidden.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_unfold-visible.svg +0 -4
- novelwriter/assets/icons/typicons_dark/typ_user.svg +0 -5
- novelwriter/assets/icons/typicons_dark/typ_warning-full.svg +0 -4
- novelwriter/assets/icons/typicons_light/README.md +0 -29
- novelwriter/assets/icons/typicons_light/icons.conf +0 -134
- novelwriter/assets/icons/typicons_light/mixed_copy.svg +0 -4
- novelwriter/assets/icons/typicons_light/mixed_document-chapter.svg +0 -12
- novelwriter/assets/icons/typicons_light/mixed_document-new.svg +0 -6
- novelwriter/assets/icons/typicons_light/mixed_document-note.svg +0 -12
- novelwriter/assets/icons/typicons_light/mixed_document-scene.svg +0 -12
- novelwriter/assets/icons/typicons_light/mixed_document-section.svg +0 -12
- novelwriter/assets/icons/typicons_light/mixed_document-title.svg +0 -12
- novelwriter/assets/icons/typicons_light/mixed_edit.svg +0 -4
- novelwriter/assets/icons/typicons_light/mixed_import.svg +0 -5
- novelwriter/assets/icons/typicons_light/mixed_input-checked.svg +0 -5
- novelwriter/assets/icons/typicons_light/mixed_input-none.svg +0 -5
- novelwriter/assets/icons/typicons_light/mixed_input-unchecked.svg +0 -5
- novelwriter/assets/icons/typicons_light/mixed_margin-bottom.svg +0 -6
- novelwriter/assets/icons/typicons_light/mixed_margin-left.svg +0 -6
- novelwriter/assets/icons/typicons_light/mixed_margin-right.svg +0 -6
- novelwriter/assets/icons/typicons_light/mixed_margin-top.svg +0 -6
- novelwriter/assets/icons/typicons_light/mixed_search-replace.svg +0 -6
- novelwriter/assets/icons/typicons_light/mixed_size-height.svg +0 -6
- novelwriter/assets/icons/typicons_light/mixed_size-width.svg +0 -6
- novelwriter/assets/icons/typicons_light/nw_deco-h0.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_deco-h1.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_deco-h2-narrow.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_deco-h2.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_deco-h3-narrow.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_deco-h3.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_deco-h4-narrow.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_deco-h4.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_deco-note.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_deco-noveltree-more.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_font.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_panel.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_quote.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_search-case.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_search-preserve.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_search-regex.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_search-word.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_tb-bold-md.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_tb-bold.svg +0 -6
- novelwriter/assets/icons/typicons_light/nw_tb-italic-md.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_tb-italic.svg +0 -6
- novelwriter/assets/icons/typicons_light/nw_tb-mark.svg +0 -7
- novelwriter/assets/icons/typicons_light/nw_tb-strike-md.svg +0 -4
- novelwriter/assets/icons/typicons_light/nw_tb-strike.svg +0 -6
- novelwriter/assets/icons/typicons_light/nw_tb-subscript.svg +0 -7
- novelwriter/assets/icons/typicons_light/nw_tb-superscript.svg +0 -7
- novelwriter/assets/icons/typicons_light/nw_tb-underline.svg +0 -7
- novelwriter/assets/icons/typicons_light/nw_toolbar.svg +0 -5
- novelwriter/assets/icons/typicons_light/typ_arrow-down-thick-grey.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_arrow-forward.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_arrow-maximise.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_arrow-minimise.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_arrow-repeat-grey.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_book-grey.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_book.svg +0 -6
- novelwriter/assets/icons/typicons_light/typ_bookmark.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_calendar.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_cancel-grey.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_cancel.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_chart-bar-grey.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_chevron-down.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_chevron-left.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_chevron-right.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_chevron-up.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_cog.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_delete-full.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_delete.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_directions-full.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_document-add.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_document-text.svg +0 -5
- novelwriter/assets/icons/typicons_light/typ_document.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_export-grey.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_export.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_eye.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_flag.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_folder-open.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_folder.svg +0 -5
- novelwriter/assets/icons/typicons_light/typ_globe-grey.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_key.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_lightbulb-full.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_location.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_media-pause-grey.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_media-record-outline.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_media-record.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_minus.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_pencil.svg +0 -5
- novelwriter/assets/icons/typicons_light/typ_pin-outline.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_pin.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_plus.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_puzzle-outline.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_puzzle.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_refresh-flipped.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_refresh.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_search-grey.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_search.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_star.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_stopwatch-grey.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_th-dot-menu.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_th-dot-more.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_th-list-grey.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_th-list.svg +0 -9
- novelwriter/assets/icons/typicons_light/typ_times.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_trash.svg +0 -5
- novelwriter/assets/icons/typicons_light/typ_unfold-hidden.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_unfold-visible.svg +0 -4
- novelwriter/assets/icons/typicons_light/typ_user.svg +0 -5
- novelwriter/assets/icons/typicons_light/typ_warning-full.svg +0 -4
- {novelWriter-2.6.2.dist-info → novelwriter-2.7b1.dist-info}/entry_points.txt +0 -0
- {novelWriter-2.6.2.dist-info → novelwriter-2.7b1.dist-info/licenses}/LICENSE.md +0 -0
- {novelWriter-2.6.2.dist-info → novelwriter-2.7b1.dist-info}/top_level.txt +0 -0
@@ -26,24 +26,28 @@ from __future__ import annotations
|
|
26
26
|
import logging
|
27
27
|
import math
|
28
28
|
|
29
|
-
from
|
30
|
-
|
31
|
-
from
|
29
|
+
from typing import TYPE_CHECKING
|
30
|
+
|
31
|
+
from PyQt6.QtCore import pyqtSlot
|
32
|
+
from PyQt6.QtWidgets import (
|
32
33
|
QAbstractItemView, QDialogButtonBox, QFormLayout, QGridLayout, QHBoxLayout,
|
33
34
|
QLabel, QSpinBox, QStackedWidget, QTreeWidget, QTreeWidgetItem,
|
34
35
|
QVBoxLayout, QWidget
|
35
36
|
)
|
36
37
|
|
37
|
-
from novelwriter import
|
38
|
+
from novelwriter import SHARED
|
38
39
|
from novelwriter.common import formatTime, numberToRoman
|
39
40
|
from novelwriter.constants import nwUnicode
|
40
|
-
from novelwriter.extensions.configlayout import
|
41
|
+
from novelwriter.extensions.configlayout import NColorLabel, NFixedPage, NScrollablePage
|
41
42
|
from novelwriter.extensions.modified import NNonBlockingDialog
|
42
43
|
from novelwriter.extensions.novelselector import NovelSelector
|
43
44
|
from novelwriter.extensions.pagedsidebar import NPagedSideBar
|
44
45
|
from novelwriter.extensions.switch import NSwitch
|
45
46
|
from novelwriter.types import QtAlignRight, QtDecoration, QtDialogClose
|
46
47
|
|
48
|
+
if TYPE_CHECKING:
|
49
|
+
from PyQt6.QtGui import QCloseEvent
|
50
|
+
|
47
51
|
logger = logging.getLogger(__name__)
|
48
52
|
|
49
53
|
|
@@ -60,16 +64,16 @@ class GuiNovelDetails(NNonBlockingDialog):
|
|
60
64
|
self.setWindowTitle(self.tr("Novel Details"))
|
61
65
|
|
62
66
|
options = SHARED.project.options
|
63
|
-
self.setMinimumSize(
|
67
|
+
self.setMinimumSize(500, 400)
|
64
68
|
self.resize(
|
65
|
-
|
66
|
-
|
69
|
+
options.getInt("GuiNovelDetails", "winWidth", 650),
|
70
|
+
options.getInt("GuiNovelDetails", "winHeight", 500),
|
67
71
|
)
|
68
72
|
|
69
73
|
# Title
|
70
|
-
self.titleLabel =
|
74
|
+
self.titleLabel = NColorLabel(
|
71
75
|
self.tr("Novel Details"), self, color=SHARED.theme.helpText,
|
72
|
-
scale=
|
76
|
+
scale=NColorLabel.HEADER_SCALE, indent=4,
|
73
77
|
)
|
74
78
|
|
75
79
|
# Novel Selector
|
@@ -114,7 +118,7 @@ class GuiNovelDetails(NNonBlockingDialog):
|
|
114
118
|
self.outerBox.addLayout(self.topBox)
|
115
119
|
self.outerBox.addLayout(self.mainBox)
|
116
120
|
self.outerBox.addWidget(self.buttonBox)
|
117
|
-
self.outerBox.setSpacing(
|
121
|
+
self.outerBox.setSpacing(8)
|
118
122
|
|
119
123
|
self.setLayout(self.outerBox)
|
120
124
|
self.setSizeGripEnabled(True)
|
@@ -137,9 +141,10 @@ class GuiNovelDetails(NNonBlockingDialog):
|
|
137
141
|
|
138
142
|
def updateValues(self) -> None:
|
139
143
|
"""Load the dialogs initial values."""
|
140
|
-
self.
|
141
|
-
|
142
|
-
|
144
|
+
if handle := self.novelSelector.handle:
|
145
|
+
self.overviewPage.updateProjectData()
|
146
|
+
self.overviewPage.novelValueChanged(handle)
|
147
|
+
self.contentsPage.novelValueChanged(handle)
|
143
148
|
return
|
144
149
|
|
145
150
|
##
|
@@ -172,18 +177,13 @@ class GuiNovelDetails(NNonBlockingDialog):
|
|
172
177
|
|
173
178
|
def _saveSettings(self) -> None:
|
174
179
|
"""Save the user GUI settings."""
|
175
|
-
winWidth = CONFIG.rpxInt(self.width())
|
176
|
-
winHeight = CONFIG.rpxInt(self.height())
|
177
|
-
novelRoot = self.novelSelector.handle
|
178
|
-
|
179
180
|
logger.debug("Saving State: GuiNovelDetails")
|
181
|
+
novelRoot = self.novelSelector.handle
|
180
182
|
options = SHARED.project.options
|
181
|
-
options.setValue("GuiNovelDetails", "winWidth",
|
182
|
-
options.setValue("GuiNovelDetails", "winHeight",
|
183
|
+
options.setValue("GuiNovelDetails", "winWidth", self.width())
|
184
|
+
options.setValue("GuiNovelDetails", "winHeight", self.height())
|
183
185
|
options.setValue("GuiNovelDetails", "novelRoot", novelRoot)
|
184
|
-
|
185
186
|
self.contentsPage.saveSettings()
|
186
|
-
|
187
187
|
return
|
188
188
|
|
189
189
|
|
@@ -192,15 +192,10 @@ class _OverviewPage(NScrollablePage):
|
|
192
192
|
def __init__(self, parent: QWidget) -> None:
|
193
193
|
super().__init__(parent=parent)
|
194
194
|
|
195
|
-
mPx = CONFIG.pxInt(8)
|
196
|
-
sPx = CONFIG.pxInt(16)
|
197
|
-
hPx = CONFIG.pxInt(24)
|
198
|
-
vPx = CONFIG.pxInt(4)
|
199
|
-
|
200
195
|
# Project Info
|
201
|
-
self.projLabel =
|
196
|
+
self.projLabel = NColorLabel(
|
202
197
|
self.tr("Project"), self, color=SHARED.theme.helpText,
|
203
|
-
scale=
|
198
|
+
scale=NColorLabel.HEADER_SCALE
|
204
199
|
)
|
205
200
|
|
206
201
|
self.projName = QLabel("", self)
|
@@ -217,14 +212,14 @@ class _OverviewPage(NScrollablePage):
|
|
217
212
|
self.projForm.addRow("<b>{0}</b>".format(self.tr("Word Count")), self.projWords)
|
218
213
|
self.projForm.addRow("<b>\u2026 {0}</b>".format(self.tr("In Novels")), self.projNovels)
|
219
214
|
self.projForm.addRow("<b>\u2026 {0}</b>".format(self.tr("In Notes")), self.projNotes)
|
220
|
-
self.projForm.setContentsMargins(
|
221
|
-
self.projForm.setHorizontalSpacing(
|
222
|
-
self.projForm.setVerticalSpacing(
|
215
|
+
self.projForm.setContentsMargins(8, 0, 0, 0)
|
216
|
+
self.projForm.setHorizontalSpacing(24)
|
217
|
+
self.projForm.setVerticalSpacing(4)
|
223
218
|
|
224
219
|
# Novel Info
|
225
|
-
self.novelLabel =
|
220
|
+
self.novelLabel = NColorLabel(
|
226
221
|
self.tr("Selected Novel"), self, color=SHARED.theme.helpText,
|
227
|
-
scale=
|
222
|
+
scale=NColorLabel.HEADER_SCALE
|
228
223
|
)
|
229
224
|
|
230
225
|
self.novelName = QLabel("", self)
|
@@ -237,9 +232,9 @@ class _OverviewPage(NScrollablePage):
|
|
237
232
|
self.novelForm.addRow("<b>{0}</b>".format(self.tr("Word Count")), self.novelWords)
|
238
233
|
self.novelForm.addRow("<b>{0}</b>".format(self.tr("Chapters")), self.novelChapters)
|
239
234
|
self.novelForm.addRow("<b>{0}</b>".format(self.tr("Scenes")), self.novelScenes)
|
240
|
-
self.novelForm.setContentsMargins(
|
241
|
-
self.novelForm.setHorizontalSpacing(
|
242
|
-
self.novelForm.setVerticalSpacing(
|
235
|
+
self.novelForm.setContentsMargins(8, 0, 0, 0)
|
236
|
+
self.novelForm.setHorizontalSpacing(24)
|
237
|
+
self.novelForm.setVerticalSpacing(4)
|
243
238
|
|
244
239
|
# Assemble
|
245
240
|
self.outerBox = QVBoxLayout()
|
@@ -247,7 +242,7 @@ class _OverviewPage(NScrollablePage):
|
|
247
242
|
self.outerBox.addLayout(self.projForm)
|
248
243
|
self.outerBox.addWidget(self.novelLabel)
|
249
244
|
self.outerBox.addLayout(self.novelForm)
|
250
|
-
self.outerBox.setSpacing(
|
245
|
+
self.outerBox.setSpacing(16)
|
251
246
|
self.outerBox.addStretch(1)
|
252
247
|
|
253
248
|
self.setCentralLayout(self.outerBox)
|
@@ -309,14 +304,12 @@ class _ContentsPage(NFixedPage):
|
|
309
304
|
|
310
305
|
iPx = SHARED.theme.baseIconHeight
|
311
306
|
iSz = SHARED.theme.baseIconSize
|
312
|
-
hPx = CONFIG.pxInt(12)
|
313
|
-
vPx = CONFIG.pxInt(4)
|
314
307
|
options = SHARED.project.options
|
315
308
|
|
316
309
|
# Title
|
317
|
-
self.contentLabel =
|
310
|
+
self.contentLabel = NColorLabel(
|
318
311
|
self.tr("Table of Contents"), self, color=SHARED.theme.helpText,
|
319
|
-
scale=
|
312
|
+
scale=NColorLabel.HEADER_SCALE
|
320
313
|
)
|
321
314
|
|
322
315
|
# Contents Tree
|
@@ -341,22 +334,22 @@ class _ContentsPage(NFixedPage):
|
|
341
334
|
treeHeadItem.setTextAlignment(self.C_PAGE, QtAlignRight)
|
342
335
|
treeHeadItem.setTextAlignment(self.C_PROG, QtAlignRight)
|
343
336
|
|
344
|
-
|
345
|
-
|
346
|
-
|
337
|
+
if header := self.tocTree.header():
|
338
|
+
header.setStretchLastSection(True)
|
339
|
+
header.setMinimumSectionSize(12)
|
347
340
|
|
348
|
-
wCol0 =
|
349
|
-
wCol1 =
|
350
|
-
wCol2 =
|
351
|
-
wCol3 =
|
352
|
-
wCol4 =
|
341
|
+
wCol0 = options.getInt("GuiNovelDetails", "widthCol0", 200)
|
342
|
+
wCol1 = options.getInt("GuiNovelDetails", "widthCol1", 60)
|
343
|
+
wCol2 = options.getInt("GuiNovelDetails", "widthCol2", 60)
|
344
|
+
wCol3 = options.getInt("GuiNovelDetails", "widthCol3", 60)
|
345
|
+
wCol4 = options.getInt("GuiNovelDetails", "widthCol4", 90)
|
353
346
|
|
354
347
|
self.tocTree.setColumnWidth(0, wCol0)
|
355
348
|
self.tocTree.setColumnWidth(1, wCol1)
|
356
349
|
self.tocTree.setColumnWidth(2, wCol2)
|
357
350
|
self.tocTree.setColumnWidth(3, wCol3)
|
358
351
|
self.tocTree.setColumnWidth(4, wCol4)
|
359
|
-
self.tocTree.setColumnWidth(5,
|
352
|
+
self.tocTree.setColumnWidth(5, 12)
|
360
353
|
|
361
354
|
# Options
|
362
355
|
wordsPerPage = options.getInt("GuiNovelDetails", "wordsPerPage", 350)
|
@@ -394,8 +387,8 @@ class _ContentsPage(NFixedPage):
|
|
394
387
|
self.optionsBox.addWidget(self.dblValue, 0, 4)
|
395
388
|
self.optionsBox.addWidget(self.poLabel, 1, 0)
|
396
389
|
self.optionsBox.addWidget(self.poValue, 1, 1)
|
397
|
-
self.optionsBox.setHorizontalSpacing(
|
398
|
-
self.optionsBox.setVerticalSpacing(
|
390
|
+
self.optionsBox.setHorizontalSpacing(12)
|
391
|
+
self.optionsBox.setVerticalSpacing(4)
|
399
392
|
self.optionsBox.setColumnStretch(2, 1)
|
400
393
|
|
401
394
|
# Assemble
|
@@ -410,18 +403,12 @@ class _ContentsPage(NFixedPage):
|
|
410
403
|
|
411
404
|
def saveSettings(self) -> None:
|
412
405
|
"""Save the user GUI settings."""
|
413
|
-
widthCol0 = CONFIG.rpxInt(self.tocTree.columnWidth(0))
|
414
|
-
widthCol1 = CONFIG.rpxInt(self.tocTree.columnWidth(1))
|
415
|
-
widthCol2 = CONFIG.rpxInt(self.tocTree.columnWidth(2))
|
416
|
-
widthCol3 = CONFIG.rpxInt(self.tocTree.columnWidth(3))
|
417
|
-
widthCol4 = CONFIG.rpxInt(self.tocTree.columnWidth(4))
|
418
|
-
|
419
406
|
options = SHARED.project.options
|
420
|
-
options.setValue("GuiNovelDetails", "widthCol0",
|
421
|
-
options.setValue("GuiNovelDetails", "widthCol1",
|
422
|
-
options.setValue("GuiNovelDetails", "widthCol2",
|
423
|
-
options.setValue("GuiNovelDetails", "widthCol3",
|
424
|
-
options.setValue("GuiNovelDetails", "widthCol4",
|
407
|
+
options.setValue("GuiNovelDetails", "widthCol0", self.tocTree.columnWidth(0))
|
408
|
+
options.setValue("GuiNovelDetails", "widthCol1", self.tocTree.columnWidth(1))
|
409
|
+
options.setValue("GuiNovelDetails", "widthCol2", self.tocTree.columnWidth(2))
|
410
|
+
options.setValue("GuiNovelDetails", "widthCol3", self.tocTree.columnWidth(3))
|
411
|
+
options.setValue("GuiNovelDetails", "widthCol4", self.tocTree.columnWidth(4))
|
425
412
|
options.setValue("GuiNovelDetails", "wordsPerPage", self.wpValue.value())
|
426
413
|
options.setValue("GuiNovelDetails", "countFrom", self.poValue.value())
|
427
414
|
options.setValue("GuiNovelDetails", "clearDouble", self.dblValue.isChecked())
|
novelwriter/tools/welcome.py
CHANGED
@@ -28,20 +28,19 @@ import logging
|
|
28
28
|
from datetime import datetime
|
29
29
|
from pathlib import Path
|
30
30
|
|
31
|
-
from
|
32
|
-
QAbstractListModel,
|
33
|
-
|
31
|
+
from PyQt6.QtCore import (
|
32
|
+
QAbstractListModel, QModelIndex, QObject, QPoint, QSize, Qt, pyqtSignal,
|
33
|
+
pyqtSlot
|
34
34
|
)
|
35
|
-
from
|
36
|
-
from
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
QWidget
|
35
|
+
from PyQt6.QtGui import QAction, QCloseEvent, QColor, QFont, QPainter, QPaintEvent, QPen, QShortcut
|
36
|
+
from PyQt6.QtWidgets import (
|
37
|
+
QApplication, QFileDialog, QFormLayout, QHBoxLayout, QLabel, QLineEdit,
|
38
|
+
QListView, QMenu, QPushButton, QScrollArea, QStackedWidget,
|
39
|
+
QStyledItemDelegate, QStyleOptionViewItem, QVBoxLayout, QWidget
|
41
40
|
)
|
42
41
|
|
43
42
|
from novelwriter import CONFIG, SHARED
|
44
|
-
from novelwriter.common import
|
43
|
+
from novelwriter.common import formatInt, makeFileNameSafe, qtAddAction, qtLambda
|
45
44
|
from novelwriter.constants import nwFiles
|
46
45
|
from novelwriter.core.coretools import ProjectBuilder
|
47
46
|
from novelwriter.enum import nwItemClass
|
@@ -49,7 +48,7 @@ from novelwriter.extensions.configlayout import NWrappedWidgetBox
|
|
49
48
|
from novelwriter.extensions.modified import NDialog, NIconToolButton, NSpinBox
|
50
49
|
from novelwriter.extensions.switch import NSwitch
|
51
50
|
from novelwriter.extensions.versioninfo import VersionInfoWidget
|
52
|
-
from novelwriter.types import QtAlignLeft, QtAlignRightTop, QtScrollAsNeeded, QtSelected
|
51
|
+
from novelwriter.types import QtAlignLeft, QtAlignRightTop, QtHexArgb, QtScrollAsNeeded, QtSelected
|
53
52
|
|
54
53
|
logger = logging.getLogger(__name__)
|
55
54
|
|
@@ -67,29 +66,21 @@ class GuiWelcome(NDialog):
|
|
67
66
|
self.setObjectName("GuiWelcome")
|
68
67
|
|
69
68
|
self.setWindowTitle(self.tr("Welcome"))
|
70
|
-
self.setMinimumWidth(
|
71
|
-
self.setMinimumHeight(
|
72
|
-
|
73
|
-
hA = CONFIG.pxInt(8)
|
74
|
-
hB = CONFIG.pxInt(16)
|
75
|
-
hC = CONFIG.pxInt(24)
|
76
|
-
hD = CONFIG.pxInt(36)
|
77
|
-
hE = CONFIG.pxInt(48)
|
78
|
-
hF = CONFIG.pxInt(128)
|
79
|
-
btnIconSize = SHARED.theme.buttonIconSize
|
80
|
-
|
81
|
-
self._hPx = CONFIG.pxInt(600)
|
69
|
+
self.setMinimumWidth(650)
|
70
|
+
self.setMinimumHeight(450)
|
82
71
|
self.resize(*CONFIG.welcomeWinSize)
|
83
72
|
|
73
|
+
btnIconSize = SHARED.theme.buttonIconSize
|
74
|
+
|
84
75
|
# Elements
|
85
76
|
# ========
|
86
77
|
|
87
|
-
self.bgImage = SHARED.theme.
|
88
|
-
self.nwImage = SHARED.theme.
|
89
|
-
self.bgColor = QColor(
|
78
|
+
self.bgImage = SHARED.theme.getDecoration("welcome")
|
79
|
+
self.nwImage = SHARED.theme.getDecoration("nw-text", h=36)
|
80
|
+
self.bgColor = QColor(54, 54, 54) if SHARED.theme.isDarkTheme else QColor(255, 255, 255)
|
90
81
|
|
91
82
|
self.nwLogo = QLabel(self)
|
92
|
-
self.nwLogo.setPixmap(SHARED.theme.getPixmap("novelwriter", (
|
83
|
+
self.nwLogo.setPixmap(SHARED.theme.getPixmap("novelwriter", (128, 128)))
|
93
84
|
|
94
85
|
self.nwLabel = QLabel(self)
|
95
86
|
self.nwLabel.setPixmap(self.nwImage)
|
@@ -110,32 +101,32 @@ class GuiWelcome(NDialog):
|
|
110
101
|
# =======
|
111
102
|
|
112
103
|
self.btnList = QPushButton(self.tr("List"), self)
|
113
|
-
self.btnList.setIcon(SHARED.theme.getIcon("list"))
|
104
|
+
self.btnList.setIcon(SHARED.theme.getIcon("list", "blue"))
|
114
105
|
self.btnList.setIconSize(btnIconSize)
|
115
106
|
self.btnList.clicked.connect(self._showOpenProjectPage)
|
116
107
|
|
117
108
|
self.btnNew = QPushButton(self.tr("New"), self)
|
118
|
-
self.btnNew.setIcon(SHARED.theme.getIcon("add"))
|
109
|
+
self.btnNew.setIcon(SHARED.theme.getIcon("add", "green"))
|
119
110
|
self.btnNew.setIconSize(btnIconSize)
|
120
111
|
self.btnNew.clicked.connect(self._showNewProjectPage)
|
121
112
|
|
122
113
|
self.btnBrowse = QPushButton(self.tr("Browse"), self)
|
123
|
-
self.btnBrowse.setIcon(SHARED.theme.getIcon("browse"))
|
114
|
+
self.btnBrowse.setIcon(SHARED.theme.getIcon("browse", "yellow"))
|
124
115
|
self.btnBrowse.setIconSize(btnIconSize)
|
125
116
|
self.btnBrowse.clicked.connect(self._browseForProject)
|
126
117
|
|
127
118
|
self.btnCancel = QPushButton(self.tr("Cancel"), self)
|
128
|
-
self.btnCancel.setIcon(SHARED.theme.getIcon("
|
119
|
+
self.btnCancel.setIcon(SHARED.theme.getIcon("cancel", "red"))
|
129
120
|
self.btnCancel.setIconSize(btnIconSize)
|
130
|
-
self.btnCancel.clicked.connect(self.close)
|
121
|
+
self.btnCancel.clicked.connect(qtLambda(self.close))
|
131
122
|
|
132
123
|
self.btnCreate = QPushButton(self.tr("Create"), self)
|
133
|
-
self.btnCreate.setIcon(SHARED.theme.getIcon("star"))
|
124
|
+
self.btnCreate.setIcon(SHARED.theme.getIcon("star", "yellow"))
|
134
125
|
self.btnCreate.setIconSize(btnIconSize)
|
135
126
|
self.btnCreate.clicked.connect(self.tabNew.createNewProject)
|
136
127
|
|
137
128
|
self.btnOpen = QPushButton(self.tr("Open"), self)
|
138
|
-
self.btnOpen.setIcon(SHARED.theme.getIcon("open"))
|
129
|
+
self.btnOpen.setIcon(SHARED.theme.getIcon("open", "blue"))
|
139
130
|
self.btnOpen.setIconSize(btnIconSize)
|
140
131
|
self.btnOpen.clicked.connect(self._openSelectedItem)
|
141
132
|
|
@@ -153,18 +144,18 @@ class GuiWelcome(NDialog):
|
|
153
144
|
# ========
|
154
145
|
|
155
146
|
self.innerBox = QVBoxLayout()
|
156
|
-
self.innerBox.addSpacing(
|
147
|
+
self.innerBox.addSpacing(16)
|
157
148
|
self.innerBox.addWidget(self.nwLabel)
|
158
149
|
self.innerBox.addWidget(self.nwInfo)
|
159
|
-
self.innerBox.addSpacing(
|
150
|
+
self.innerBox.addSpacing(8)
|
160
151
|
self.innerBox.addWidget(self.mainStack)
|
161
|
-
self.innerBox.addSpacing(
|
152
|
+
self.innerBox.addSpacing(16)
|
162
153
|
self.innerBox.addLayout(self.btnBox)
|
163
154
|
|
164
155
|
self.outerBox = QHBoxLayout()
|
165
156
|
self.outerBox.addWidget(self.nwLogo, 3, QtAlignRightTop)
|
166
157
|
self.outerBox.addLayout(self.innerBox, 9)
|
167
|
-
self.outerBox.setContentsMargins(
|
158
|
+
self.outerBox.setContentsMargins(128, 48, 24, 48)
|
168
159
|
|
169
160
|
self.setLayout(self.outerBox)
|
170
161
|
self.setSizeGripEnabled(True)
|
@@ -184,7 +175,7 @@ class GuiWelcome(NDialog):
|
|
184
175
|
def paintEvent(self, event: QPaintEvent) -> None:
|
185
176
|
"""Overload the paint event to draw the background image."""
|
186
177
|
hWin = self.height()
|
187
|
-
hPix = min(hWin,
|
178
|
+
hPix = min(hWin, 600)
|
188
179
|
tMode = Qt.TransformationMode.SmoothTransformation
|
189
180
|
painter = QPainter(self)
|
190
181
|
painter.fillRect(self.rect(), self.bgColor)
|
@@ -289,7 +280,7 @@ class _OpenProjectPage(QWidget):
|
|
289
280
|
|
290
281
|
# Info / Tool
|
291
282
|
self.aMissing = QAction(self)
|
292
|
-
self.aMissing.setIcon(SHARED.theme.getIcon("alert_warn"))
|
283
|
+
self.aMissing.setIcon(SHARED.theme.getIcon("alert_warn", "orange"))
|
293
284
|
self.aMissing.setToolTip(self.tr("The project path is not reachable."))
|
294
285
|
|
295
286
|
self.selectedPath = QLineEdit(self)
|
@@ -310,11 +301,12 @@ class _OpenProjectPage(QWidget):
|
|
310
301
|
|
311
302
|
self._selectFirstItem()
|
312
303
|
|
313
|
-
|
314
|
-
|
304
|
+
base = self.palette().base().color()
|
305
|
+
base.setAlpha(PANEL_ALPHA)
|
306
|
+
baseCol = base.name(QtHexArgb)
|
315
307
|
self.setStyleSheet(
|
316
308
|
f"QListView {{border: none; background: {baseCol};}} "
|
317
|
-
f"QLineEdit {{border: none; background: {baseCol}; padding:
|
309
|
+
f"QLineEdit {{border: none; background: {baseCol}; padding: 4px;}} "
|
318
310
|
)
|
319
311
|
|
320
312
|
return
|
@@ -371,9 +363,9 @@ class _OpenProjectPage(QWidget):
|
|
371
363
|
"""Open the custom context menu."""
|
372
364
|
ctxMenu = QMenu(self)
|
373
365
|
ctxMenu.setObjectName("ContextMenu") # Used for testing
|
374
|
-
action = ctxMenu
|
366
|
+
action = qtAddAction(ctxMenu, self.tr("Open Project"))
|
375
367
|
action.triggered.connect(self.openSelectedItem)
|
376
|
-
action = ctxMenu
|
368
|
+
action = qtAddAction(ctxMenu, self.tr("Remove Project"))
|
377
369
|
action.triggered.connect(self._deleteSelectedItem)
|
378
370
|
ctxMenu.exec(self.mapToGlobal(pos))
|
379
371
|
ctxMenu.setParent(None)
|
@@ -393,7 +385,7 @@ class _OpenProjectPage(QWidget):
|
|
393
385
|
|
394
386
|
class _ProjectListItem(QStyledItemDelegate):
|
395
387
|
|
396
|
-
__slots__ = ("
|
388
|
+
__slots__ = ("_dFont", "_dPen", "_hPx", "_icon", "_pPx", "_tFont")
|
397
389
|
|
398
390
|
def __init__(self, parent: QWidget) -> None:
|
399
391
|
super().__init__(parent=parent)
|
@@ -401,11 +393,10 @@ class _ProjectListItem(QStyledItemDelegate):
|
|
401
393
|
fPx = SHARED.theme.fontPixelSize
|
402
394
|
fPt = SHARED.theme.fontPointSize
|
403
395
|
tPx = round(1.2 * fPx)
|
404
|
-
mPx = CONFIG.pxInt(4)
|
405
396
|
iPx = tPx + fPx
|
406
397
|
|
407
|
-
self._pPx = (
|
408
|
-
self._hPx =
|
398
|
+
self._pPx = (iPx + 4, tPx + 4) # Painter coordinates
|
399
|
+
self._hPx = 8 + tPx + fPx # Fixed height
|
409
400
|
|
410
401
|
self._tFont = QApplication.font()
|
411
402
|
self._tFont.setPointSizeF(1.2*fPt)
|
@@ -424,7 +415,7 @@ class _ProjectListItem(QStyledItemDelegate):
|
|
424
415
|
rect = opt.rect
|
425
416
|
title, _, details = index.data()
|
426
417
|
tFlag = Qt.TextFlag.TextSingleLine
|
427
|
-
|
418
|
+
x, y = self._pPx
|
428
419
|
|
429
420
|
painter.save()
|
430
421
|
if opt.state & QtSelected == QtSelected:
|
@@ -432,12 +423,12 @@ class _ProjectListItem(QStyledItemDelegate):
|
|
432
423
|
painter.fillRect(rect, QApplication.palette().highlight())
|
433
424
|
painter.setOpacity(1.0)
|
434
425
|
|
435
|
-
painter.drawPixmap(
|
426
|
+
painter.drawPixmap(2, rect.top() + 6, self._icon)
|
436
427
|
painter.setFont(self._tFont)
|
437
|
-
painter.drawText(rect.adjusted(x,
|
428
|
+
painter.drawText(rect.adjusted(x, 4, 0, 0), tFlag, title)
|
438
429
|
painter.setFont(self._dFont)
|
439
430
|
painter.setPen(self._dPen)
|
440
|
-
painter.drawText(rect.adjusted(x,
|
431
|
+
painter.drawText(rect.adjusted(x, y, 0, 0), tFlag, details)
|
441
432
|
painter.restore()
|
442
433
|
|
443
434
|
return
|
@@ -518,7 +509,9 @@ class _NewProjectPage(QWidget):
|
|
518
509
|
# Styles
|
519
510
|
# ======
|
520
511
|
|
521
|
-
|
512
|
+
base = self.palette().base().color()
|
513
|
+
base.setAlpha(PANEL_ALPHA)
|
514
|
+
baseCol = base.name(QtHexArgb)
|
522
515
|
self.setStyleSheet(
|
523
516
|
f"QScrollArea {{border: none; background: {baseCol};}} "
|
524
517
|
f"_NewProjectForm {{border: none; background: {baseCol};}} "
|
@@ -558,7 +551,6 @@ class _NewProjectForm(QWidget):
|
|
558
551
|
|
559
552
|
iPx = SHARED.theme.baseIconHeight
|
560
553
|
iSz = SHARED.theme.baseIconSize
|
561
|
-
sPx = CONFIG.pxInt(16)
|
562
554
|
|
563
555
|
# Project Settings
|
564
556
|
# ================
|
@@ -589,20 +581,20 @@ class _NewProjectForm(QWidget):
|
|
589
581
|
self.projFill = QLineEdit(self)
|
590
582
|
self.projFill.setReadOnly(True)
|
591
583
|
|
592
|
-
self.browseFill = NIconToolButton(self, iSz, "
|
584
|
+
self.browseFill = NIconToolButton(self, iSz, "document_add", "blue")
|
593
585
|
|
594
|
-
self.fillMenu =
|
586
|
+
self.fillMenu = QMenu(self.browseFill)
|
595
587
|
|
596
|
-
self.fillBlank = self.fillMenu
|
588
|
+
self.fillBlank = qtAddAction(self.fillMenu, self.tr("Create a fresh project"))
|
597
589
|
self.fillBlank.setIcon(SHARED.theme.getIcon("document"))
|
598
590
|
self.fillBlank.triggered.connect(self._setFillBlank)
|
599
591
|
|
600
|
-
self.fillSample = self.fillMenu
|
601
|
-
self.fillSample.setIcon(SHARED.theme.getIcon("
|
592
|
+
self.fillSample = qtAddAction(self.fillMenu, self.tr("Create an example project"))
|
593
|
+
self.fillSample.setIcon(SHARED.theme.getIcon("document_add", "blue"))
|
602
594
|
self.fillSample.triggered.connect(self._setFillSample)
|
603
595
|
|
604
|
-
self.fillCopy = self.fillMenu
|
605
|
-
self.fillCopy.setIcon(SHARED.theme.getIcon("
|
596
|
+
self.fillCopy = qtAddAction(self.fillMenu, self.tr("Copy an existing project"))
|
597
|
+
self.fillCopy.setIcon(SHARED.theme.getIcon("project_copy", "green"))
|
606
598
|
self.fillCopy.triggered.connect(self._setFillCopy)
|
607
599
|
|
608
600
|
self.browseFill.setMenu(self.fillMenu)
|
@@ -676,7 +668,7 @@ class _NewProjectForm(QWidget):
|
|
676
668
|
self.extraBox = QVBoxLayout()
|
677
669
|
self.extraBox.addWidget(QLabel("<b>{0}</b>".format(self.tr("Chapters and Scenes")), self))
|
678
670
|
self.extraBox.addLayout(self.novelForm)
|
679
|
-
self.extraBox.addSpacing(
|
671
|
+
self.extraBox.addSpacing(16)
|
680
672
|
self.extraBox.addWidget(QLabel("<b>{0}</b>".format(self.tr("Project Notes")), self))
|
681
673
|
self.extraBox.addLayout(self.notesForm)
|
682
674
|
self.extraBox.setContentsMargins(0, 0, 0, 0)
|
@@ -688,7 +680,7 @@ class _NewProjectForm(QWidget):
|
|
688
680
|
self.formBox = QVBoxLayout()
|
689
681
|
self.formBox.addWidget(QLabel("<b>{0}</b>".format(self.tr("Create New Project")), self))
|
690
682
|
self.formBox.addLayout(self.projectForm)
|
691
|
-
self.formBox.addSpacing(
|
683
|
+
self.formBox.addSpacing(16)
|
692
684
|
self.formBox.addWidget(self.extraWidget)
|
693
685
|
self.formBox.addStretch(1)
|
694
686
|
|
@@ -803,14 +795,3 @@ class _NewProjectForm(QWidget):
|
|
803
795
|
self.extraWidget.setVisible(self._fillMode == self.FILL_BLANK)
|
804
796
|
|
805
797
|
return
|
806
|
-
|
807
|
-
|
808
|
-
class _PopLeftDirectionMenu(QMenu):
|
809
|
-
|
810
|
-
def event(self, event: QEvent) -> bool:
|
811
|
-
"""Overload the show event and move the menu popup location."""
|
812
|
-
if event.type() == QEvent.Type.Show:
|
813
|
-
if isinstance(parent := self.parent(), QWidget):
|
814
|
-
offset = QPoint(parent.width() - self.width(), parent.height())
|
815
|
-
self.move(parent.mapToGlobal(offset))
|
816
|
-
return super(_PopLeftDirectionMenu, self).event(event)
|