Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8c694d25 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo
Browse files

perf ui: Introduce routine ui_browser__is_current_entry



Will be used in more places in the new tree widget.

Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent bfde7448
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -270,6 +270,11 @@ struct ui_browser {
	u32		nr_entries;
};

static bool ui_browser__is_current_entry(struct ui_browser *self, unsigned row)
{
	return (self->first_visible_entry_idx + row) == self->index;
}

static void ui_browser__refresh_dimensions(struct ui_browser *self)
{
	int cols, rows;
@@ -353,7 +358,7 @@ static int ui_browser__refresh_entries(struct ui_browser *self)
	pos = list_entry(self->first_visible_entry, struct objdump_line, node);

	list_for_each_entry_from(pos, head, node) {
		bool current_entry = (self->first_visible_entry_idx + row) == self->index;
		bool current_entry = ui_browser__is_current_entry(self, row);
		SLsmg_gotorc(self->top + row, self->left);
		objdump_line__show(pos, head, self->width,
				   he, len, current_entry);