Make default dialog entries use GTK_STATE_INSENSITIVE color not

a fixed color (Suggestion by Ditmar Zhekov)


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5064 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Lex Trotman 2010-06-24 06:39:24 +00:00
parent 4476a79127
commit 3d361d3c55
2 changed files with 11 additions and 6 deletions

View File

@ -1,3 +1,10 @@
2010-06-24 Lex Trotman <elextr(at)gmail(dot)com>
* src/build.c
Make default dialog entries use GTK_STATE_INSENSITIVE color not
a fixed color (Suggestion by Ditmar Zhekov)
2010-06-23 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com> 2010-06-23 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/search.c, doc/geany.txt, doc/geany.html: * src/search.c, doc/geany.txt, doc/geany.html:

View File

@ -1732,6 +1732,7 @@ typedef struct RowWidgets
gboolean used_dst; gboolean used_dst;
} RowWidgets; } RowWidgets;
static GdkColor *insensitive_color;
static void set_row_color(RowWidgets *r, GdkColor *color ) static void set_row_color(RowWidgets *r, GdkColor *color )
{ {
@ -1756,7 +1757,6 @@ static void on_clear_dialog_row(GtkWidget *unused, gpointer user_data)
RowWidgets *r = (RowWidgets*)user_data; RowWidgets *r = (RowWidgets*)user_data;
gint src; gint src;
enum GeanyBuildCmdEntries i; enum GeanyBuildCmdEntries i;
GdkColor color;
GeanyBuildCommand *bc = get_next_build_cmd(NULL, r->grp, r->cmd, r->dst, &src); GeanyBuildCommand *bc = get_next_build_cmd(NULL, r->grp, r->cmd, r->dst, &src);
if (bc != NULL) if (bc != NULL)
@ -1778,8 +1778,7 @@ static void on_clear_dialog_row(GtkWidget *unused, gpointer user_data)
} }
} }
r->used_dst = FALSE; r->used_dst = FALSE;
gdk_color_parse("grey", &color); set_row_color(r, insensitive_color);
set_row_color(r, &color);
r->cleared = TRUE; r->cleared = TRUE;
} }
@ -1840,9 +1839,9 @@ static RowWidgets *build_add_dialog_row(GeanyDocument *doc, GtkTable *table, gui
gint src; gint src;
enum GeanyBuildCmdEntries i; enum GeanyBuildCmdEntries i;
guint column = 0; guint column = 0;
GdkColor color;
label = gtk_label_new(g_strdup_printf("%d:", cmd + 1)); label = gtk_label_new(g_strdup_printf("%d:", cmd + 1));
insensitive_color = &(gtk_widget_get_style(label)->text[GTK_STATE_INSENSITIVE]);
gtk_table_attach(table, label, column, column + 1, row, row + 1, GTK_FILL, gtk_table_attach(table, label, column, column + 1, row, row + 1, GTK_FILL,
GTK_FILL | GTK_EXPAND, entry_x_padding, entry_y_padding); GTK_FILL | GTK_EXPAND, entry_x_padding, entry_y_padding);
roww = g_new0(RowWidgets, 1); roww = g_new0(RowWidgets, 1);
@ -1894,9 +1893,8 @@ static RowWidgets *build_add_dialog_row(GeanyDocument *doc, GtkTable *table, gui
} }
set_build_command_entry_text(roww->entries[i], str); set_build_command_entry_text(roww->entries[i], str);
} }
gdk_color_parse("grey", &color);
if (bc != NULL && ((gint)dst > src)) if (bc != NULL && ((gint)dst > src))
set_row_color(roww, &color); set_row_color(roww, insensitive_color);
if (bc != NULL && (src > (gint)dst || (grp == GEANY_GBG_FT && (doc == NULL || doc->file_type == NULL)))) if (bc != NULL && (src > (gint)dst || (grp == GEANY_GBG_FT && (doc == NULL || doc->file_type == NULL))))
{ {
for (i = 0; i < GEANY_BC_CMDENTRIES_COUNT; i++) for (i = 0; i < GEANY_BC_CMDENTRIES_COUNT; i++)