novelWriter 2.7.5__py3-none-any.whl → 2.8b1__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 +8 -7
 - novelwriter/assets/icons/font_awesome.icons +22 -4
 - novelwriter/assets/icons/material_filled_normal.icons +20 -2
 - novelwriter/assets/icons/material_filled_thin.icons +20 -2
 - novelwriter/assets/icons/material_rounded_normal.icons +20 -2
 - novelwriter/assets/icons/material_rounded_thin.icons +20 -2
 - novelwriter/assets/icons/material_sharp_normal.icons +20 -2
 - novelwriter/assets/icons/material_sharp_thin.icons +20 -2
 - novelwriter/assets/icons/remix_filled.icons +20 -2
 - novelwriter/assets/icons/remix_outline.icons +20 -2
 - novelwriter/assets/images/welcome.webp +0 -0
 - novelwriter/assets/manual.pdf +0 -0
 - novelwriter/assets/manual_fr.pdf +0 -0
 - novelwriter/assets/sample.zip +0 -0
 - novelwriter/assets/text/credits_en.htm +61 -11
 - novelwriter/assets/themes/aura.conf +97 -0
 - novelwriter/assets/themes/aura_bright.conf +95 -0
 - novelwriter/assets/themes/aura_soft.conf +97 -0
 - novelwriter/assets/themes/b2t_garden_dark.conf +97 -0
 - novelwriter/assets/themes/b2t_garden_light.conf +97 -0
 - novelwriter/assets/themes/b2t_suburb_dark.conf +97 -0
 - novelwriter/assets/themes/b2t_suburb_light.conf +97 -0
 - novelwriter/assets/themes/b4t_classic_o_dark.conf +97 -0
 - novelwriter/assets/themes/b4t_classic_o_light.conf +97 -0
 - novelwriter/assets/themes/b4t_modern_c_dark.conf +97 -0
 - novelwriter/assets/themes/b4t_modern_c_light.conf +97 -0
 - novelwriter/assets/themes/blue_streak_dark.conf +97 -0
 - novelwriter/assets/themes/blue_streak_light.conf +97 -0
 - novelwriter/assets/themes/castle_day.conf +95 -0
 - novelwriter/assets/themes/castle_night.conf +95 -0
 - novelwriter/assets/themes/catppuccin_latte.conf +97 -0
 - novelwriter/assets/themes/catppuccin_mocha.conf +97 -0
 - novelwriter/assets/themes/chalky_soil.conf +95 -0
 - novelwriter/assets/themes/chernozem.conf +95 -0
 - novelwriter/assets/themes/cyberpunk_night.conf +88 -40
 - novelwriter/assets/themes/default_dark.conf +89 -41
 - novelwriter/assets/themes/default_light.conf +89 -41
 - novelwriter/assets/themes/dracula.conf +91 -42
 - novelwriter/assets/themes/espresso.conf +97 -0
 - novelwriter/assets/themes/everforest_dark.conf +97 -0
 - novelwriter/assets/themes/everforest_light.conf +97 -0
 - novelwriter/assets/themes/floral_daydream.conf +95 -0
 - novelwriter/assets/themes/floral_midnight.conf +95 -0
 - novelwriter/assets/themes/full_moon.conf +95 -0
 - novelwriter/assets/themes/grey_dark.conf +97 -0
 - novelwriter/assets/themes/grey_light.conf +97 -0
 - novelwriter/assets/themes/horizon_dark.conf +97 -0
 - novelwriter/assets/themes/horizon_light.conf +97 -0
 - novelwriter/assets/themes/jewel_case_dark.conf +95 -0
 - novelwriter/assets/themes/jewel_case_light.conf +95 -0
 - novelwriter/assets/themes/lcars.conf +97 -0
 - novelwriter/assets/themes/light_owl.conf +117 -0
 - novelwriter/assets/themes/new_moon.conf +97 -0
 - novelwriter/assets/themes/night_owl.conf +117 -0
 - novelwriter/assets/themes/noctis.conf +129 -0
 - novelwriter/assets/themes/noctis_lux.conf +129 -0
 - novelwriter/assets/themes/nord.conf +97 -0
 - novelwriter/assets/themes/nordlicht.conf +95 -0
 - novelwriter/assets/themes/otium_dark.conf +95 -0
 - novelwriter/assets/themes/otium_light.conf +95 -0
 - novelwriter/assets/themes/paragon.conf +96 -0
 - novelwriter/assets/themes/primer_light.conf +97 -0
 - novelwriter/assets/themes/primer_night.conf +97 -0
 - novelwriter/assets/themes/rose_pine.conf +97 -0
 - novelwriter/assets/themes/rose_pine_dawn.conf +97 -0
 - novelwriter/assets/themes/ruby_day.conf +95 -0
 - novelwriter/assets/themes/ruby_night.conf +95 -0
 - novelwriter/assets/themes/selenium_dark.conf +95 -0
 - novelwriter/assets/themes/selenium_light.conf +95 -0
 - novelwriter/assets/themes/sepia_dark.conf +95 -0
 - novelwriter/assets/themes/sepia_light.conf +95 -0
 - novelwriter/assets/themes/snazzy.conf +102 -40
 - novelwriter/assets/themes/solarized_dark.conf +108 -40
 - novelwriter/assets/themes/solarized_light.conf +108 -40
 - novelwriter/assets/themes/sultana_light.conf +95 -0
 - novelwriter/assets/themes/sultana_night.conf +95 -0
 - novelwriter/assets/themes/tango_dark.conf +111 -0
 - novelwriter/assets/themes/tango_light.conf +111 -0
 - novelwriter/assets/themes/tomorrow.conf +117 -0
 - novelwriter/assets/themes/tomorrow_night.conf +117 -0
 - novelwriter/assets/themes/tomorrow_night_blue.conf +117 -0
 - novelwriter/assets/themes/tomorrow_night_bright.conf +117 -0
 - novelwriter/assets/themes/tomorrow_night_eighties.conf +117 -0
 - novelwriter/assets/themes/vivid_black_green.conf +97 -0
 - novelwriter/assets/themes/vivid_black_red.conf +97 -0
 - novelwriter/assets/themes/vivid_white_green.conf +97 -0
 - novelwriter/assets/themes/vivid_white_red.conf +97 -0
 - novelwriter/assets/themes/warpgate.conf +96 -0
 - novelwriter/assets/themes/waterlily_dark.conf +95 -0
 - novelwriter/assets/themes/waterlily_light.conf +95 -0
 - novelwriter/common.py +47 -17
 - novelwriter/config.py +57 -62
 - novelwriter/constants.py +32 -6
 - novelwriter/core/buildsettings.py +3 -23
 - novelwriter/core/coretools.py +21 -25
 - novelwriter/core/docbuild.py +4 -9
 - novelwriter/core/document.py +2 -6
 - novelwriter/core/index.py +33 -53
 - novelwriter/core/indexdata.py +17 -22
 - novelwriter/core/item.py +11 -35
 - novelwriter/core/itemmodel.py +5 -21
 - novelwriter/core/novelmodel.py +3 -7
 - novelwriter/core/options.py +3 -4
 - novelwriter/core/project.py +31 -21
 - novelwriter/core/projectdata.py +2 -21
 - novelwriter/core/projectxml.py +13 -21
 - novelwriter/core/sessions.py +2 -4
 - novelwriter/core/spellcheck.py +12 -13
 - novelwriter/core/status.py +27 -20
 - novelwriter/core/storage.py +5 -10
 - novelwriter/core/tree.py +6 -15
 - novelwriter/dialogs/about.py +9 -10
 - novelwriter/dialogs/docmerge.py +17 -14
 - novelwriter/dialogs/docsplit.py +18 -14
 - novelwriter/dialogs/editlabel.py +15 -9
 - novelwriter/dialogs/preferences.py +69 -68
 - novelwriter/dialogs/projectsettings.py +88 -67
 - novelwriter/dialogs/quotes.py +15 -10
 - novelwriter/dialogs/wordlist.py +18 -21
 - novelwriter/enum.py +75 -30
 - novelwriter/error.py +6 -11
 - novelwriter/extensions/configlayout.py +8 -34
 - novelwriter/extensions/eventfilters.py +3 -3
 - novelwriter/extensions/modified.py +87 -32
 - novelwriter/extensions/novelselector.py +13 -12
 - novelwriter/extensions/pagedsidebar.py +10 -18
 - novelwriter/extensions/progressbars.py +5 -11
 - novelwriter/extensions/statusled.py +3 -6
 - novelwriter/extensions/switch.py +8 -11
 - novelwriter/extensions/switchbox.py +2 -11
 - novelwriter/extensions/versioninfo.py +6 -7
 - novelwriter/formats/shared.py +10 -2
 - novelwriter/formats/todocx.py +15 -37
 - novelwriter/formats/tohtml.py +52 -61
 - novelwriter/formats/tokenizer.py +33 -64
 - novelwriter/formats/tomarkdown.py +4 -11
 - novelwriter/formats/toodt.py +12 -71
 - novelwriter/formats/toqdoc.py +11 -21
 - novelwriter/formats/toraw.py +2 -6
 - novelwriter/gui/doceditor.py +160 -225
 - novelwriter/gui/dochighlight.py +142 -101
 - novelwriter/gui/docviewer.py +53 -84
 - novelwriter/gui/docviewerpanel.py +18 -41
 - novelwriter/gui/editordocument.py +12 -17
 - novelwriter/gui/itemdetails.py +5 -14
 - novelwriter/gui/mainmenu.py +24 -32
 - novelwriter/gui/noveltree.py +13 -51
 - novelwriter/gui/outline.py +20 -61
 - novelwriter/gui/projtree.py +40 -96
 - novelwriter/gui/search.py +9 -24
 - novelwriter/gui/sidebar.py +54 -22
 - novelwriter/gui/statusbar.py +7 -22
 - novelwriter/gui/theme.py +482 -368
 - novelwriter/guimain.py +87 -101
 - novelwriter/shared.py +79 -48
 - novelwriter/splash.py +9 -5
 - novelwriter/text/comments.py +1 -1
 - novelwriter/text/counting.py +9 -5
 - novelwriter/text/patterns.py +20 -15
 - novelwriter/tools/dictionaries.py +18 -16
 - novelwriter/tools/lipsum.py +15 -17
 - novelwriter/tools/manusbuild.py +25 -45
 - novelwriter/tools/manuscript.py +94 -95
 - novelwriter/tools/manussettings.py +149 -104
 - novelwriter/tools/noveldetails.py +10 -24
 - novelwriter/tools/welcome.py +24 -72
 - novelwriter/tools/writingstats.py +17 -26
 - novelwriter/types.py +23 -13
 - {novelwriter-2.7.5.dist-info → novelwriter-2.8b1.dist-info}/METADATA +7 -7
 - novelwriter-2.8b1.dist-info/RECORD +212 -0
 - novelwriter/assets/images/welcome-dark.jpg +0 -0
 - novelwriter/assets/images/welcome-light.jpg +0 -0
 - novelwriter/assets/syntax/cyberpunk_night.conf +0 -28
 - novelwriter/assets/syntax/default_dark.conf +0 -42
 - novelwriter/assets/syntax/default_light.conf +0 -42
 - novelwriter/assets/syntax/dracula.conf +0 -44
 - novelwriter/assets/syntax/grey_dark.conf +0 -29
 - novelwriter/assets/syntax/grey_light.conf +0 -29
 - novelwriter/assets/syntax/light_owl.conf +0 -49
 - novelwriter/assets/syntax/night_owl.conf +0 -49
 - novelwriter/assets/syntax/snazzy.conf +0 -42
 - novelwriter/assets/syntax/solarized_dark.conf +0 -29
 - novelwriter/assets/syntax/solarized_light.conf +0 -29
 - novelwriter/assets/syntax/tango.conf +0 -39
 - novelwriter/assets/syntax/tomorrow.conf +0 -49
 - novelwriter/assets/syntax/tomorrow_night.conf +0 -49
 - novelwriter/assets/syntax/tomorrow_night_blue.conf +0 -49
 - novelwriter/assets/syntax/tomorrow_night_bright.conf +0 -49
 - novelwriter/assets/syntax/tomorrow_night_eighties.conf +0 -49
 - novelwriter/assets/themes/default.conf +0 -3
 - novelwriter-2.7.5.dist-info/RECORD +0 -163
 - {novelwriter-2.7.5.dist-info → novelwriter-2.8b1.dist-info}/WHEEL +0 -0
 - {novelwriter-2.7.5.dist-info → novelwriter-2.8b1.dist-info}/entry_points.txt +0 -0
 - {novelwriter-2.7.5.dist-info → novelwriter-2.8b1.dist-info}/licenses/LICENSE.md +0 -0
 - {novelwriter-2.7.5.dist-info → novelwriter-2.8b1.dist-info}/licenses/setup/LICENSE-Apache-2.0.txt +0 -0
 - {novelwriter-2.7.5.dist-info → novelwriter-2.8b1.dist-info}/top_level.txt +0 -0
 
    
        novelwriter/enum.py
    CHANGED
    
    | 
         @@ -20,12 +20,13 @@ General Public License for more details. 
     | 
