Revert "switch from GdkColor -> GdkRGBA"

This reverts commit 172a79223b.

temporary revert - default color calculation needs to be updated
This commit is contained in:
Daniel Micay 2013-10-12 19:24:14 -04:00
parent 172a79223b
commit 6da9e28e20
1 changed files with 13 additions and 13 deletions

View File

@ -1046,10 +1046,10 @@ auto get_config_string(std::bind(get_config<char *>, g_key_file_get_string,
auto get_config_double(std::bind(get_config<double>, g_key_file_get_double,
_1, _2, _3));
static maybe<GdkRGBA> get_config_color(GKeyFile *config, const char *section, const char *key) {
static maybe<GdkColor> get_config_color(GKeyFile *config, const char *section, const char *key) {
if (auto s = get_config_string(config, section, key)) {
GdkRGBA color;
if (gdk_rgba_parse(&color, *s)) {
GdkColor color;
if (gdk_color_parse(*s, &color)) {
g_free(*s);
return color;
}
@ -1070,7 +1070,7 @@ get_config_cairo_color(GKeyFile *config, const char *group, const char *key) {
}
static void load_theme(GtkWindow *window, VteTerminal *vte, GKeyFile *config, hint_info &hints) {
std::array<GdkRGBA, 255> palette;
std::array<GdkColor, 255> palette;
char color_key[] = "color000";
for (unsigned i = 0; i < palette.size(); i++) {
@ -1101,26 +1101,26 @@ static void load_theme(GtkWindow *window, VteTerminal *vte, GKeyFile *config, hi
}
}
vte_terminal_set_colors_rgba(vte, nullptr, nullptr, palette.data(), palette.size());
vte_terminal_set_colors(vte, nullptr, nullptr, palette.data(), palette.size());
if (auto color = get_config_color(config, "colors", "foreground")) {
vte_terminal_set_color_foreground_rgba(vte, &*color);
vte_terminal_set_color_bold_rgba(vte, &*color);
vte_terminal_set_color_foreground(vte, &*color);
vte_terminal_set_color_bold(vte, &*color);
}
if (auto color = get_config_color(config, "colors", "foreground_bold")) {
vte_terminal_set_color_bold_rgba(vte, &*color);
vte_terminal_set_color_bold(vte, &*color);
}
if (auto color = get_config_color(config, "colors", "foreground_dim")) {
vte_terminal_set_color_dim_rgba(vte, &*color);
vte_terminal_set_color_dim(vte, &*color);
}
if (auto color = get_config_color(config, "colors", "background")) {
vte_terminal_set_color_background_rgba(vte, &*color);
gtk_widget_override_background_color(GTK_WIDGET(window), GTK_STATE_FLAG_NORMAL, &*color);
vte_terminal_set_color_background(vte, &*color);
gtk_widget_modify_bg((GtkWidget *)window, GTK_STATE_NORMAL, &*color);
}
if (auto color = get_config_color(config, "colors", "cursor")) {
vte_terminal_set_color_cursor_rgba(vte, &*color);
vte_terminal_set_color_cursor(vte, &*color);
}
if (auto color = get_config_color(config, "colors", "highlight")) {
vte_terminal_set_color_highlight_rgba(vte, &*color);
vte_terminal_set_color_highlight(vte, &*color);
}
if (auto s = get_config_string(config, "hints", "font")) {