[gitg] Added small icon for remotes in branches combo
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: svn-commits-list gnome org
- Subject: [gitg] Added small icon for remotes in branches combo
- Date: Tue, 23 Jun 2009 22:31:35 +0000 (UTC)
commit 05ad2c1173bea94452aa3cefe1a2d8143672183e
Author: Jesse van den Kieboom <jesse icecrew nl>
Date: Wed Jun 24 00:29:09 2009 +0200
Added small icon for remotes in branches combo
gitg/gitg-ui.xml | 6 ++++++
gitg/gitg-window.c | 13 +++++++++++--
2 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/gitg/gitg-ui.xml b/gitg/gitg-ui.xml
index 0005cc8..46bc68c 100644
--- a/gitg/gitg-ui.xml
+++ b/gitg/gitg-ui.xml
@@ -215,6 +215,12 @@
<child>
<object class="GtkComboBox" id="combo_box_branches">
<child>
+ <object class="GtkCellRendererPixbuf" id="branches_renderer_icon"/>
+ <attributes>
+ <attribute name="stock-id">2</attribute>
+ </attributes>
+ </child>
+ <child>
<object class="GtkCellRendererText" id="branches_renderer"/>
<attributes>
<attribute name="text">0</attribute>
diff --git a/gitg/gitg-window.c b/gitg/gitg-window.c
index 71d1ec7..6f9ef80 100644
--- a/gitg/gitg-window.c
+++ b/gitg/gitg-window.c
@@ -45,7 +45,8 @@
enum
{
COLUMN_BRANCHES_NAME,
- COLUMN_BRANCHES_REF
+ COLUMN_BRANCHES_REF,
+ COLUMN_BRANCHES_ICON
};
struct _GitgWindowPrivate
@@ -369,7 +370,7 @@ static void
build_branches_combo(GitgWindow *window, GtkBuilder *builder)
{
GtkComboBox *combo = GTK_COMBO_BOX(gtk_builder_get_object(builder, "combo_box_branches"));
- window->priv->branches_store = gtk_tree_store_new(2, G_TYPE_STRING, GITG_TYPE_REF);
+ window->priv->branches_store = gtk_tree_store_new(3, G_TYPE_STRING, GITG_TYPE_REF, G_TYPE_STRING);
window->priv->combo_branches = combo;
GtkTreeIter iter;
@@ -737,6 +738,14 @@ fill_branches_combo(GitgWindow *window)
COLUMN_BRANCHES_NAME, gitg_ref_get_prefix(ref),
COLUMN_BRANCHES_REF, NULL,
-1);
+
+ if (gitg_ref_get_ref_type(ref) == GITG_REF_TYPE_REMOTE)
+ {
+ gtk_tree_store_set(store,
+ &parent,
+ COLUMN_BRANCHES_ICON, g_strdup(GTK_STOCK_NETWORK),
+ -1);
+ }
}
gtk_tree_store_append(window->priv->branches_store, &iter, &parent);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]