dfhack fork
 
 
 
 
 
 
Go to file
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
.github Apply initial pre-commit config 2022-04-12 14:48:19 -04:00
CMake Apply initial pre-commit config 2022-04-12 14:48:19 -04:00
build Apply initial pre-commit config 2022-04-12 14:48:19 -04:00
ci Add script to rebuild PRs on Buildmaster 2022-03-31 16:51:42 -04:00
data Apply initial pre-commit config 2022-04-12 14:48:19 -04:00
depends update clsocket submodule 2022-03-10 14:17:25 -08:00
dfhack-config Apply initial pre-commit config 2022-04-12 14:48:19 -04:00
docs add scroll icons to Label widget (#2101) 2022-04-29 06:55:08 -07:00
library add scroll icons to Label widget (#2101) 2022-04-29 06:55:08 -07:00
package Apply initial pre-commit config 2022-04-12 14:48:19 -04:00
plugins Adds plugins/external/ and auto-populates the cmake within upon creation (#2095) 2022-04-27 19:53:05 -07:00
scripts@d9e390cd55 Auto-update submodules 2022-04-23 07:17:26 +00:00
test Apply initial pre-commit config 2022-04-12 14:48:19 -04:00
travis Add stubs in travis/ to call ci/ scripts 2021-09-05 23:08:01 -04:00
.gitignore Adds plugins/external/ and auto-populates the cmake within upon creation (#2095) 2022-04-27 19:53:05 -07:00
.gitmodules Disable shallow clones in .gitmodules 2021-08-11 21:54:05 -04:00
.pre-commit-config.yaml [pre-commit.ci] pre-commit autoupdate 2022-04-18 17:36:17 -07:00
.ycm_extra_conf.py Use jsoncpp 1.8.4 as a submodule 2018-06-14 21:20:46 +03:00
CMakeLists.txt Improves support for dfhack as a sub-project (#2058) 2022-03-29 10:28:52 -07:00
CMakeSettings.json Get intellisense and code analysis working in CMakeSettings.json. 2018-07-23 16:14:22 -05:00
LICENSE.rst add luacov link to license list, install luacov 2021-03-07 08:15:05 -08:00
README.html Apply initial pre-commit config 2022-04-12 14:48:19 -04:00
README.md Update chat links in readme (#2090) 2022-04-11 00:38:14 -04:00
conf.py Apply initial pre-commit config 2022-04-12 14:48:19 -04:00
dfhack.init-example Add workorder-recheck keybinding, update scripts 2021-01-03 22:12:20 -05:00
index.rst Move support channels to a separate page and update 2021-06-15 00:03:24 -04:00
onLoad.init-example Remove warn-stuck-trees from onLoad.init-example 2017-12-23 20:49:24 -05:00

README.md

DFHack Readme

Build Status Documentation Status License Discord

DFHack is a Dwarf Fortress memory access library, distributed with scripts and plugins implementing a wide variety of useful functions and tools.

The full documentation is available online here, from the README.html page in the DFHack distribution, or as raw text in the ./docs folder. If you're an end-user, modder, or interested in contributing to DFHack - go read those docs.

If that's unclear, or you need more help checkout our support page for up-to-date options.