|
| 
       20 
20 
     | 
    
         | 
| 
       21 
21 
     | 
    
         
             
            You should have received a copy of the GNU General Public License
         
     | 
| 
       22 
22 
     | 
    
         
             
            along with this program. If not, see <https://www.gnu.org/licenses/>.
         
     | 
| 
       23 
     | 
    
         
            -
            """
         
     | 
| 
      
 23 
     | 
    
         
            +
            """  # noqa
         
     | 
| 
       24 
24 
     | 
    
         | 
| 
       25 
25 
     | 
    
         
             
            from enum import Enum
         
     | 
| 
       26 
26 
     | 
    
         | 
| 
       27 
27 
     | 
    
         | 
| 
       28 
28 
     | 
    
         
             
            class nwItemType(Enum):
         
     | 
| 
      
 29 
     | 
    
         
            +
                """Enum: Project Item Types."""
         
     | 
| 
       29 
30 
     | 
    
         | 
| 
       30 
31 
     | 
    
         
             
                NO_TYPE = 0
         
     | 
| 
       31 
32 
     | 
    
         
             
                ROOT    = 1
         
     | 
| 
         @@ -34,6 +35,7 @@ class nwItemType(Enum): 
     | 
|
| 
       34 
35 
     | 
    
         | 
| 
       35 
36 
     | 
    
         | 
