dfhack/docs
Timur Kelman f08a268e8a
add scroll icons to Label widget (#2101)
* WIP: add scroll icons to Label widget

It's an opt-out. The icons are rendered in the right-most column of the 1st and last row. They are only rendered when text can actually be scrolled in the corresponding direction.

WIP: Currently, the icons might overlay text characters, there is no mechanism preventing it

* gui.lua: expose the `parse_inset()` function

* refactor Label's scroll icon code

* since `render_scroll_icons` only works with a label, it's now a class function
* `update_scroll_inset` ensures `frame_inset.r` or `.l` is at least 1, according to `show_scroll_icons`
* `show_scroll_icons` has 4 possible values: `false` for no icons, `left` for icons on the first column on the left (also ensuring `frame_inset.l >= 1`), `right` - last column on the right, `DEFAULT_NIL` - same as `right` if text height greater than `frame_body.height`, else same as `false`.

* make `render_scroll_icons` always draw icons

The check now happens in `onRenderFrame`

* draw frame's background

calling `Label.super.onRenderFrame(self, dc, rect)` makes frame's background invisible for some reason

* remove trailing spaces

* fix scroll icons placed far above/below text

 With `Label.frame_inset = 1` the text could be vertically centered with plenty of space below and above,
but not all rendered. Before this change, the scroll icons would be at the very top and bottom of the frame
instead of near the first and last rendered text line.

* always `update_scroll_inset` to react to resized window

* draw scroll icons next to text

* update `Lua API.rst` with new `Label` parameters

* move comment separator up

This way every scroll related parameter is in one group

* list default values for new parameters in docs

* add missing description of `Label.scroll_keys`
2022-04-29 06:55:08 -07:00
..
_auto Ensure that docs/_auto/ exists 2018-04-02 14:14:03 -04:00
_changelogs Add an option to generate changelogs for individual versions 2018-04-05 11:55:25 -04:00
api Add rudimentary map docs with tile descriptions from @AtomicChicken 2020-07-28 00:38:22 -04:00
guides document transform behavior for buildings and keys 2022-04-01 11:00:41 -07:00
images Merge pull request #1403 from BenLubar/imgbot 2018-11-14 16:43:36 -05:00
sphinx_extensions/dfhack Make changelog "invalid line" errors include filename and location 2021-09-01 23:35:57 -04:00
styles Remove extra paragraph from generated changelogs, restore paragraph margins 2020-11-15 17:39:34 -05:00
templates Add explicit home link to sidebar 2020-07-12 00:30:28 -04:00
Authors.rst update Windows build docs for Visual C++ 2015 (#2032) 2022-03-16 13:10:00 -07:00
Binpatches.rst Apply initial pre-commit config 2022-04-12 14:48:19 -04:00
Compile.rst visual studio 2022/2019 build instructions (#2034) 2022-03-17 13:19:12 -07:00
Contributing.rst Apply initial pre-commit config 2022-04-12 14:48:19 -04:00
Core.rst document that script-paths.txt is only read at startup 2022-03-31 21:20:54 +01:00
Dev-intro.rst Update Dev-intro.rst 2021-06-15 18:18:48 -07:00
Documentation.rst Split docs conventions into subsections, add links to documentation on links 2021-08-11 19:14:36 -04:00
History.rst Update some docs links to use HTTPS 2020-10-09 19:17:59 -04:00
Installing.rst Mention some third-party Linux packages 2020-10-13 00:24:29 -04:00
Introduction.rst Move support channels to a separate page and update 2021-06-15 00:03:24 -04:00
Lua API.rst add scroll icons to Label widget (#2101) 2022-04-29 06:55:08 -07:00
Memory-research.rst Set language of some code blocks to enable syntax highlighting 2020-10-09 01:15:42 -04:00
NEWS-dev.rst Remove top-level links from TOCs 2020-07-08 02:13:37 -04:00
NEWS.rst Remove top-level links from TOCs 2020-07-08 02:13:37 -04:00
Plugins.rst Add "partial-items" tweak. 2022-04-27 11:27:11 -07:00
Remote.rst Add a Java client lib and update the name of the Python one 2021-03-06 17:31:27 -05:00
Removed.rst move fortplan docs to Removed.rst 2022-02-25 12:57:17 -08:00
Scripts.rst Misc updates, links 2020-07-08 23:46:38 -04:00
Structures-intro.rst Apply initial pre-commit config 2022-04-12 14:48:19 -04:00
Support.rst Merge branch 'master' into develop 2021-06-15 00:40:42 -04:00
build-pdf.sh Document PDF build process and add a script for it 2020-07-15 21:42:43 -04:00
build.sh Document PDF build process and add a script for it 2020-07-15 21:42:43 -04:00
changelog-placeholder.txt Replace installed hack/changelog.txt with stub 2021-03-06 12:43:31 -05:00
changelog.txt add new global function: ensure_key 2022-04-27 17:35:49 -07:00
gen_changelog.py Add gen_changelog.py compatibility shim, fix paths when run under cmake 2020-07-04 02:35:55 -04:00
index-about.rst Move changelog, license, authors into main TOC tree 2020-07-11 23:55:02 -04:00
index-dev.rst Apply initial pre-commit config 2022-04-12 14:48:19 -04:00
index.html Apply initial pre-commit config 2022-04-12 14:48:19 -04:00