feat(backlight): Add scroll-interval (#2700)

Closes #2696

* Added `scroll-interval` option to `internal/backlight`

* Added PR to CHANGELOG.md

* Fixed indentation
This commit is contained in:
marxlaml
2022-04-27 20:53:06 +03:00
committed by GitHub
parent b5292791ef
commit 6a2d7b5dde
3 changed files with 6 additions and 2 deletions

View File

@ -33,6 +33,8 @@ namespace modules {
// Get flag to check if we should add scroll handlers for changing value
m_scroll = m_conf.get(name(), "enable-scroll", m_scroll);
m_scroll_interval = m_conf.get(name(), "scroll-interval", m_scroll_interval);
// Add formats and elements
m_formatter->add(DEFAULT_FORMAT, TAG_LABEL, {TAG_LABEL, TAG_BAR, TAG_RAMP});
@ -120,11 +122,11 @@ namespace modules {
}
void backlight_module::action_inc() {
change_value(5);
change_value(m_scroll_interval);
}
void backlight_module::action_dec() {
change_value(-5);
change_value(-m_scroll_interval);
}
void backlight_module::change_value(int value_mod) {