| 
       36 
37 
     | 
    
         
             
            class nwItemClass(Enum):
         
     | 
| 
      
 38 
     | 
    
         
            +
                """Enum: Project Item Classes."""
         
     | 
| 
       37 
39 
     | 
    
         | 
| 
       38 
40 
     | 
    
         
             
                NO_CLASS  = 0
         
     | 
| 
       39 
41 
     | 
    
         
             
                NOVEL     = 1
         
     | 
| 
         @@ -50,6 +52,7 @@ class nwItemClass(Enum): 
     | 
|
| 
       50 
52 
     | 
    
         | 
| 
       51 
53 
     | 
    
         | 
| 
       52 
54 
     | 
    
         
             
            class nwItemLayout(Enum):
         
     | 
| 
      
 55 
     | 
    
         
            +
                """A project item's layout."""
         
     | 
| 
       53 
56 
     | 
    
         | 
| 
       54 
57 
     | 
    
         
             
                NO_LAYOUT = 0
         
     | 
| 
       55 
58 
     | 
    
         
             
                DOCUMENT  = 1
         
     | 
| 
         @@ -57,6 +60,7 @@ class nwItemLayout(Enum): 
     | 
|
| 
       57 
60 
     | 
    
         | 
| 
       58 
61 
     | 
    
         | 
| 
       59 
62 
     | 
    
         
             
            class nwComment(Enum):
         
     | 
| 
      
 63 
     | 
    
         
            +
                """Types of text comments."""
         
     | 
| 
       60 
64 
     | 
    
         | 
| 
       61 
65 
     | 
    
         
             
                PLAIN    = 0
         
     | 
| 
       62 
66 
     | 
    
         
             
                IGNORE   = 1
         
     | 
| 
         @@ -69,6 +73,7 @@ class nwComment(Enum): 
     | 
|
| 
       69 
73 
     | 
    
         | 
| 
       70 
74 
     | 
    
         | 
| 
       71 
75 
     | 
    
         
             
            class nwChange(Enum):
         
     | 
| 
      
 76 
     | 
    
         
            +
                """Change request modes."""
         
     | 
| 
       72 
77 
     | 
    
         | 
| 
       73 
78 
     | 
    
         
             
                CREATE = 0
         
     | 
| 
       74 
79 
     | 
    
         
             
                UPDATE = 1
         
     | 
| 
         @@ -76,12 +81,14 @@ class nwChange(Enum): 
     | 
|
| 
       76 
81 
     | 
    
         | 
| 
       77 
82 
     | 
    
         | 
| 
       78 
83 
     | 
    
         
             
            class nwDocMode(Enum):
         
     | 
| 
      
 84 
     | 
    
         
            +
                """Document open modes."""
         
     | 
| 
       79 
85 
     | 
    
         | 
| 
       80 
86 
     | 
    
         
             
                VIEW = 0
         
     | 
| 
       81 
87 
     | 
    
         
             
                EDIT = 1
         
     | 
| 
       82 
88 
     | 
    
         | 
| 
       83 
89 
     | 
    
         | 
| 
       84 
90 
     | 
    
         
             
            class nwDocAction(Enum):
         
     | 
| 
      
 91 
     | 
    
         
            +
                """Document actions."""
         
     | 
| 
       85 
92 
     | 
    
         | 
| 
       86 
93 
     | 
    
         
             
                NO_ACTION = 0
         
     | 
| 
       87 
94 
     | 
    
         
             
                UNDO      = 1
         
     | 
| 
         @@ -92,38 +99,40 @@ class nwDocAction(Enum): 
     | 
|
| 
       92 
99 
     | 
    
         
             
                MD_ITALIC = 6
         
     | 
| 
       93 
100 
     | 
    
         
             
                MD_BOLD   = 7
         
     | 
| 
       94 
101 
     | 
    
         
             
                MD_STRIKE = 8
         
     | 
| 
       95 
     | 
    
         
            -
                 
     | 
| 
       96 
     | 
    
         
            -
                 
     | 
| 
       97 
     | 
    
         
            -
                 
     | 
| 
       98 
     | 
    
         
            -
                 
     | 
| 
       99 
     | 
    
         
            -
                 
     | 
| 
       100 
     | 
    
         
            -
                 
     | 
| 
       101 
     | 
    
         
            -
                 
     | 
| 
       102 
     | 
    
         
            -
                 
     | 
| 
       103 
     | 
    
         
            -
                 
     | 
| 
       104 
     | 
    
         
            -
                 
     | 
| 
       105 
     | 
    
         
            -
                 
     | 
| 
       106 
     | 
    
         
            -
                 
     | 
| 
       107 
     | 
    
         
            -
                 
     | 
| 
       108 
     | 
    
         
            -
                 
     | 
| 
       109 
     | 
    
         
            -
                 
     | 
| 
       110 
     | 
    
         
            -
                 
     | 
| 
       111 
     | 
    
         
            -
                 
     | 
| 
       112 
     | 
    
         
            -
                 
     | 
| 
       113 
     | 
    
         
            -
                 
     | 
| 
       114 
     | 
    
         
            -
                 
     | 
| 
       115 
     | 
    
         
            -
                 
     | 
| 
       116 
     | 
    
         
            -
                 
     | 
| 
       117 
     | 
    
         
            -
                 
     | 
| 
       118 
     | 
    
         
            -
                 
     | 
| 
       119 
     | 
    
         
            -
                 
     | 
| 
       120 
     | 
    
         
            -
                 
     | 
| 
       121 
     | 
    
         
            -
                 
     | 
| 
       122 
     | 
    
         
            -
                 
     | 
| 
       123 
     | 
    
         
            -
                 
     | 
| 
      
 102 
     | 
    
         
            +
                MD_MARK   = 9
         
     | 
| 
      
 103 
     | 
    
         
            +
                S_QUOTE   = 10
         
     | 
| 
      
 104 
     | 
    
         
            +
                D_QUOTE   = 11
         
     | 
| 
      
 105 
     | 
    
         
            +
                SEL_ALL   = 12
         
     | 
| 
      
 106 
     | 
    
         
            +
                SEL_PARA  = 13
         
     | 
| 
      
 107 
     | 
    
         
            +
                BLOCK_H1  = 14
         
     | 
| 
      
 108 
     | 
    
         
            +
                BLOCK_H2  = 15
         
     | 
| 
      
 109 
     | 
    
         
            +
                BLOCK_H3  = 16
         
     | 
| 
      
 110 
     | 
    
         
            +
                BLOCK_H4  = 17
         
     | 
| 
      
 111 
     | 
    
         
            +
                BLOCK_COM = 18
         
     | 
| 
      
 112 
     | 
    
         
            +
                BLOCK_IGN = 19
         
     | 
| 
      
 113 
     | 
    
         
            +
                BLOCK_TXT = 20
         
     | 
| 
      
 114 
     | 
    
         
            +
                BLOCK_TTL = 21
         
     | 
| 
      
 115 
     | 
    
         
            +
                BLOCK_UNN = 22
         
     | 
| 
      
 116 
     | 
    
         
            +
                BLOCK_HSC = 23
         
     | 
| 
      
 117 
     | 
    
         
            +
                REPL_SNG  = 24
         
     | 
| 
      
 118 
     | 
    
         
            +
                REPL_DBL  = 25
         
     | 
