diff options
author | Jesse Luehrs <doy@tozt.net> | 2014-04-28 00:02:17 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2014-04-28 00:02:17 -0400 |
commit | 73a64ae0a462241626105906ed6d2a24e62f7b55 (patch) | |
tree | 2edf06a39da2330435967575342fe51142538662 | |
parent | 7e863cafd9f4c40893eb0e4d9e9883e54ab19255 (diff) | |
download | runes-73a64ae0a462241626105906ed6d2a24e62f7b55.tar.gz runes-73a64ae0a462241626105906ed6d2a24e62f7b55.zip |
make the cursor color configurable
-rw-r--r-- | src/config.c | 10 | ||||
-rw-r--r-- | src/display.c | 3 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/config.c b/src/config.c index 09b2542..d81f93e 100644 --- a/src/config.c +++ b/src/config.c @@ -26,6 +26,7 @@ void runes_config_cleanup(RunesTerm *t) int i; free(t->font_name); + cairo_pattern_destroy(t->cursorcolor); cairo_pattern_destroy(t->mousecursorcolor); cairo_pattern_destroy(t->fgdefault); cairo_pattern_destroy(t->bgdefault); @@ -44,6 +45,7 @@ static void runes_config_set_defaults(RunesTerm *t) t->audible_bell = 1; t->bell_is_urgent = 1; + t->cursorcolor = cairo_pattern_create_rgb(0.0, 1.0, 0.0); t->mousecursorcolor = cairo_pattern_create_rgb(1.0, 1.0, 1.0); t->fgdefault = cairo_pattern_create_rgb(0.827, 0.827, 0.827); @@ -453,6 +455,14 @@ static void runes_config_set(RunesTerm *t, char *key, char *val) t->fgdefault = newcolor; } } + else if (!strcmp(key, "cursorcolor")) { + cairo_pattern_t *newcolor; + newcolor = runes_config_parse_color(val); + if (newcolor) { + cairo_pattern_destroy(t->cursorcolor); + t->cursorcolor = newcolor; + } + } else if (!strcmp(key, "mousecursorcolor")) { cairo_pattern_t *newcolor; newcolor = runes_config_parse_color(val); diff --git a/src/display.c b/src/display.c index e6cb1d9..e2ffd59 100644 --- a/src/display.c +++ b/src/display.c @@ -15,8 +15,6 @@ static void runes_display_draw_glyph( void runes_display_init(RunesTerm *t) { runes_display_recalculate_font_metrics(t); - - t->cursorcolor = cairo_pattern_create_rgb(0.0, 1.0, 0.0); } void runes_display_set_window_size(RunesTerm *t) @@ -148,7 +146,6 @@ void runes_display_cleanup(RunesTerm *t) if (t->bgcustom) { cairo_pattern_destroy(t->bgcustom); } - cairo_pattern_destroy(t->cursorcolor); cairo_destroy(t->cr); } |