main: remove rendering options from main context
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Daniel Eklöf · committed by Daniel Eklöf · parent 32a1f95 · Browse files · 1 file·+7 added−25 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+7 added−25 removed
- other:+7 added−25 removed
Provenance
- Commit
a61eb3e- Tree
df6b9b2- Author
Daniel Eklöf <daniel@ekloef.se>- Committer
Daniel Eklöf <daniel@ekloef.se>- Parent
32a1f95
1 file changed+7 added−25 removed
modified:main.c+7 added-25 removed
107 unmodified lines108 109 /* Window configuration */110 int width;111 int height;112- const double x_margin;113- const double y_margin;114- const double border_size;115- struct { double r, g, b, a; } border_color;116- struct { double r, g, b, a; } background;112 };113 114 static int max_matches;115 952 unmodified lines1068 const char *font_name = "monospace";1069 1070 int width = 500;1071 int height = 300;1072+ const int x_margin = 20;1073+ const int y_margin = 4;1074 int border_width = 1;1075 uint32_t text_color = 0xffffffff;1076 uint32_t match_color = 0xcc9393ff;1077 uint32_t background = 0x000000ff;101 unmodified lines1179 .cmd = REPEAT_STOP,1180 },1181 .width = width,1182 .height = height,1186- .x_margin = 20,1187- .y_margin = 4,1188- .border_size = border_width,1189- .background = {1190- (double)((background >> 24) & 0xff) / 255.0,1191- (double)((background >> 16) & 0xff) / 255.0,1192- (double)((background >> 8) & 0xff) / 255.0,1193- (double)((background >> 0) & 0xff) / 255.0,1194- },1195- .border_color = {1196- (double)((border_color >> 24) & 0xff) / 255.0,1197- (double)((border_color >> 16) & 0xff) / 255.0,1198- (double)((border_color >> 8) & 0xff) / 255.0,1199- (double)((border_color >> 0) & 0xff) / 255.0,1200- },1183 };1184 1185 mtx_init(&c.repeat.mutex, mtx_plain);1186 cnd_init(&c.repeat.cond);113 unmodified lines1300 wl_surface_commit(c.wl.surface);1301 wl_display_roundtrip(c.wl.display);1302 1303 const int scale = c.wl.monitor->scale;1322- const double line_height = scale * 2 * c.y_margin + fextents.height;1323- max_matches = (scale * height - scale * 2 * c.border_size - line_height) /1304+ const double line_height = scale * 2 * y_margin + fextents.height;1305+ max_matches = (scale * height - scale * 2 * border_width - line_height) /1306 line_height;1307 LOG_DBG("max matches: %d", max_matches);1308 1309 struct options options = {1310 .width = scale * c.width,1311 .height = scale * c.height,1330- .x_margin = scale * c.x_margin,1331- .y_margin = scale * c.y_margin,1332- .border_size = scale * c.border_size,1312+ .x_margin = scale * x_margin,1313+ .y_margin = scale * y_margin,1314+ .border_size = scale * border_width,1315 .background_color = hex_to_rgba(background),1316 .border_color = hex_to_rgba(border_color),1317 .text_color = hex_to_rgba(text_color),1318 .match_color = hex_to_rgba(match_color),110 unmodified lines