|
diff --git a/main.c b/main.c
|
| ... |
| 18 |
#define X_OFF_FILE (X_OFF_APPS + COL_WIDTH_APPS + 2) |
18 |
#define X_OFF_FILE (X_OFF_APPS + COL_WIDTH_APPS + 2) |
| 19 |
#define Y_OFF_START 3 |
19 |
#define Y_OFF_START 3 |
| 20 |
#define Y_OFF_TITLES 1 |
20 |
#define Y_OFF_TITLES 1 |
|
|
21 |
#define Y_OFF_FOOTER 2 |
| 21 |
|
22 |
|
| 22 |
// Color Scheme |
23 |
// Color Scheme |
| 23 |
#define COLOR_TITLE (TB_YELLOW | TB_BOLD) |
24 |
#define COLOR_TITLE (TB_YELLOW | TB_BOLD) |
| ... |
| 108 |
|
109 |
|
| 109 |
void draw_categories(State *state) { |
110 |
void draw_categories(State *state) { |
| 110 |
int count = get_category_count(state); |
111 |
int count = get_category_count(state); |
| 111 |
int height = tb_height() - Y_OFF_START - 1; |
112 |
int height = tb_height() - Y_OFF_START - Y_OFF_FOOTER; |
| 112 |
for (int i = 0; i < height && (i + state->category_offset) < count; ++i) { |
113 |
for (int i = 0; i < height && (i + state->category_offset) < count; ++i) { |
| 113 |
int idx = i + state->category_offset; |
114 |
int idx = i + state->category_offset; |
| 114 |
uint16_t fg = COLOR_DEFAULT; |
115 |
uint16_t fg = COLOR_DEFAULT; |
| ... |
| 124 |
} |
125 |
} |
| 125 |
|
126 |
|
| 126 |
void draw_apps_list(State *state) { |
127 |
void draw_apps_list(State *state) { |
| 127 |
int height = tb_height() - Y_OFF_START - 1; |
128 |
int height = tb_height() - Y_OFF_START - Y_OFF_FOOTER; |
| 128 |
if (state->is_dev_mode) { |
129 |
if (state->is_dev_mode) { |
| 129 |
int i = 0; |
130 |
int i = 0; |
| 130 |
GList *l = g_list_nth(state->cached_apps, state->app_offset); |
131 |
GList *l = g_list_nth(state->cached_apps, state->app_offset); |
| ... |
| 230 |
|
231 |
|
| 231 |
struct tb_event ev; |
232 |
struct tb_event ev; |
| 232 |
while (1) { |
233 |
while (1) { |
| 233 |
int visible_height = tb_height() - Y_OFF_START - 1; |
234 |
int visible_height = tb_height() - Y_OFF_START - Y_OFF_FOOTER; |
| 234 |
if (state.category_idx < state.category_offset) { |
235 |
if (state.category_idx < state.category_offset) { |
| 235 |
state.category_offset = state.category_idx; |
236 |
state.category_offset = state.category_idx; |
| 236 |
} else if (state.category_idx >= state.category_offset + visible_height) { |
237 |
} else if (state.category_idx >= state.category_offset + visible_height) { |
| ... |