| 
      
 119 
     | 
    
         
            +
                RM_BREAKS = 26
         
     | 
| 
      
 120 
     | 
    
         
            +
                ALIGN_L   = 27
         
     | 
| 
      
 121 
     | 
    
         
            +
                ALIGN_C   = 28
         
     | 
| 
      
 122 
     | 
    
         
            +
                ALIGN_R   = 29
         
     | 
| 
      
 123 
     | 
    
         
            +
                INDENT_L  = 30
         
     | 
| 
      
 124 
     | 
    
         
            +
                INDENT_R  = 31
         
     | 
| 
      
 125 
     | 
    
         
            +
                SC_ITALIC = 32
         
     | 
| 
      
 126 
     | 
    
         
            +
                SC_BOLD   = 33
         
     | 
| 
      
 127 
     | 
    
         
            +
                SC_STRIKE = 34
         
     | 
| 
      
 128 
     | 
    
         
            +
                SC_ULINE  = 35
         
     | 
| 
      
 129 
     | 
    
         
            +
                SC_MARK   = 36
         
     | 
| 
      
 130 
     | 
    
         
            +
                SC_SUP    = 37
         
     | 
| 
      
 131 
     | 
    
         
            +
                SC_SUB    = 38
         
     | 
| 
       124 
132 
     | 
    
         | 
| 
       125 
133 
     | 
    
         | 
| 
       126 
134 
     | 
    
         
             
            class nwDocInsert(Enum):
         
     | 
| 
      
 135 
     | 
    
         
            +
                """Document insert actions."""
         
     | 
| 
       127 
136 
     | 
    
         | 
| 
       128 
137 
     | 
    
         
             
                NO_INSERT = 0
         
     | 
| 
       129 
138 
     | 
    
         
             
                QUOTE_LS  = 1
         
     | 
| 
         @@ -141,6 +150,7 @@ class nwDocInsert(Enum): 
     | 
|
| 
       141 
150 
     | 
    
         | 
| 
       142 
151 
     | 
    
         | 
| 
       143 
152 
     | 
    
         
             
            class nwView(Enum):
         
     | 
| 
      
 153 
     | 
    
         
            +
                """Main GUI view modes."""
         
     | 
| 
       144 
154 
     | 
    
         | 
| 
       145 
155 
     | 
    
         
             
                EDITOR  = 0
         
     | 
| 
       146 
156 
     | 
    
         
             
                PROJECT = 1
         
     | 
| 
         @@ -150,13 +160,23 @@ class nwView(Enum): 
     | 
|
| 
       150 
160 
     | 
    
         | 
| 
       151 
161 
     | 
    
         | 
| 
       152 
162 
     | 
    
         
             
            class nwFocus(Enum):
         
     | 
| 
      
 163 
     | 
    
         
            +
                """Main GUI panel focus."""
         
     | 
| 
       153 
164 
     | 
    
         | 
| 
       154 
165 
     | 
    
         
             
                TREE     = 1
         
     | 
| 
       155 
166 
     | 
    
         
             
                DOCUMENT = 2
         
     | 
| 
       156 
167 
     | 
    
         
             
                OUTLINE  = 3
         
     | 
| 
       157 
168 
     | 
    
         | 
| 
       158 
169 
     | 
    
         | 
| 
      
 170 
     | 
    
         
            +
            class nwTheme(Enum):
         
     | 
| 
      
 171 
     | 
    
         
            +
                """GUI theme colour modes."""
         
     | 
| 
      
 172 
     | 
    
         
            +
             
     | 
| 
      
 173 
     | 
    
         
            +
                AUTO  = 0
         
     | 
| 
      
 174 
     | 
    
         
            +
                LIGHT = 1
         
     | 
| 
      
 175 
     | 
    
         
            +
                DARK  = 2
         
     | 
| 
      
 176 
     | 
    
         
            +
             
     | 
| 
      
 177 
     | 
    
         
            +
             
     | 
| 
       159 
178 
     | 
    
         
             
            class nwOutline(Enum):
         
     | 
| 
      
 179 
     | 
    
         
            +
                """Enum: Project Outline Columns."""
         
     | 
| 
       160 
180 
     | 
    
         | 
| 
       161 
181 
     | 
    
         
             
                TITLE   = 0
         
     | 
| 
       162 
182 
     | 
    
         
             
                LEVEL   = 1
         
     | 
| 
         @@ -181,6 +201,7 @@ class nwOutline(Enum): 
     | 
|
| 
       181 
201 
     | 
    
         | 
| 
       182 
202 
     | 
    
         | 
| 
       183 
203 
     | 
    
         
             
            class nwNovelExtra(Enum):
         
     | 
| 
      
 204 
     | 
    
         
            +
                """Enum: Novel View Extra Columns."""
         
     | 
| 
       184 
205 
     | 
    
         | 
| 
       185 
206 
     | 
    
         
             
                HIDDEN = 0
         
     | 
| 
       186 
207 
     | 
    
         
             
                POV    = 1
         
     | 
| 
         @@ -189,6 +210,7 @@ class nwNovelExtra(Enum): 
     | 
|
| 
       189 
210 
     | 
    
         | 
| 
       190 
211 
     | 
    
         | 
| 
       191 
212 
     | 
    
         
             
            class nwBuildFmt(Enum):
         
     | 
| 
      
 213 
     | 
    
         
            +
                """Enum: Manuscript Document Formats."""
         
     | 
| 
       192 
214 
     | 
    
         | 
| 
       193 
215 
     | 
    
         
             
                ODT    = 0
         
     | 
| 
       194 
216 
     | 
    
         
             
                FODT   = 1
         
     | 
| 
         @@ -203,6 +225,7 @@ class nwBuildFmt(Enum): 
     | 
|
| 
       203 
225 
     | 
    
         | 
| 
       204 
226 
     | 
    
         | 
| 
       205 
227 
     | 
    
         
             
            class nwStatusShape(Enum):
         
     | 
| 
      
 228 
     | 
    
         
            +
                """Enum: Status/Importance Icon Shapes."""
         
     | 
| 
       206 
229 
     | 
    
         | 
| 
       207 
230 
     | 
    
         
             
                SQUARE   = 0
         
     | 
| 
       208 
231 
     | 
    
         
             
                TRIANGLE = 1
         
     | 
| 
         @@ -224,3 +247,25 @@ class nwStatusShape(Enum): 
     | 
|
| 
       224 
247 
     | 
    
         
             
                BLOCK_2  = 17
         
     | 
| 
       225 
248 
     | 
    
         
             
                BLOCK_3  = 18
         
     | 
| 
       226 
249 
     | 
    
         
             
                BLOCK_4  = 19
         
     | 
| 
      
 250 
     | 
    
         
            +
             
     | 
| 
      
 251 
     | 
    
         
            +
             
     | 
| 
      
 252 
     | 
    
         
            +
            class nwStandardButton(Enum):
         
     | 
| 
      
 253 
     | 
    
         
            +
                """Enum: Standard Dialog Buttons."""
         
     | 
| 
      
 254 
     | 
    
         
            +
             
     | 
| 
      
 255 
     | 
    
         
            +
                OK      = 0
         
     | 
| 
      
 256 
     | 
    
         
            +
                CANCEL  = 1
         
     | 
| 
      
 257 
     | 
    
         
            +
                YES     = 2
         
     | 
