Skip to content

Commit 41dfb1c

Browse files
committed
[timeline] use a background color for timeline bars instead of reverse-video
1 parent dbbfe01 commit 41dfb1c

52 files changed

Lines changed: 1622 additions & 1418 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

NEWS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,9 @@ Features:
203203
The `:hide-in-timeline` command supports live preview,
204204
highlighting rows that would be hidden in red.
205205
* The `timestamp-point-of-reference` log format property
206-
has been added to specify the related of the timestamp
206+
has been added to specify the relation of the timestamp
207207
to the operation that the message refers to, either:
208-
start or send. This is used in conjunction with the
208+
`start` or `end`. This is used in conjunction with the
209209
message duration to determine the time span.
210210
* The OPID for log messages is now shown in the parser
211211
details overlay (revealed by pressing `p`) in the

TESTS_ENVIRONMENT.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ export top_builddir
1919
builddir=`pwd -P`
2020
export builddir
2121

22+
top_builddir_abs=`dirname ${builddir}`
23+
export top_builddir_abs
24+
2225
LNAV_VERSION=`${top_builddir}/src/lnav-test -V`
2326
export LNAV_VERSION
2427

@@ -122,6 +125,7 @@ run_cap_test() {
122125
-e "s;${LNAV_VERSION};{LNAV_VERSION};g" \
123126
-e "s;${test_dir};{test_dir};g" \
124127
-e "s;${builddir};{test_dir};g" \
128+
-e "s;${top_builddir_abs};{buildir};g" \
125129
-e "s;${ROOT_DIR};{root_dir};g" \
126130
-e "s;${top_srcdir};{top_srcdir};g" \
127131
-e "s;${top_srcdir_parent};{top_srcdir_parent};g" \
@@ -157,6 +161,7 @@ run_cap_test() {
157161
-e "s;${test_dir};{test_dir};g" \
158162
-e "s;${ROOT_DIR};{root_dir};g" \
159163
-e "s;${builddir};{builddir};g" \
164+
-e "s;${top_builddir_abs};{buildir};g" \
160165
-e "s;${top_srcdir};{top_srcdir};g" \
161166
-e "s;${TMPDIR};{TMPDIR};g" \
162167
-e "s;/tmp/;{TMPDIR};g" \

docs/schemas/config-v1.schema.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,11 @@
770770
"description": "Styling for indent guide lines",
771771
"title": "/ui/theme-defs/<theme_name>/styles/indent-guide",
772772
"$ref": "#/definitions/style"
773+
},
774+
"timeline-bar": {
775+
"description": "Styling for timeline duration bars",
776+
"title": "/ui/theme-defs/<theme_name>/styles/timeline-bar",
777+
"$ref": "#/definitions/style"
773778
}
774779
},
775780
"additionalProperties": false

src/base/lnav.console.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,9 @@ role_to_style(const role_t role,
454454
case role_t::VCR_H6:
455455
line_style |= fmt::emphasis::underline;
456456
break;
457+
case role_t::VCR_TABLE_HEADER:
458+
line_style |= fmt::emphasis::bold;
459+
break;
457460
case role_t::VCR_LIST_GLYPH:
458461
line_style |= fmt::fg(fmt::terminal_color::yellow);
459462
break;
@@ -478,6 +481,9 @@ role_to_style(const role_t role,
478481
case role_t::VCR_SPECTRO_THRESHOLD6:
479482
line_style |= fmt::bg(fmt::terminal_color::red);
480483
break;
484+
case role_t::VCR_TIMELINE_BAR:
485+
line_style |= fmt::bg(fmt::terminal_color::magenta);
486+
break;
481487
default:
482488
// log_debug("missing role handler %d", (int) role);
483489
break;

src/base/string_attr_type.hh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ enum class role_t : int32_t {
195195
VCR_SPECTRO_THRESHOLD5,
196196
VCR_SPECTRO_THRESHOLD6,
197197

198+
VCR_TIMELINE_BAR,
199+
198200
VCR__MAX
199201
};
200202

src/db_sub_source.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,9 +1308,9 @@ db_overlay_source::list_static_overlay(const listview_curses& lv,
13081308

13091309
line_range lr(0);
13101310

1311+
sa.emplace_back(lr, VC_ROLE.value(role_t::VCR_TABLE_HEADER));
13111312
sa.emplace_back(
13121313
lr,
1313-
VC_STYLE.value(text_attrs::with_styles(text_attrs::style::bold,
1314-
text_attrs::style::underline)));
1314+
VC_STYLE.value(text_attrs::with_styles(text_attrs::style::underline)));
13151315
return true;
13161316
}

src/lnav.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,13 @@ make it easier to navigate through files quickly.
645645
.append("Paths"_h2)
646646
.append("\n ")
647647
.append("\u2022"_list_glyph)
648+
.append(" This binary:\n")
649+
.append(" ")
650+
.append(":compass:"_emoji)
651+
.append(" ")
652+
.append(lnav::roles::file(lnav::filesystem::self_path().value_or("/")))
653+
.append("\n ")
654+
.append("\u2022"_list_glyph)
648655
.append(" Format files are read from:")
649656
.append("\n ")
650657
.append(":open_file_folder:"_emoji)

src/lnav_config.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,10 @@ static const struct json_path_container theme_styles_handlers = {
966966
.with_description("Styling for indent guide lines")
967967
.for_child(&lnav_theme::lt_style_indent_guide)
968968
.with_children(style_config_handlers),
969+
yajlpp::property_handler("timeline-bar")
970+
.with_description("Styling for timeline duration bars")
971+
.for_child(&lnav_theme::lt_style_timeline_bar)
972+
.with_children(style_config_handlers),
969973
};
970974

971975
static const struct json_path_container theme_syntax_styles_handlers = {

src/styling.hh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ struct lnav_theme {
195195
positioned_property<style_config> lt_style_footnote_text;
196196
positioned_property<style_config> lt_style_snippet_border;
197197
positioned_property<style_config> lt_style_indent_guide;
198+
positioned_property<style_config> lt_style_timeline_bar;
198199
std::map<log_level_t, positioned_property<style_config>> lt_level_styles;
199200
std::map<std::string, highlighter_config> lt_highlights;
200201
};

src/themes/default-theme.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@
150150
"color": "Black",
151151
"background-color": "Silver"
152152
},
153+
"timeline-bar": {
154+
"background-color": "Teal"
155+
},
153156
"focused": {
154157
"color": "Black",
155158
"background-color": "Silver"

0 commit comments

Comments
 (0)