From e865e5b4482cebbdb9dfd5af959a48c283a3d140 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Wed, 13 May 2020 23:23:13 +0200 Subject: [PATCH] Added support for icon themes in the source. Still need to add it to preferences. --- nw/assets/{ => graphics}/license.txt | 4 - nw/assets/icons/globe-dark.svg | 56 ------ nw/assets/icons/globe.svg | 56 ------ nw/assets/icons/typicons_grey_dark/README.md | 17 ++ .../icons/typicons_grey_dark/backspace.svg | 56 ++++++ nw/assets/icons/typicons_grey_dark/book.svg | 56 ++++++ nw/assets/icons/typicons_grey_dark/cancel.svg | 56 ++++++ nw/assets/icons/typicons_grey_dark/delete.svg | 56 ++++++ .../typicons_grey_dark/document-text.svg | 61 ++++++ .../icons/typicons_grey_dark/download.svg | 55 ++++++ nw/assets/icons/typicons_grey_dark/flag.svg | 56 ++++++ nw/assets/icons/typicons_grey_dark/folder.svg | 56 ++++++ nw/assets/icons/typicons_grey_dark/globe.svg | 57 ++++++ .../icons/typicons_grey_dark/globe_max.svg | 57 ++++++ nw/assets/icons/typicons_grey_dark/icons.conf | 37 ++++ .../typicons_grey_dark/input-checked.svg | 56 ++++++ nw/assets/icons/typicons_grey_dark/key.svg | 56 ++++++ .../icons/typicons_grey_dark/location.svg | 56 ++++++ nw/assets/icons/typicons_grey_dark/minus.svg | 56 ++++++ nw/assets/icons/typicons_grey_dark/pencil.svg | 55 ++++++ nw/assets/icons/typicons_grey_dark/plus.svg | 56 ++++++ nw/assets/icons/typicons_grey_dark/puzzle.svg | 56 ++++++ .../typicons_grey_dark/search-replace.svg | 60 ++++++ nw/assets/icons/typicons_grey_dark/search.svg | 58 ++++++ nw/assets/icons/typicons_grey_dark/star.svg | 56 ++++++ .../stopwatch.svg} | 43 ++-- .../stopwatch_max.svg} | 47 ++--- nw/assets/icons/typicons_grey_dark/time.svg | 56 ++++++ nw/assets/icons/typicons_grey_dark/times.svg | 56 ++++++ nw/assets/icons/typicons_grey_dark/trash.svg | 56 ++++++ nw/assets/icons/typicons_grey_dark/user.svg | 56 ++++++ nw/assets/icons/typicons_grey_light/README.md | 17 ++ .../icons/typicons_grey_light/backspace.svg | 55 ++++++ nw/assets/icons/typicons_grey_light/book.svg | 55 ++++++ .../icons/typicons_grey_light/cancel.svg | 55 ++++++ .../icons/typicons_grey_light/delete.svg | 55 ++++++ .../typicons_grey_light/document-text.svg | 60 ++++++ .../icons/typicons_grey_light/download.svg | 54 +++++ nw/assets/icons/typicons_grey_light/flag.svg | 55 ++++++ .../icons/typicons_grey_light/folder.svg | 55 ++++++ nw/assets/icons/typicons_grey_light/globe.svg | 57 ++++++ .../icons/typicons_grey_light/globe_max.svg | 56 ++++++ .../icons/typicons_grey_light/icons.conf | 37 ++++ .../typicons_grey_light/input-checked.svg | 55 ++++++ nw/assets/icons/typicons_grey_light/key.svg | 55 ++++++ .../icons/typicons_grey_light/location.svg | 55 ++++++ nw/assets/icons/typicons_grey_light/minus.svg | 55 ++++++ .../icons/typicons_grey_light/pencil.svg | 54 +++++ nw/assets/icons/typicons_grey_light/plus.svg | 55 ++++++ .../icons/typicons_grey_light/puzzle.svg | 55 ++++++ .../typicons_grey_light/search-replace.svg | 60 ++++++ .../icons/typicons_grey_light/search.svg | 58 ++++++ nw/assets/icons/typicons_grey_light/star.svg | 55 ++++++ .../icons/typicons_grey_light/stopwatch.svg | 61 ++++++ .../typicons_grey_light/stopwatch_max.svg | 61 ++++++ nw/assets/icons/typicons_grey_light/time.svg | 55 ++++++ nw/assets/icons/typicons_grey_light/times.svg | 55 ++++++ nw/assets/icons/typicons_grey_light/trash.svg | 55 ++++++ nw/assets/icons/typicons_grey_light/user.svg | 55 ++++++ nw/config.py | 1 + nw/constants/constants.py | 12 ++ nw/gui/dialogs/configeditor.py | 2 +- nw/gui/dialogs/projecteditor.py | 2 +- nw/gui/elements/doctree.py | 11 +- nw/gui/elements/searchbar.py | 2 +- nw/gui/icons.py | 184 +++++++++++------- nw/gui/statusbar.py | 4 +- nw/gui/theme.py | 3 +- nw/guimain.py | 12 +- 69 files changed, 3114 insertions(+), 244 deletions(-) rename nw/assets/{ => graphics}/license.txt (72%) delete mode 100644 nw/assets/icons/globe-dark.svg delete mode 100644 nw/assets/icons/globe.svg create mode 100644 nw/assets/icons/typicons_grey_dark/README.md create mode 100644 nw/assets/icons/typicons_grey_dark/backspace.svg create mode 100644 nw/assets/icons/typicons_grey_dark/book.svg create mode 100644 nw/assets/icons/typicons_grey_dark/cancel.svg create mode 100644 nw/assets/icons/typicons_grey_dark/delete.svg create mode 100644 nw/assets/icons/typicons_grey_dark/document-text.svg create mode 100644 nw/assets/icons/typicons_grey_dark/download.svg create mode 100644 nw/assets/icons/typicons_grey_dark/flag.svg create mode 100644 nw/assets/icons/typicons_grey_dark/folder.svg create mode 100644 nw/assets/icons/typicons_grey_dark/globe.svg create mode 100644 nw/assets/icons/typicons_grey_dark/globe_max.svg create mode 100644 nw/assets/icons/typicons_grey_dark/icons.conf create mode 100644 nw/assets/icons/typicons_grey_dark/input-checked.svg create mode 100644 nw/assets/icons/typicons_grey_dark/key.svg create mode 100644 nw/assets/icons/typicons_grey_dark/location.svg create mode 100644 nw/assets/icons/typicons_grey_dark/minus.svg create mode 100644 nw/assets/icons/typicons_grey_dark/pencil.svg create mode 100644 nw/assets/icons/typicons_grey_dark/plus.svg create mode 100644 nw/assets/icons/typicons_grey_dark/puzzle.svg create mode 100644 nw/assets/icons/typicons_grey_dark/search-replace.svg create mode 100644 nw/assets/icons/typicons_grey_dark/search.svg create mode 100644 nw/assets/icons/typicons_grey_dark/star.svg rename nw/assets/icons/{time-dark.svg => typicons_grey_dark/stopwatch.svg} (76%) rename nw/assets/icons/{time.svg => typicons_grey_dark/stopwatch_max.svg} (72%) create mode 100644 nw/assets/icons/typicons_grey_dark/time.svg create mode 100644 nw/assets/icons/typicons_grey_dark/times.svg create mode 100644 nw/assets/icons/typicons_grey_dark/trash.svg create mode 100644 nw/assets/icons/typicons_grey_dark/user.svg create mode 100644 nw/assets/icons/typicons_grey_light/README.md create mode 100644 nw/assets/icons/typicons_grey_light/backspace.svg create mode 100644 nw/assets/icons/typicons_grey_light/book.svg create mode 100644 nw/assets/icons/typicons_grey_light/cancel.svg create mode 100644 nw/assets/icons/typicons_grey_light/delete.svg create mode 100644 nw/assets/icons/typicons_grey_light/document-text.svg create mode 100644 nw/assets/icons/typicons_grey_light/download.svg create mode 100644 nw/assets/icons/typicons_grey_light/flag.svg create mode 100644 nw/assets/icons/typicons_grey_light/folder.svg create mode 100644 nw/assets/icons/typicons_grey_light/globe.svg create mode 100644 nw/assets/icons/typicons_grey_light/globe_max.svg create mode 100644 nw/assets/icons/typicons_grey_light/icons.conf create mode 100644 nw/assets/icons/typicons_grey_light/input-checked.svg create mode 100644 nw/assets/icons/typicons_grey_light/key.svg create mode 100644 nw/assets/icons/typicons_grey_light/location.svg create mode 100644 nw/assets/icons/typicons_grey_light/minus.svg create mode 100644 nw/assets/icons/typicons_grey_light/pencil.svg create mode 100644 nw/assets/icons/typicons_grey_light/plus.svg create mode 100644 nw/assets/icons/typicons_grey_light/puzzle.svg create mode 100644 nw/assets/icons/typicons_grey_light/search-replace.svg create mode 100644 nw/assets/icons/typicons_grey_light/search.svg create mode 100644 nw/assets/icons/typicons_grey_light/star.svg create mode 100644 nw/assets/icons/typicons_grey_light/stopwatch.svg create mode 100644 nw/assets/icons/typicons_grey_light/stopwatch_max.svg create mode 100644 nw/assets/icons/typicons_grey_light/time.svg create mode 100644 nw/assets/icons/typicons_grey_light/times.svg create mode 100644 nw/assets/icons/typicons_grey_light/trash.svg create mode 100644 nw/assets/icons/typicons_grey_light/user.svg diff --git a/nw/assets/license.txt b/nw/assets/graphics/license.txt similarity index 72% rename from nw/assets/license.txt rename to nw/assets/graphics/license.txt index 1330c631..00a23f87 100644 --- a/nw/assets/license.txt +++ b/nw/assets/graphics/license.txt @@ -6,7 +6,3 @@ Applies to: * graphics/export.svg * graphics/merge.svg * graphics/split.svg - * icons/globe-dark.svg - * icons/globe.svg - * icons/time-dark.svg - * icons/time.svg diff --git a/nw/assets/icons/globe-dark.svg b/nw/assets/icons/globe-dark.svg deleted file mode 100644 index bde909f3..00000000 --- a/nw/assets/icons/globe-dark.svg +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - diff --git a/nw/assets/icons/globe.svg b/nw/assets/icons/globe.svg deleted file mode 100644 index ef97e998..00000000 --- a/nw/assets/icons/globe.svg +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - diff --git a/nw/assets/icons/typicons_grey_dark/README.md b/nw/assets/icons/typicons_grey_dark/README.md new file mode 100644 index 00000000..3686b78d --- /dev/null +++ b/nw/assets/icons/typicons_grey_dark/README.md @@ -0,0 +1,17 @@ +Typicons +---- + +Source: https://github.com/stephenhutchings/typicons.font + +License +------- + +#### Icons/Artwork + +Distributed under +[CC BY-SA](http://creativecommons.org/licenses/by-sa/3.0/) licence. + +#### Font + +Distributed under +[SIL Open Font Licence](http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web) licence. diff --git a/nw/assets/icons/typicons_grey_dark/backspace.svg b/nw/assets/icons/typicons_grey_dark/backspace.svg new file mode 100644 index 00000000..7fd677bc --- /dev/null +++ b/nw/assets/icons/typicons_grey_dark/backspace.svg @@ -0,0 +1,56 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_dark/book.svg b/nw/assets/icons/typicons_grey_dark/book.svg new file mode 100644 index 00000000..3b576f27 --- /dev/null +++ b/nw/assets/icons/typicons_grey_dark/book.svg @@ -0,0 +1,56 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_dark/cancel.svg b/nw/assets/icons/typicons_grey_dark/cancel.svg new file mode 100644 index 00000000..6d718a07 --- /dev/null +++ b/nw/assets/icons/typicons_grey_dark/cancel.svg @@ -0,0 +1,56 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_dark/delete.svg b/nw/assets/icons/typicons_grey_dark/delete.svg new file mode 100644 index 00000000..560666dd --- /dev/null +++ b/nw/assets/icons/typicons_grey_dark/delete.svg @@ -0,0 +1,56 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_dark/document-text.svg b/nw/assets/icons/typicons_grey_dark/document-text.svg new file mode 100644 index 00000000..e67fb843 --- /dev/null +++ b/nw/assets/icons/typicons_grey_dark/document-text.svg @@ -0,0 +1,61 @@ + + + + + + image/svg+xml + + + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_dark/download.svg b/nw/assets/icons/typicons_grey_dark/download.svg new file mode 100644 index 00000000..7dfffc01 --- /dev/null +++ b/nw/assets/icons/typicons_grey_dark/download.svg @@ -0,0 +1,55 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_dark/flag.svg b/nw/assets/icons/typicons_grey_dark/flag.svg new file mode 100644 index 00000000..475d7415 --- /dev/null +++ b/nw/assets/icons/typicons_grey_dark/flag.svg @@ -0,0 +1,56 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_dark/folder.svg b/nw/assets/icons/typicons_grey_dark/folder.svg new file mode 100644 index 00000000..1050ce57 --- /dev/null +++ b/nw/assets/icons/typicons_grey_dark/folder.svg @@ -0,0 +1,56 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_dark/globe.svg b/nw/assets/icons/typicons_grey_dark/globe.svg new file mode 100644 index 00000000..9394ebed --- /dev/null +++ b/nw/assets/icons/typicons_grey_dark/globe.svg @@ -0,0 +1,57 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_dark/globe_max.svg b/nw/assets/icons/typicons_grey_dark/globe_max.svg new file mode 100644 index 00000000..8966c4c9 --- /dev/null +++ b/nw/assets/icons/typicons_grey_dark/globe_max.svg @@ -0,0 +1,57 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_dark/icons.conf b/nw/assets/icons/typicons_grey_dark/icons.conf new file mode 100644 index 00000000..1cf3b306 --- /dev/null +++ b/nw/assets/icons/typicons_grey_dark/icons.conf @@ -0,0 +1,37 @@ +## +# Icons: Typicons Grey Dark +# Source: https://github.com/stephenhutchings/typicons.font +# Credit: Stephen Hutchings +## + +[Main] +name = Typicons Grey Dark +author = Stephen Hutchings +credit = Stephen Hutchings +url = https://github.com/stephenhutchings/typicons.font + +[Map] +cls_none = cancel.svg +cls_novel = book.svg +cls_plot = puzzle.svg +cls_character = user.svg +cls_world = location.svg +cls_timeline = time.svg +cls_object = key.svg +cls_entity = flag.svg +cls_custom = star.svg +cls_trash = trash.svg +proj_document = document-text.svg +proj_folder = folder.svg +status_lang = globe_max.svg +status_time = stopwatch_max.svg +delete = delete.svg +add = plus.svg +remove = minus.svg +close = times.svg +done = input-checked.svg +search = search.svg +search-replace = search-replace.svg +clear = backspace.svg +save = download.svg +edit = pencil.svg diff --git a/nw/assets/icons/typicons_grey_dark/input-checked.svg b/nw/assets/icons/typicons_grey_dark/input-checked.svg new file mode 100644 index 00000000..0bf72e27 --- /dev/null +++ b/nw/assets/icons/typicons_grey_dark/input-checked.svg @@ -0,0 +1,56 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_dark/key.svg b/nw/assets/icons/typicons_grey_dark/key.svg new file mode 100644 index 00000000..37d91a7a --- /dev/null +++ b/nw/assets/icons/typicons_grey_dark/key.svg @@ -0,0 +1,56 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_dark/location.svg b/nw/assets/icons/typicons_grey_dark/location.svg new file mode 100644 index 00000000..d429d0dd --- /dev/null +++ b/nw/assets/icons/typicons_grey_dark/location.svg @@ -0,0 +1,56 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_dark/minus.svg b/nw/assets/icons/typicons_grey_dark/minus.svg new file mode 100644 index 00000000..0cd0201c --- /dev/null +++ b/nw/assets/icons/typicons_grey_dark/minus.svg @@ -0,0 +1,56 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_dark/pencil.svg b/nw/assets/icons/typicons_grey_dark/pencil.svg new file mode 100644 index 00000000..bf1d0dab --- /dev/null +++ b/nw/assets/icons/typicons_grey_dark/pencil.svg @@ -0,0 +1,55 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_dark/plus.svg b/nw/assets/icons/typicons_grey_dark/plus.svg new file mode 100644 index 00000000..8b7f4a6d --- /dev/null +++ b/nw/assets/icons/typicons_grey_dark/plus.svg @@ -0,0 +1,56 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_dark/puzzle.svg b/nw/assets/icons/typicons_grey_dark/puzzle.svg new file mode 100644 index 00000000..719497cb --- /dev/null +++ b/nw/assets/icons/typicons_grey_dark/puzzle.svg @@ -0,0 +1,56 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_dark/search-replace.svg b/nw/assets/icons/typicons_grey_dark/search-replace.svg new file mode 100644 index 00000000..048de135 --- /dev/null +++ b/nw/assets/icons/typicons_grey_dark/search-replace.svg @@ -0,0 +1,60 @@ + + + + + + image/svg+xml + + + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_dark/search.svg b/nw/assets/icons/typicons_grey_dark/search.svg new file mode 100644 index 00000000..5ea743b8 --- /dev/null +++ b/nw/assets/icons/typicons_grey_dark/search.svg @@ -0,0 +1,58 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_dark/star.svg b/nw/assets/icons/typicons_grey_dark/star.svg new file mode 100644 index 00000000..a750ffd5 --- /dev/null +++ b/nw/assets/icons/typicons_grey_dark/star.svg @@ -0,0 +1,56 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/time-dark.svg b/nw/assets/icons/typicons_grey_dark/stopwatch.svg similarity index 76% rename from nw/assets/icons/time-dark.svg rename to nw/assets/icons/typicons_grey_dark/stopwatch.svg index bdb740c1..7fbbf0d7 100644 --- a/nw/assets/icons/time-dark.svg +++ b/nw/assets/icons/typicons_grey_dark/stopwatch.svg @@ -8,27 +8,28 @@ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.2" - width="21" - height="21" - viewBox="0 0 21 21" - id="svg1039" - sodipodi:docname="time-dark.svg" - inkscape:version="0.92.4 (5da689c313, 2019-01-14)"> + width="24" + height="24" + viewBox="0 0 24 24" + id="svg7030" + sodipodi:docname="stopwatch.svg" + inkscape:version="1.0rc1 (09960d6f05, 2020-04-09)"> + id="metadata7036"> image/svg+xml - + + id="defs7034" /> + inkscape:current-layer="svg7030" /> diff --git a/nw/assets/icons/time.svg b/nw/assets/icons/typicons_grey_dark/stopwatch_max.svg similarity index 72% rename from nw/assets/icons/time.svg rename to nw/assets/icons/typicons_grey_dark/stopwatch_max.svg index 920d9bd7..7d489bae 100644 --- a/nw/assets/icons/time.svg +++ b/nw/assets/icons/typicons_grey_dark/stopwatch_max.svg @@ -8,27 +8,28 @@ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.2" - width="21" - height="21" - viewBox="0 0 21 21" - id="svg1039" - sodipodi:docname="time.svg" - inkscape:version="0.92.4 (5da689c313, 2019-01-14)"> + width="24" + height="24" + viewBox="0 0 24 24" + id="svg7030" + sodipodi:docname="stopwatch_max.svg" + inkscape:version="1.0rc1 (09960d6f05, 2020-04-09)"> + id="metadata7036"> image/svg+xml - + + id="defs7034" /> + inkscape:current-layer="svg7030" /> + id="g7028" + transform="matrix(1.1428571,0,0,1.1428571,-1.7142852,-2.2857137)" + style="fill:#aeaeae;fill-opacity:1"> + style="fill:#aeaeae;fill-opacity:1" /> diff --git a/nw/assets/icons/typicons_grey_dark/time.svg b/nw/assets/icons/typicons_grey_dark/time.svg new file mode 100644 index 00000000..12f47768 --- /dev/null +++ b/nw/assets/icons/typicons_grey_dark/time.svg @@ -0,0 +1,56 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_dark/times.svg b/nw/assets/icons/typicons_grey_dark/times.svg new file mode 100644 index 00000000..64410dfb --- /dev/null +++ b/nw/assets/icons/typicons_grey_dark/times.svg @@ -0,0 +1,56 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_dark/trash.svg b/nw/assets/icons/typicons_grey_dark/trash.svg new file mode 100644 index 00000000..b7728f3e --- /dev/null +++ b/nw/assets/icons/typicons_grey_dark/trash.svg @@ -0,0 +1,56 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_dark/user.svg b/nw/assets/icons/typicons_grey_dark/user.svg new file mode 100644 index 00000000..3b7cdf02 --- /dev/null +++ b/nw/assets/icons/typicons_grey_dark/user.svg @@ -0,0 +1,56 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_light/README.md b/nw/assets/icons/typicons_grey_light/README.md new file mode 100644 index 00000000..3686b78d --- /dev/null +++ b/nw/assets/icons/typicons_grey_light/README.md @@ -0,0 +1,17 @@ +Typicons +---- + +Source: https://github.com/stephenhutchings/typicons.font + +License +------- + +#### Icons/Artwork + +Distributed under +[CC BY-SA](http://creativecommons.org/licenses/by-sa/3.0/) licence. + +#### Font + +Distributed under +[SIL Open Font Licence](http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web) licence. diff --git a/nw/assets/icons/typicons_grey_light/backspace.svg b/nw/assets/icons/typicons_grey_light/backspace.svg new file mode 100644 index 00000000..16008fc7 --- /dev/null +++ b/nw/assets/icons/typicons_grey_light/backspace.svg @@ -0,0 +1,55 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_light/book.svg b/nw/assets/icons/typicons_grey_light/book.svg new file mode 100644 index 00000000..10e53ab5 --- /dev/null +++ b/nw/assets/icons/typicons_grey_light/book.svg @@ -0,0 +1,55 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_light/cancel.svg b/nw/assets/icons/typicons_grey_light/cancel.svg new file mode 100644 index 00000000..43b5ced6 --- /dev/null +++ b/nw/assets/icons/typicons_grey_light/cancel.svg @@ -0,0 +1,55 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_light/delete.svg b/nw/assets/icons/typicons_grey_light/delete.svg new file mode 100644 index 00000000..2983650a --- /dev/null +++ b/nw/assets/icons/typicons_grey_light/delete.svg @@ -0,0 +1,55 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_light/document-text.svg b/nw/assets/icons/typicons_grey_light/document-text.svg new file mode 100644 index 00000000..f4cbef49 --- /dev/null +++ b/nw/assets/icons/typicons_grey_light/document-text.svg @@ -0,0 +1,60 @@ + + + + + + image/svg+xml + + + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_light/download.svg b/nw/assets/icons/typicons_grey_light/download.svg new file mode 100644 index 00000000..fa67f171 --- /dev/null +++ b/nw/assets/icons/typicons_grey_light/download.svg @@ -0,0 +1,54 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_light/flag.svg b/nw/assets/icons/typicons_grey_light/flag.svg new file mode 100644 index 00000000..75d87698 --- /dev/null +++ b/nw/assets/icons/typicons_grey_light/flag.svg @@ -0,0 +1,55 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_light/folder.svg b/nw/assets/icons/typicons_grey_light/folder.svg new file mode 100644 index 00000000..180e26de --- /dev/null +++ b/nw/assets/icons/typicons_grey_light/folder.svg @@ -0,0 +1,55 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_light/globe.svg b/nw/assets/icons/typicons_grey_light/globe.svg new file mode 100644 index 00000000..83c97666 --- /dev/null +++ b/nw/assets/icons/typicons_grey_light/globe.svg @@ -0,0 +1,57 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_light/globe_max.svg b/nw/assets/icons/typicons_grey_light/globe_max.svg new file mode 100644 index 00000000..255ac776 --- /dev/null +++ b/nw/assets/icons/typicons_grey_light/globe_max.svg @@ -0,0 +1,56 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_light/icons.conf b/nw/assets/icons/typicons_grey_light/icons.conf new file mode 100644 index 00000000..6bd45209 --- /dev/null +++ b/nw/assets/icons/typicons_grey_light/icons.conf @@ -0,0 +1,37 @@ +## +# Icons: Typicons Grey Light +# Source: https://github.com/stephenhutchings/typicons.font +# Credit: Stephen Hutchings +## + +[Main] +name = Typicons Grey Light +author = Stephen Hutchings +credit = Stephen Hutchings +url = https://github.com/stephenhutchings/typicons.font + +[Map] +cls_none = cancel.svg +cls_novel = book.svg +cls_plot = puzzle.svg +cls_character = user.svg +cls_world = location.svg +cls_timeline = time.svg +cls_object = key.svg +cls_entity = flag.svg +cls_custom = star.svg +cls_trash = trash.svg +proj_document = document-text.svg +proj_folder = folder.svg +status_lang = globe_max.svg +status_time = stopwatch_max.svg +delete = delete.svg +add = plus.svg +remove = minus.svg +close = times.svg +done = input-checked.svg +search = search.svg +search-replace = search-replace.svg +clear = backspace.svg +save = download.svg +edit = pencil.svg diff --git a/nw/assets/icons/typicons_grey_light/input-checked.svg b/nw/assets/icons/typicons_grey_light/input-checked.svg new file mode 100644 index 00000000..ba650c23 --- /dev/null +++ b/nw/assets/icons/typicons_grey_light/input-checked.svg @@ -0,0 +1,55 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_light/key.svg b/nw/assets/icons/typicons_grey_light/key.svg new file mode 100644 index 00000000..0a0f2a38 --- /dev/null +++ b/nw/assets/icons/typicons_grey_light/key.svg @@ -0,0 +1,55 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_light/location.svg b/nw/assets/icons/typicons_grey_light/location.svg new file mode 100644 index 00000000..e5c361f7 --- /dev/null +++ b/nw/assets/icons/typicons_grey_light/location.svg @@ -0,0 +1,55 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_light/minus.svg b/nw/assets/icons/typicons_grey_light/minus.svg new file mode 100644 index 00000000..77d38693 --- /dev/null +++ b/nw/assets/icons/typicons_grey_light/minus.svg @@ -0,0 +1,55 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_light/pencil.svg b/nw/assets/icons/typicons_grey_light/pencil.svg new file mode 100644 index 00000000..1e51a280 --- /dev/null +++ b/nw/assets/icons/typicons_grey_light/pencil.svg @@ -0,0 +1,54 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_light/plus.svg b/nw/assets/icons/typicons_grey_light/plus.svg new file mode 100644 index 00000000..56efaa2a --- /dev/null +++ b/nw/assets/icons/typicons_grey_light/plus.svg @@ -0,0 +1,55 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_light/puzzle.svg b/nw/assets/icons/typicons_grey_light/puzzle.svg new file mode 100644 index 00000000..29034bd3 --- /dev/null +++ b/nw/assets/icons/typicons_grey_light/puzzle.svg @@ -0,0 +1,55 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_light/search-replace.svg b/nw/assets/icons/typicons_grey_light/search-replace.svg new file mode 100644 index 00000000..90597a8d --- /dev/null +++ b/nw/assets/icons/typicons_grey_light/search-replace.svg @@ -0,0 +1,60 @@ + + + + + + image/svg+xml + + + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_light/search.svg b/nw/assets/icons/typicons_grey_light/search.svg new file mode 100644 index 00000000..6ffb3f23 --- /dev/null +++ b/nw/assets/icons/typicons_grey_light/search.svg @@ -0,0 +1,58 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_light/star.svg b/nw/assets/icons/typicons_grey_light/star.svg new file mode 100644 index 00000000..1371ea80 --- /dev/null +++ b/nw/assets/icons/typicons_grey_light/star.svg @@ -0,0 +1,55 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_light/stopwatch.svg b/nw/assets/icons/typicons_grey_light/stopwatch.svg new file mode 100644 index 00000000..df7327c0 --- /dev/null +++ b/nw/assets/icons/typicons_grey_light/stopwatch.svg @@ -0,0 +1,61 @@ + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_light/stopwatch_max.svg b/nw/assets/icons/typicons_grey_light/stopwatch_max.svg new file mode 100644 index 00000000..129d58cf --- /dev/null +++ b/nw/assets/icons/typicons_grey_light/stopwatch_max.svg @@ -0,0 +1,61 @@ + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_light/time.svg b/nw/assets/icons/typicons_grey_light/time.svg new file mode 100644 index 00000000..9e47aa48 --- /dev/null +++ b/nw/assets/icons/typicons_grey_light/time.svg @@ -0,0 +1,55 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_light/times.svg b/nw/assets/icons/typicons_grey_light/times.svg new file mode 100644 index 00000000..ff91c26a --- /dev/null +++ b/nw/assets/icons/typicons_grey_light/times.svg @@ -0,0 +1,55 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_light/trash.svg b/nw/assets/icons/typicons_grey_light/trash.svg new file mode 100644 index 00000000..98746b48 --- /dev/null +++ b/nw/assets/icons/typicons_grey_light/trash.svg @@ -0,0 +1,55 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_light/user.svg b/nw/assets/icons/typicons_grey_light/user.svg new file mode 100644 index 00000000..d950dd25 --- /dev/null +++ b/nw/assets/icons/typicons_grey_light/user.svg @@ -0,0 +1,55 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/config.py b/nw/config.py index 4fb8278e..a9f4de3d 100644 --- a/nw/config.py +++ b/nw/config.py @@ -83,6 +83,7 @@ class Config: ## General self.guiTheme = "default" self.guiSyntax = "default_light" + self.guiIcons = "typicons_grey_light" self.guiDark = False ## Sizes diff --git a/nw/constants/constants.py b/nw/constants/constants.py index 33a6fc15..76bfc677 100644 --- a/nw/constants/constants.py +++ b/nw/constants/constants.py @@ -87,6 +87,18 @@ class nwLabels(): nwItemClass.CUSTOM : "X", nwItemClass.TRASH : "R", } + CLASS_ICON = { + nwItemClass.NO_CLASS : "cls_none", + nwItemClass.NOVEL : "cls_novel", + nwItemClass.PLOT : "cls_plot", + nwItemClass.CHARACTER : "cls_character", + nwItemClass.WORLD : "cls_world", + nwItemClass.TIMELINE : "cls_timeline", + nwItemClass.OBJECT : "cls_object", + nwItemClass.ENTITY : "cls_entity", + nwItemClass.CUSTOM : "cls_custom", + nwItemClass.TRASH : "cls_trash", + } LAYOUT_NAME = { nwItemLayout.NO_LAYOUT : "None", nwItemLayout.TITLE : "Title Page", diff --git a/nw/gui/dialogs/configeditor.py b/nw/gui/dialogs/configeditor.py index 581d7307..cb60a40e 100644 --- a/nw/gui/dialogs/configeditor.py +++ b/nw/gui/dialogs/configeditor.py @@ -238,7 +238,7 @@ class GuiConfigEditGeneralTab(QWidget): ## Backup Path self.backupPath = self.mainConf.backupPath - self.backupGetPath = QPushButton(self.theTheme.getIcon("folder"),"Select Folder") + self.backupGetPath = QPushButton(self.theTheme.getIcon("folder-open"),"Select Folder") self.backupGetPath.clicked.connect(self._backupFolder) self.backupPathRow = self.mainForm.addRow( "Backup storage location", diff --git a/nw/gui/dialogs/projecteditor.py b/nw/gui/dialogs/projecteditor.py index ffcd2516..afa5dbe5 100644 --- a/nw/gui/dialogs/projecteditor.py +++ b/nw/gui/dialogs/projecteditor.py @@ -360,7 +360,7 @@ class GuiProjectEditReplace(QWidget): self.editKey = QLineEdit() self.editValue = QLineEdit() - self.saveButton = QPushButton(self.theTheme.getIcon("save"),"") + self.saveButton = QPushButton(self.theTheme.getIcon("done"),"") self.addButton = QPushButton(self.theTheme.getIcon("add"),"") self.delButton = QPushButton(self.theTheme.getIcon("remove"),"") diff --git a/nw/gui/elements/doctree.py b/nw/gui/elements/doctree.py index e67bd1b6..a30fb856 100644 --- a/nw/gui/elements/doctree.py +++ b/nw/gui/elements/doctree.py @@ -511,6 +511,7 @@ class GuiDocTree(QTreeWidget): tHandle = nwItem.itemHandle pHandle = nwItem.parHandle + tClass = nwItem.itemClass newItem = QTreeWidgetItem([""]*4) newItem.setText(self.C_NAME, "") @@ -540,13 +541,13 @@ class GuiDocTree(QTreeWidget): newItem.setExpanded(nwItem.isExpanded) if nwItem.itemType == nwItemType.ROOT: - newItem.setIcon(self.C_NAME, self.theTheme.getIcon("root")) + newItem.setIcon(self.C_NAME, self.theTheme.getIcon(nwLabels.CLASS_ICON[tClass])) elif nwItem.itemType == nwItemType.FOLDER: - newItem.setIcon(self.C_NAME, self.theTheme.getIcon("folder")) + newItem.setIcon(self.C_NAME, self.theTheme.getIcon("proj_folder")) elif nwItem.itemType == nwItemType.FILE: - newItem.setIcon(self.C_NAME, self.theTheme.getIcon("document")) + newItem.setIcon(self.C_NAME, self.theTheme.getIcon("proj_document")) elif nwItem.itemType == nwItemType.TRASH: - newItem.setIcon(self.C_NAME, self.theTheme.getIcon("trash")) + newItem.setIcon(self.C_NAME, self.theTheme.getIcon(nwLabels.CLASS_ICON[tClass])) return newItem @@ -575,7 +576,7 @@ class GuiDocTree(QTreeWidget): self.addTopLevelItem(newItem) self.orphRoot = newItem newItem.setExpanded(True) - newItem.setIcon(self.C_NAME, self.theTheme.getIcon("orphan")) + newItem.setIcon(self.C_NAME, self.theTheme.getIcon("warning")) return def _cleanOrphanedRoot(self): diff --git a/nw/gui/elements/searchbar.py b/nw/gui/elements/searchbar.py index ad9f9e81..431bddad 100644 --- a/nw/gui/elements/searchbar.py +++ b/nw/gui/elements/searchbar.py @@ -60,7 +60,7 @@ class GuiSearchBar(QFrame): self.replaceLabel = QLabel("Replace") self.closeButton = QPushButton(self.theTheme.getIcon("close"),"") self.searchButton = QPushButton(self.theTheme.getIcon("search"),"") - self.replaceButton = QPushButton(self.theTheme.getIcon("replace"),"") + self.replaceButton = QPushButton(self.theTheme.getIcon("search-replace"),"") self.closeButton.clicked.connect(self._doClose) self.searchButton.clicked.connect(self._doSearch) diff --git a/nw/gui/icons.py b/nw/gui/icons.py index d74ae685..066d321e 100644 --- a/nw/gui/icons.py +++ b/nw/gui/icons.py @@ -26,6 +26,7 @@ """ import logging +import configparser import nw from os import path @@ -33,6 +34,7 @@ from os import path from PyQt5.QtCore import QSize from PyQt5.QtSvg import QSvgWidget from PyQt5.QtGui import QIcon, QPixmap +from PyQt5.QtWidgets import QStyle, qApp logger = logging.getLogger(__name__) @@ -44,19 +46,34 @@ class GuiIcons: # https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html # or, if there is no fallback, the variable should be None. ICON_MAP = { - "root" : "drive-harddisk", - "folder" : "folder", - "document" : "x-office-document", - "trash" : "user-trash", - "orphan" : "dialog-warning", - "save" : "document-save", - "add" : "list-add", - "remove" : "list-remove", - "close" : "edit-delete", - "search" : "edit-find", - "replace" : "edit-find-replace", - "time" : None, - "globe" : None, + "cls_none" : (QStyle.SP_DriveHDIcon, "drive-harddisk"), + "cls_novel" : (QStyle.SP_DriveHDIcon, "drive-harddisk"), + "cls_plot" : (QStyle.SP_DriveHDIcon, "drive-harddisk"), + "cls_character" : (QStyle.SP_DriveHDIcon, "drive-harddisk"), + "cls_world" : (QStyle.SP_DriveHDIcon, "drive-harddisk"), + "cls_timeline" : (QStyle.SP_DriveHDIcon, "drive-harddisk"), + "cls_object" : (QStyle.SP_DriveHDIcon, "drive-harddisk"), + "cls_entity" : (QStyle.SP_DriveHDIcon, "drive-harddisk"), + "cls_custom" : (QStyle.SP_DriveHDIcon, "drive-harddisk"), + "cls_trash" : (QStyle.SP_DriveHDIcon, "drive-harddisk"), + "proj_document" : (QStyle.SP_FileIcon, "x-office-document"), + "proj_folder" : (QStyle.SP_DirIcon, "folder"), + "status_lang" : (None, None), + "status_time" : (None, None), + ## Button Icons + "folder-open" : (QStyle.SP_DirOpenIcon, "folder-open"), + "delete" : (QStyle.SP_DialogDiscardButton, "edit-delete"), + "add" : (None, "list-add"), + "remove" : (None, "list-remove"), + "close" : (QStyle.SP_DialogCloseButton, "window-close"), + "done" : (QStyle.SP_DialogApplyButton, None), + "search" : (None, "edit-find"), + "search-replace" : (None, "edit-find-replace"), + "clear" : (QStyle.SP_LineEditClearButton, "clear_left"), + "save" : (QStyle.SP_DialogSaveButton, "document-save"), + "edit" : (None, None), + ## Other Icons + "warning" : (QStyle.SP_MessageBoxWarning, "dialog-warning"), } DECO_MAP = { @@ -73,28 +90,75 @@ class GuiIcons: self.theParent = theParent # Storage - self.qIcons = {} + self.qIcons = {} + self.themeMap = {} - # Look for files in - self.priPath = "" # The gui theme's icon folder - self.secPath = "" # The main assets icon folder - self.prefDark = False # Load dark icons, if available + # Icon Theme Path + self.iconPath = None + self.confFile = None + + # Icon Theme Meta + self.themeName = "" + self.themeAuthor = "" + self.themeCredit = "" + self.themeUrl = "" return - def initIcons(self, priPath): - """Load all icons listed in the icon map. Can be overridden by - the selected theme. - """ + ## + # Actions + ## - self.priPath = priPath - self.secPath = self.mainConf.iconPath - self.prefDark = self.mainConf.guiDark + def updateTheme(self): - for iconKey in self.ICON_MAP.keys(): - self.qIcons[iconKey] = self._loadIcon(iconKey) + logger.debug("Loading icon theme files") - return + self.themeMap = {} + checkPath = path.join(self.mainConf.iconPath, self.mainConf.guiIcons) + if path.isdir(checkPath): + logger.debug("Loading icon theme '%s'" % self.mainConf.guiIcons) + self.iconPath = checkPath + self.confFile = path.join(checkPath, "icons.conf") + else: + return False + + # Config File + confParser = configparser.ConfigParser() + try: + confParser.read_file(open(self.confFile, mode="r", encoding="utf8")) + except Exception as e: + logger.error("Could not load icon theme settings from: %s" % self.confFile) + return False + + ## Main + cnfSec = "Main" + if confParser.has_section(cnfSec): + self.themeName = self._parseLine( confParser, cnfSec, "name", "") + self.themeAuthor = self._parseLine( confParser, cnfSec, "author", "") + self.themeCredit = self._parseLine( confParser, cnfSec, "credit", "") + self.themeUrl = self._parseLine( confParser, cnfSec, "url", "") + + ## Palette + cnfSec = "Map" + if confParser.has_section(cnfSec): + for iconName, iconFile in confParser.items(cnfSec): + if iconName not in self.ICON_MAP: + logger.error("Unknown icon name '%s' in config file" % iconName) + else: + iconPath = path.join(self.iconPath, iconFile) + if path.isfile(iconPath): + self.themeMap[iconName] = iconPath + logger.verbose("Icon slot '%s' using file '%s'" % (iconName, iconFile)) + else: + logger.error("Icon file '%s' not in theme folder" % iconFile) + + logger.info("Loaded icon theme '%s'" % self.mainConf.guiIcons) + + return True + + ## + # Access Functions + ## def loadDecoration(self, decoKey, decoSize=None): """Load graphical decoration element based on the decoration @@ -122,19 +186,22 @@ class GuiIcons: def getIcon(self, iconKey, iconSize=None): """Return an icon from the icon buffer. If it doesn't exist, - return an empty icon. + return, load it, and if it still doesn't exist, return an empty + icon. """ if iconKey in self.qIcons: return self.qIcons[iconKey] - return QIcon() + else: + qIcon = self._loadIcon(iconKey) + self.qIcons[iconKey] = qIcon + return qIcon def getPixmap(self, iconKey, iconSize): """Return an icon from the icon buffer as a QPixmap. If it doesn't exist, return an empty QPixmap. """ - if iconKey in self.qIcons: - return self.qIcons[iconKey].pixmap(iconSize[0], iconSize[1], QIcon.Normal) - return QPixmap() + qIcon = self.getIcon(iconKey) + return qIcon.pixmap(iconSize[0], iconSize[1], QIcon.Normal) ## # Internal Functions @@ -148,49 +215,32 @@ class GuiIcons: """ if iconKey not in self.ICON_MAP: - logger.error("Icon with name '%s' does not exist" % iconKey) + logger.error("Requested unknown icon name '%s'" % iconKey) return QIcon() - if self.prefDark: - iconSuffix = "dark" - else: - iconSuffix = "light" + if iconKey in self.themeMap: + logger.verbose("Loading: %s" % self.themeMap[iconKey]) + return QIcon(self.themeMap[iconKey]) - iconNames = [] - iconNames.append("%s-%s.svg" % (iconKey, iconSuffix)) - iconNames.append("%s-%s.png" % (iconKey, iconSuffix)) - iconNames.append("%s.svg" % iconKey) - iconNames.append("%s.png" % iconKey) - - # Check theme folder - loadFrom = None - for iconName in iconNames: - checkPath = path.join(self.priPath, iconName) - if path.isfile(checkPath): - loadFrom = checkPath - logger.verbose("Loading icon '%s' from theme" % iconName) - break - if loadFrom is not None: - return QIcon(loadFrom) - - # Check assets folder - for iconName in iconNames: - checkPath = path.join(self.secPath, iconName) - if path.isfile(checkPath): - loadFrom = checkPath - logger.verbose("Loading icon '%s' from assets" % iconName) - break - if loadFrom is not None: - return QIcon(loadFrom) + # Next, we try to load the Qt style icons + if self.ICON_MAP[iconKey][0] is not None: + logger.verbose("Loading icon '%s' from Qt QStyle.standardIcon" % iconKey) + return qApp.style().standardIcon(self.ICON_MAP[iconKey][0]) # If we're still here, try to set from system theme - if self.ICON_MAP[iconKey] is not None: + if self.ICON_MAP[iconKey][1] is not None: logger.verbose("Loading icon '%s' from system theme" % iconKey) - return QIcon().fromTheme(self.ICON_MAP[iconKey]) + return QIcon().fromTheme(self.ICON_MAP[iconKey][1]) - # Give up and return an empty icomn + # Give up and return an empty icon logger.warning("Did not load an icon for '%s'" % iconKey) return QIcon() + def _parseLine(self, confParser, cnfSec, cnfName, cnfDefault): + if confParser.has_section(cnfSec): + if confParser.has_option(cnfSec, cnfName): + return confParser.get(cnfSec, cnfName) + return cnfDefault + # END Class GuiIcons diff --git a/nw/gui/statusbar.py b/nw/gui/statusbar.py index d815dd54..50f218f5 100644 --- a/nw/gui/statusbar.py +++ b/nw/gui/statusbar.py @@ -68,7 +68,7 @@ class GuiMainStatus(QStatusBar): self.timeBox.setFont(self.monoFont) self.timeIcon = QLabel() - self.timeIcon.setPixmap(self.theParent.theTheme.getPixmap("time",(14,14))) + self.timeIcon.setPixmap(self.theParent.theTheme.getPixmap("status_time",(14,14))) self.boxCounts = QLabel() self.boxCounts.setToolTip("Document Character | Word | Paragraph Count") @@ -85,7 +85,7 @@ class GuiMainStatus(QStatusBar): self.langBox = QLabel("None") self.langIcon = QLabel("") - self.langIcon.setPixmap(self.theParent.theTheme.getPixmap("globe",(14,14))) + self.langIcon.setPixmap(self.theParent.theTheme.getPixmap("status_lang",(14,14))) # Add Them self.addPermanentWidget(self.langIcon) diff --git a/nw/gui/theme.py b/nw/gui/theme.py index 0e4e5eaf..b2f11357 100644 --- a/nw/gui/theme.py +++ b/nw/gui/theme.py @@ -106,6 +106,7 @@ class GuiTheme: self.cssFile = None self.updateTheme() + self.theIcons.updateTheme() self.getIcon = self.theIcons.getIcon self.getPixmap = self.theIcons.getPixmap @@ -133,8 +134,6 @@ class GuiTheme: self.confFile = path.join(self.themePath,self.confName) self.cssFile = path.join(self.themePath,self.cssName) - self.theIcons.initIcons(path.join(self.themePath,self.iconPath)) - self.loadTheme() self.loadSyntax() diff --git a/nw/guimain.py b/nw/guimain.py index 2f1380bd..00dc3f7d 100644 --- a/nw/guimain.py +++ b/nw/guimain.py @@ -58,11 +58,6 @@ class GuiMain(QMainWindow): logger.info("Starting %s" % nw.__package__) logger.debug("Initialising GUI ...") self.mainConf = nw.CONFIG - self.theTheme = GuiTheme(self) - self.theProject = NWProject(self) - self.theIndex = NWIndex(self.theProject, self) - self.hasProject = False - self.isZenMode = False # Some runtime info useful for debugging logger.info("OS: %s" % self.mainConf.osType) @@ -78,6 +73,13 @@ class GuiMain(QMainWindow): self.mainConf.verPyString, self.mainConf.verPyHexVal) ) + # Core Classes and settings + self.theTheme = GuiTheme(self) + self.theProject = NWProject(self) + self.theIndex = NWIndex(self.theProject, self) + self.hasProject = False + self.isZenMode = False + # Prepare main window self.resize(*self.mainConf.winGeometry) self._setWindowTitle()