| 
      
 258 
     | 
    
         
            +
                NO      = 3
         
     | 
| 
      
 259 
     | 
    
         
            +
                OPEN    = 4
         
     | 
| 
      
 260 
     | 
    
         
            +
                CLOSE   = 5
         
     | 
| 
      
 261 
     | 
    
         
            +
                SAVE    = 6
         
     | 
| 
      
 262 
     | 
    
         
            +
                BROWSE  = 7
         
     | 
| 
      
 263 
     | 
    
         
            +
                LIST    = 8
         
     | 
| 
      
 264 
     | 
    
         
            +
                NEW     = 9
         
     | 
| 
      
 265 
     | 
    
         
            +
                CREATE  = 10
         
     | 
| 
      
 266 
     | 
    
         
            +
                RESET   = 11
         
     | 
| 
      
 267 
     | 
    
         
            +
                INSERT  = 12
         
     | 
| 
      
 268 
     | 
    
         
            +
                APPLY   = 13
         
     | 
| 
      
 269 
     | 
    
         
            +
                BUILD   = 14
         
     | 
| 
      
 270 
     | 
    
         
            +
                PRINT   = 15
         
     | 
| 
      
 271 
     | 
    
         
            +
                PREVIEW = 16
         
     | 
    
        novelwriter/error.py
    CHANGED
    
    | 
         @@ -20,7 +20,7 @@ General Public License for more details. 
     | 
|
| 
       20 
20 
     | 
    
         | 
| 
       21 
21 
     | 
    
         
             
            You should have received a copy of the GNU General Public License
         
     | 
| 
       22 
22 
     | 
    
         
             
            along with this program. If not, see <https://www.gnu.org/licenses/>.
         
     | 
| 
       23 
     | 
    
         
            -
            """
         
     | 
| 
      
 23 
     | 
    
         
            +
            """  # noqa
         
     | 
| 
       24 
24 
     | 
    
         
             
            from __future__ import annotations
         
     | 
| 
       25 
25 
     | 
    
         | 
| 
       26 
26 
     | 
    
         
             
            import logging
         
     | 
| 
         @@ -47,7 +47,6 @@ def logException() -> None: 
     | 
|
| 
       47 
47 
     | 
    
         
             
                exType, exValue, _ = sys.exc_info()
         
     | 
| 
       48 
48 
     | 
    
         
             
                if exType is not None:
         
     | 
| 
       49 
49 
     | 
    
         
             
                    logger.error(f"{exType.__name__}: {exValue!s}", stacklevel=2)
         
     | 
| 
       50 
     | 
    
         
            -
                return
         
     | 
| 
       51 
50 
     | 
    
         | 
| 
       52 
51 
     | 
    
         | 
| 
       53 
52 
     | 
    
         
             
            def formatException(exc: BaseException) -> str:
         
     | 
| 
         @@ -58,6 +57,7 @@ def formatException(exc: BaseException) -> str: 
     | 
|
| 
       58 
57 
     | 
    
         | 
| 
       59 
58 
     | 
    
         | 
| 
       60 
59 
     | 
    
         
             
            class NWErrorMessage(QDialog):
         
     | 
| 
      
 60 
     | 
    
         
            +
                """GUI: Error Dialog."""
         
     | 
| 
       61 
61 
     | 
    
         | 
| 
       62 
62 
     | 
    
         
             
                def __init__(self, parent: QWidget) -> None:
         
     | 
| 
       63 
63 
     | 
    
         
             
                    super().__init__(parent=parent)
         
     | 
| 
         @@ -110,8 +110,6 @@ class NWErrorMessage(QDialog): 
     | 
|
| 
       110 
110 
     | 
    
         
             
                    self.setSizeGripEnabled(True)
         
     | 
| 
       111 
111 
     | 
    
         
             
                    self.resize(800, 400)
         
     | 
| 
       112 
112 
     | 
    
         | 
| 
       113 
     | 
    
         
            -
                    return
         
     | 
| 
       114 
     | 
    
         
            -
             
     | 
| 
       115 
113 
     | 
    
         
             
                def setMessage(self, exType: type, exValue: BaseException, exTrace: TracebackType) -> None:
         
     | 
| 
       116 
114 
     | 
    
         
             
                    """Generate a message and append session data, error info and
         
     | 
| 
       117 
115 
     | 
    
         
             
                    error traceback.
         
     | 
| 
         @@ -143,7 +141,7 @@ class NWErrorMessage(QDialog): 
     | 
|
| 
       143 
141 
     | 
    
         
             
                        enchantVersion = "Unknown"
         
     | 
| 
       144 
142 
     | 
    
         | 
| 
       145 
143 
     | 
    
         
             
                    try:
         
     | 
| 
       146 
     | 
    
         
            -
                         
     | 
| 
      
 144 
     | 
    
         
            +
                        trace = "\n".join(format_tb(exTrace))
         
     | 
| 
       147 
145 
     | 
    
         
             
                        self.msgBody.setPlainText(
         
     | 
| 
       148 
146 
     | 
    
         
             
                            "Environment:\n"
         
     | 
| 
       149 
147 
     | 
    
         
             
                            f"novelWriter Version: {__version__}\n"
         
     | 
| 
         @@ -152,13 +150,11 @@ class NWErrorMessage(QDialog): 
     | 
|
| 
       152 
150 
     | 
    
         
             
                            f"Qt: {QT_VERSION_STR}, PyQt: {PYQT_VERSION_STR}\n"
         
     | 
| 
       153 
151 
     | 
    
         
             
                            f"enchant: {enchantVersion}\n\n"
         
     | 
| 
       154 
152 
     | 
    
         
             
                            f"{exType.__name__}:\n{exValue!s}\n\n"
         
     | 
| 
       155 
     | 
    
         
            -
                            f"Traceback:\n{ 
     | 
| 
      
 153 
     | 
    
         
            +
                            f"Traceback:\n{trace}\n"
         
     | 
| 
       156 
154 
     | 
    
         
             
                        )
         
     | 
| 
       157 
155 
     | 
    
         
             
                    except Exception:
         
     | 
| 
       158 
156 
     | 
    
         
             
                        self.msgBody.setPlainText("Failed to generate error report ...")
         
     | 
| 
       159 
157 
     | 
    
         | 
| 
       160 
     | 
    
         
            -
                    return
         
     | 
| 
       161 
     | 
    
         
            -
             
     | 
| 
       162 
158 
     | 
    
         
             
                ##
         
     | 
| 
       163 
159 
     | 
    
         
             
                #  Slots
         
     | 
| 
       164 
160 
     | 
    
         
             
                ##
         
     | 
| 
         @@ -167,16 +163,15 @@ class NWErrorMessage(QDialog): 
     | 
|
| 
       167 
163 
     | 
    
         
             
                def _doClose(self) -> None:
         
     | 
| 
       168 
164 
     | 
    
         
             
                    """Close the dialog."""
         
     | 
| 
       169 
165 
     | 
    
         
             
                    self.close()
         
     | 
| 
       170 
     | 
    
         
            -
                    return
         
     | 
| 
       171 
166 
     | 
    
         | 
| 
       172 
167 
     | 
    
         | 
| 
       173 
168 
     | 
    
         
             
            def exceptionHandler(exType: type, exValue: BaseException, exTrace: TracebackType) -> None:
         
     | 
| 
       174 
     | 
    
         
            -
                """ 
     | 
