Skip to content

Commit

Permalink
Fix scrolling and focus reallocation
Browse files Browse the repository at this point in the history
  • Loading branch information
mavam committed May 3, 2023
1 parent 5b78fe2 commit 61d8134
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/tui/src/components.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ auto RecordHeader(std::string top, const struct theme& theme) -> Component {
top_color = color(theme.palette.text),
focus_color = theme.focus_color()](bool focused) mutable {
auto header = text(top_text) | bold | center;
return focused ? header | focus_color : header | top_color;
return focused ? header | focus | focus_color : header | top_color;
});
}

Expand Down
5 changes: 3 additions & 2 deletions plugins/tui/src/ui_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ auto Header(std::string top, std::string bottom, int height,
return Renderer([height, &theme, top_text = std::move(top),
bottom_text = std::move(bottom)](bool focused) mutable {
auto header = text(top_text) | bold | center;
header |= focused ? theme.focus_color() : color(theme.palette.text);
header |= focused ? focus | theme.focus_color() : color(theme.palette.text);
auto element = vbox({
filler(),
std::move(header),
Expand All @@ -47,7 +47,8 @@ auto Cell(view<data> v, const struct theme& theme) -> Component {
auto focus_color = theme.focus_color();
return Renderer([=, element = text(to_string(x)),
normal_color = color(data_color)](bool focused) {
auto value = focused ? element | focus_color : element | normal_color;
auto value
= focused ? element | focus | focus_color : element | normal_color;
switch (align) {
case left:
return value;
Expand Down

0 comments on commit 61d8134

Please sign in to comment.