| 
      
 169 
     | 
    
         
            +
                """Catch unhandled global exceptions."""
         
     | 
| 
       175 
170 
     | 
    
         
             
                from traceback import print_tb
         
     | 
| 
       176 
171 
     | 
    
         | 
| 
       177 
172 
     | 
    
         
             
                from PyQt6.QtWidgets import QApplication
         
     | 
| 
       178 
173 
     | 
    
         | 
| 
       179 
     | 
    
         
            -
                logger.critical("%s: %s", exType.__name__,  
     | 
| 
      
 174 
     | 
    
         
            +
                logger.critical("%s: %s", exType.__name__, exValue)
         
     | 
| 
       180 
175 
     | 
    
         
             
                print_tb(exTrace)
         
     | 
| 
       181 
176 
     | 
    
         | 
| 
       182 
177 
     | 
    
         
             
                try:
         
     | 
| 
         @@ -24,10 +24,10 @@ General Public License for more details. 
     | 
|
| 
       24 
24 
     | 
    
         | 
| 
       25 
25 
     | 
    
         
             
            You should have received a copy of the GNU General Public License
         
     | 
| 
       26 
26 
     | 
    
         
             
            along with this program. If not, see <https://www.gnu.org/licenses/>.
         
     | 
| 
       27 
     | 
    
         
            -
            """
         
     | 
| 
      
 27 
     | 
    
         
            +
            """  # noqa
         
     | 
| 
       28 
28 
     | 
    
         
             
            from __future__ import annotations
         
     | 
| 
       29 
29 
     | 
    
         | 
| 
       30 
     | 
    
         
            -
            from PyQt6.QtGui import QColor, QFont, QPalette 
     | 
| 
      
 30 
     | 
    
         
            +
            from PyQt6.QtGui import QColor, QFont, QPalette
         
     | 
| 
       31 
31 
     | 
    
         
             
            from PyQt6.QtWidgets import (
         
     | 
| 
       32 
32 
     | 
    
         
             
                QAbstractButton, QFrame, QHBoxLayout, QLabel, QLayout, QScrollArea,
         
     | 
| 
       33 
33 
     | 
    
         
             
                QVBoxLayout, QWidget
         
     | 
| 
         @@ -39,7 +39,7 @@ DEFAULT_SCALE = 0.9 
     | 
|
| 
       39 
39 
     | 
    
         | 
| 
       40 
40 
     | 
    
         | 
| 
       41 
41 
     | 
    
         
             
            class NFixedPage(QFrame):
         
     | 
| 
       42 
     | 
    
         
            -
                """Extension: Fixed Page Widget
         
     | 
| 
      
 42 
     | 
    
         
            +
                """Extension: Fixed Page Widget.
         
     | 
| 
       43 
43 
     | 
    
         | 
| 
       44 
44 
     | 
    
         
             
                A custom widget that holds a layout. This is just a wrapper around a
         
     | 
| 
       45 
45 
     | 
    
         
             
                QFrame that sets the same frame style as the other Page widgets.
         
     | 
| 
         @@ -49,23 +49,20 @@ class NFixedPage(QFrame): 
     | 
|
| 
       49 
49 
     | 
    
         
             
                    super().__init__(parent=parent)
         
     | 
| 
       50 
50 
     | 
    
         
             
                    self.setFrameShadow(QFrame.Shadow.Sunken)
         
     | 
| 
       51 
51 
     | 
    
         
             
                    self.setFrameShape(QFrame.Shape.StyledPanel)
         
     | 
| 
       52 
     | 
    
         
            -
                    return
         
     | 
| 
       53 
52 
     | 
    
         | 
| 
       54 
53 
     | 
    
         
             
                def setCentralLayout(self, layout: QLayout) -> None:
         
     | 
| 
       55 
54 
     | 
    
         
             
                    """Set a layout as the central object."""
         
     | 
| 
       56 
55 
     | 
    
         
             
                    self.setLayout(layout)
         
     | 
| 
       57 
     | 
    
         
            -
                    return
         
     | 
| 
       58 
56 
     | 
    
         | 
| 
       59 
57 
     | 
    
         
             
                def setCentralWidget(self, widget: QWidget) -> None:
         
     | 
| 
       60 
58 
     | 
    
         
             
                    """Set a layout as the central object."""
         
     | 
| 
       61 
59 
     | 
    
         
             
                    layout = QHBoxLayout()
         
     | 
| 
       62 
60 
     | 
    
         
             
                    layout.addWidget(widget)
         
     | 
| 
       63 
61 
     | 
    
         
             
                    self.setLayout(layout)
         
     | 
| 
       64 
     | 
    
         
            -
                    return
         
     | 
| 
       65 
62 
     | 
    
         | 
| 
       66 
63 
     | 
    
         | 
| 
       67 
64 
     | 
    
         
             
            class NScrollablePage(QScrollArea):
         
     | 
| 
       68 
     | 
    
         
            -
                """Extension: Scrollable Page Widget
         
     | 
| 
      
 65 
     | 
    
         
            +
                """Extension: Scrollable Page Widget.
         
     | 
| 
       69 
66 
     | 
    
         | 
| 
       70 
67 
     | 
    
         
             
                A custom widget that holds a layout within a scrollable area.
         
     | 
| 
       71 
68 
     | 
    
         
             
                """
         
     | 
| 
         @@ -79,16 +76,14 @@ class NScrollablePage(QScrollArea): 
     | 
|
| 
       79 
76 
     | 
    
         
             
                    self.setVerticalScrollBarPolicy(QtScrollAsNeeded)
         
     | 
| 
       80 
77 
     | 
    
         
             
                    self.setFrameShadow(QFrame.Shadow.Sunken)
         
     | 
| 
       81 
78 
     | 
    
         
             
                    self.setFrameShape(QFrame.Shape.StyledPanel)
         
     | 
| 
       82 
     | 
    
         
            -
                    return
         
     | 
| 
       83 
79 
     | 
    
         | 
| 
       84 
80 
     | 
    
         
             
                def setCentralLayout(self, layout: QLayout) -> None:
         
     | 
| 
       85 
81 
     | 
    
         
             
                    """Set the central layout of the scroll page."""
         
     | 
| 
       86 
82 
     | 
    
         
             
                    self._widget.setLayout(layout)
         
     | 
| 
       87 
     | 
    
         
            -
                    return
         
     | 
| 
       88 
83 
     | 
    
         | 
| 
       89 
84 
     | 
    
         | 
| 
       90 
85 
     | 
    
         
             
            class NScrollableForm(QScrollArea):
         
     | 
| 
       91 
     | 
    
         
            -
                """Extension: Scrollable Form Widget
         
     | 
| 
      
 86 
     | 
    
         
            +
                """Extension: Scrollable Form Widget.
         
     | 
| 
       92 
87 
     | 
    
         | 
| 
       93 
88 
     | 
    
         
             
                A custom widget that creates a form within a scrollable area.
         
     | 
| 
       94 
89 
     | 
    
         
             
                """
         
     | 
| 
         @@ -117,8 +112,6 @@ class NScrollableForm(QScrollArea): 
     | 
|
| 
       117 
112 
     | 
    
         
             
                    self.setFrameShadow(QFrame.Shadow.Sunken)
         
     | 
| 
       118 
113 
     | 
    
         
             
                    self.setFrameShape(QFrame.Shape.StyledPanel)
         
     | 
| 
       119 
114 
     | 
    
         | 
| 
       120 
     | 
    
         
            -
                    return
         
     | 
| 
       121 
     | 
    
         
            -
             
     | 
| 
       122 
115 
     | 
    
         
             
                ##
         
     | 
| 
       123 
116 
     | 
    
         
             
                #  Properties
         
     | 
| 
       124 
117 
     | 
    
         
             
                ##
         
     | 
| 
         @@ -135,18 +128,15 @@ class NScrollableForm(QScrollArea): 
     | 
|
| 
       135 
128 
     | 
    
         
             
                    """Set the text color for the help text."""
         
     | 
| 
       136 
129 
     | 
    
         
             
                    self._helpCol = color
         
     | 
| 
       137 
130 
     | 
    
         
             
                    self._fontScale = scale
         
     | 
| 
       138 
     | 
    
         
            -
                    return
         
     | 
| 
       139 
131 
     | 
    
         | 
| 
       140 
132 
     | 
    
         
             
                def setHelpText(self, key: str, text: str) -> None:
         
     | 
| 
       141 
133 
     | 
    
         
             
                    """Set the text for the help label."""
         
     | 
| 
       142 
134 
     | 
    
         
             
                    if qHelp := self._editable.get(key):
         
     | 
| 
       143 
135 
     | 
    
         
             
                        qHelp.setText(text)
         
     | 
| 
       144 
     | 
    
         
            -
                    return
         
     | 
| 
       145 
136 
     | 
    
         | 
| 
       146 
137 
     | 
    
         
             
                def setRowIndent(self, indent: int) -> None:
         
     | 
| 
       147 
138 
     | 
    
         
             
                    """Set the indentation of each row."""
         
     | 
| 
       148 
139 
     | 
    
         
             
                    self._indent = max(indent, 0)
         
     | 
| 
       149 
     | 
    
         
            -
                    return
         
     | 
| 
       150 
140 
     | 
    
         | 
| 
       151 
141 
     | 
    
         
             
                ##
         
     | 
| 
       152 
142 
     | 
    
         
             
                #  Methods
         
     | 
| 
         @@ -158,7 +148,6 @@ class NScrollableForm(QScrollArea): 
     | 
|
| 
       158 
148 
     | 
    
         
             
                        yPos = self._sections[identifier].pos().y() - 8
         
     | 
| 
       159 
149 
     | 
    
         
             
                        if vBar := self.verticalScrollBar():
         
     | 
| 
       160 
150 
     | 
    
         
             
                            vBar.setValue(yPos)
         
     | 
| 
       161 
     | 
    
         
            -
                    return
         
     | 
| 
       162 
151 
     | 
    
         | 
| 
       163 
152 
     | 
    
         
             
                def scrollToLabel(self, label: str) -> None:
         
     | 
| 
       164 
153 
     | 
    
         
             
                    """Scroll to the requested label."""
         
     | 
| 
         @@ -166,7 +155,6 @@ class NScrollableForm(QScrollArea): 
     | 
|
| 
       166 
155 
     | 
    
         
             
                        yPos = self._index[label].pos().y() - 8
         
     | 
| 
       167 
156 
     | 
    
         
             
                        if vBar := self.verticalScrollBar():
         
     | 
| 
       168 
157 
     | 
    
         
             
                            vBar.setValue(yPos)
         
     | 
| 
       169 
     | 
    
         
            -
                    return
         
     | 
| 
       170 
158 
     | 
    
         | 
| 
       171 
159 
     | 
    
         
             
                def addGroupLabel(self, label: str, identifier: int | None = None) -> None:
         
     | 
| 
       172 
160 
     | 
    
         
             
                    """Add a text label to separate groups of settings."""
         
     | 
| 
         @@ -178,12 +166,11 @@ class NScrollableForm(QScrollArea): 
     | 
|
| 
       178 
166 
     | 
    
         
             
                    self._first = False
         
     | 
| 
       179 
167 
     | 
    
         
             
                    if identifier is not None:
         
     | 
| 
       180 
168 
     | 
    
         
             
                        self._sections[identifier] = qLabel
         
     | 
| 
       181 
     | 
    
         
            -
                    return
         
     | 
| 
       182 
169 
     | 
    
         | 
| 
       183 
170 
     | 
    
         
             
                def addRow(
         
     | 
| 
       184 
171 
     | 
    
         
             
                    self,
         
     | 
| 
       185 
172 
     | 
    
         
             
                    label: str | None,
         
     | 
| 
       186 
     | 
    
         
            -
                    widget: QWidget | list[QWidget |  
     | 
| 
      
 173 
     | 
    
         
            +
                    widget: QWidget | list[QWidget | int],
         
     | 
| 
       187 
174 
     | 
    
         
             
                    helpText: str = "",
         
     | 
| 
       188 
175 
     | 
    
         
             
                    unit: str | None = None,
         
     | 
| 
       189 
176 
     | 
    
         
             
                    button: QWidget | None = None,
         
     | 
| 
         @@ -200,10 +187,6 @@ class NScrollableForm(QScrollArea): 
     | 
|
| 
       200 
187 
     | 
    
         
             
                        for item in widget:
         
     | 
| 
       201 
188 
     | 
    
         
             
                            if isinstance(item, QWidget):
         
     | 
| 
       202 
189 
     | 
    
         
             
                                wBox.addWidget(item)
         
     | 
| 
       203 
     | 
    
         
            -
                            elif isinstance(item, QPixmap):
         
     | 
| 
       204 
     | 
    
         
            -
                                icon = QLabel(self)
         
     | 
| 
       205 
     | 
    
         
            -
                                icon.setPixmap(item)
         
     | 
| 
       206 
     | 
    
         
            -
                                wBox.addWidget(icon)
         
     | 
| 
       207 
190 
     | 
    
         
             
                            elif isinstance(item, int):
         
     | 
| 
       208 
191 
     | 
    
         
             
                                wBox.addSpacing(item)
         
     | 
| 
       209 
192 
     | 
    
         
             
                        qWidget = QWidget(self)
         
     | 
| 
         @@ -252,17 +235,14 @@ class NScrollableForm(QScrollArea): 
     | 
|
| 
       252 
235 
     | 
    
         
             
                        self._index[label.strip()] = qWidget
         
     | 
| 
       253 
236 
     | 
    
         
             
                    qLabel.setAccessibleName(text)
         
     | 
| 
       254 
237 
     | 
    
         | 
| 
       255 
     | 
    
         
            -
                    return
         
     | 
| 
       256 
     | 
    
         
            -
             
     | 
| 
       257 
238 
     | 
    
         
             
                def finalise(self) -> None:
         
     | 
| 
       258 
239 
     | 
    
         
             
                    """Finalise the layout when the form is built."""
         
     | 
| 
       259 
240 
     | 
    
         
             
                    self._layout.addSpacing(20)
         
     | 
| 
       260 
241 
     | 
    
         
             
                    self._layout.addStretch(1)
         
     | 
| 
       261 
     | 
    
         
            -
                    return
         
     | 
| 
       262 
242 
     | 
    
         | 
| 
       263 
243 
     | 
    
         | 
| 
       264 
244 
     | 
    
         
             
            class NColorLabel(QLabel):
         
     | 
| 
       265 
     | 
    
         
            -
                """Extension: A Coloured Label
         
     | 
| 
      
 245 
     | 
    
         
            +
                """Extension: A Coloured Label.
         
     | 
| 
       266 
246 
     | 
    
         | 
| 
       267 
247 
     | 
    
         
             
                A custom widget that draws a label in a specific colour, and
         
     | 
| 
       268 
248 
     | 
    
         
             
                optionally at a specific size, and word wrapped.
         
     | 
| 
         @@ -298,21 +278,17 @@ class NColorLabel(QLabel): 
     | 
|
| 
       298 
278 
     | 
    
         
             
                    self.setWordWrap(wrap)
         
     | 
| 
       299 
279 
     | 
    
         
             
                    self.setColorState(True)
         
     | 
| 
       300 
280 
     | 
    
         | 
| 
       301 
     | 
    
         
            -
                    return
         
     | 
| 
       302 
     | 
    
         
            -
             
     | 
| 
       303 
281 
     | 
    
         
             
                def setTextColors(self, *, color: QColor | None = None, faded: QColor | None = None) -> None:
         
     | 
| 
       304 
282 
     | 
    
         
             
                    """Set or update the text colours."""
         
     | 
| 
       305 
283 
     | 
    
         
             
                    self._color = color or self._color
         
     | 
| 
       306 
284 
     | 
    
         
             
                    self._faded = faded or self._faded
         
     | 
| 
       307 
285 
     | 
    
         
             
                    self._refeshTextColor()
         
     | 
| 
       308 
     | 
    
         
            -
                    return
         
     | 
| 
       309 
286 
     | 
    
         | 
| 
       310 
287 
     | 
    
         
             
                def setColorState(self, state: bool) -> None:
         
     | 
| 
       311 
288 
     | 
    
         
             
                    """Change the colour state."""
         
     | 
| 
       312 
289 
     | 
    
         
             
                    if self._state is not state:
         
     | 
| 
       313 
290 
     | 
    
         
             
                        self._state = state
         
     | 
| 
       314 
291 
     | 
    
         
             
                        self._refeshTextColor()
         
     | 
| 
       315 
     | 
    
         
            -
                    return
         
     | 
| 
       316 
292 
     | 
    
         | 
| 
       317 
293 
     | 
    
         
             
                def _refeshTextColor(self) -> None:
         
     | 
| 
       318 
294 
     | 
    
         
             
                    """Refresh the colour of the text on the label."""
         
     | 
| 
         @@ -322,11 +298,10 @@ class NColorLabel(QLabel): 
     | 
|
| 
       322 
298 
     | 
    
         
             
                        self._color if self._state else self._faded,
         
     | 
| 
       323 
299 
     | 
    
         
             
                    )
         
     | 
| 
       324 
300 
     | 
    
         
             
                    self.setPalette(palette)
         
     | 
| 
       325 
     | 
    
         
            -
                    return
         
     | 
| 
       326 
301 
     | 
    
         | 
| 
       327 
302 
     | 
    
         | 
| 
       328 
303 
     | 
    
         
             
            class NWrappedWidgetBox(QHBoxLayout):
         
     | 
| 
       329 
     | 
    
         
            -
                """Extension: A Text-Wrapped Widget Box
         
     | 
| 
      
 304 
     | 
    
         
            +
                """Extension: A Text-Wrapped Widget Box.
         
     | 
| 
       330 
305 
     | 
    
         | 
| 
       331 
306 
     | 
    
         
             
                A custom layout box where a widget is wrapped in text labels on
         
     | 
| 
       332 
307 
     | 
    
         
             
                either side within a layout box. The widget is inserted at the {0}
         
     | 
| 
         @@ -341,4 +316,3 @@ class NWrappedWidgetBox(QHBoxLayout): 
     | 
|
| 
       341 
316 
     | 
    
         
             
                    self.addWidget(widget)
         
     | 
| 
       342 
317 
     | 
    
         
             
                    if after:
         
     | 
| 
       343 
318 
     | 
    
         
             
                        self.addWidget(QLabel(after.lstrip()))
         
     | 
| 
       344 
     | 
    
         
            -
                    return
         
     | 
| 
         @@ -21,7 +21,7 @@ General Public License for more details. 
     | 
|
| 
       21 
21 
     | 
    
         | 
| 
       22 
22 
     | 
    
         
             
            You should have received a copy of the GNU General Public License
         
     | 
| 
       23 
23 
     | 
    
         
             
            along with this program. If not, see <https://www.gnu.org/licenses/>.
         
     | 
| 
       24 
     | 
    
         
            -
            """
         
     | 
| 
      
 24 
     | 
    
         
            +
            """  # noqa
         
     | 
| 
       25 
25 
     | 
    
         
             
            from __future__ import annotations
         
     | 
| 
       26 
26 
     | 
    
         | 
| 
       27 
27 
     | 
    
         
             
            from typing import TYPE_CHECKING
         
     | 
| 
         @@ -34,7 +34,7 @@ if TYPE_CHECKING: 
     | 
|
| 
       34 
34 
     | 
    
         | 
| 
       35 
35 
     | 
    
         | 
| 
       36 
36 
     | 
    
         
             
            class WheelEventFilter(QObject):
         
     | 
| 
       37 
     | 
    
         
            -
                """Extensions: Wheel Event Filter
         
     | 
| 
      
 37 
     | 
    
         
            +
                """Extensions: Wheel Event Filter.
         
     | 
| 
       38 
38 
     | 
    
         | 
| 
       39 
39 
     | 
    
         
             
                An event filter that filters mouse wheel events for a widget and
         
     | 
| 
       40 
40 
     | 
    
         
             
                forward them to the root widget. This solves the lack of mouse wheel
         
     | 
| 
         @@ -50,7 +50,6 @@ class WheelEventFilter(QObject): 
     | 
|
| 
       50 
50 
     | 
    
         
             
                    super().__init__(parent=parent)
         
     | 
| 
       51 
51 
     | 
    
         
             
                    self._parent = parent
         
     | 
| 
       52 
52 
     | 
    
         
             
                    self._locked = False
         
     | 
| 
       53 
     | 
    
         
            -
                    return
         
     | 
| 
       54 
53 
     | 
    
         | 
| 
       55 
54 
     | 
    
         
             
                def eventFilter(self, obj: QObject, event: QEvent) -> bool:
         
     | 
| 
       56 
55 
     | 
    
         
             
                    """Filter events of type QWheelEvent and forward them to the
         
     | 
| 
         @@ -69,6 +68,7 @@ class WheelEventFilter(QObject): 
     | 
|
| 
       69 
68 
     | 
    
         | 
| 
       70 
69 
     | 
    
         | 
| 
       71 
70 
     | 
    
         
             
            class StatusTipFilter(QObject):
         
     | 
| 
      
 71 
     | 
    
         
            +
                """Filter: Remove StatusBar ToolTips."""
         
     | 
| 
       72 
72 
     | 
    
         | 
| 
       73 
73 
     | 
    
         
             
                def eventFilter(self, obj: QObject, event: QEvent) -> bool:
         
     | 
| 
       74 
74 
     | 
    
         
             
                    """Filter out status tip events on menus."""
         
     |