~ubuntu-branches/ubuntu/jaunty/geany/jaunty

« back to all changes in this revision

Viewing changes to src/ui_utils.c

  • Committer: Bazaar Package Importer
  • Author(s): Lionel Le Folgoc
  • Date: 2007-02-25 21:12:13 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070225211213-jk4d4vxtgji0rj74
Tags: 0.10.2-0ubuntu1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 *      ui_utils.c - this file is part of Geany, a fast and lightweight IDE
3
3
 *
4
 
 *      Copyright 2006 Enrico Troeger <enrico.troeger@uvena.de>
5
 
 *      Copyright 2006 Nick Treleaven <nick.treleaven@btinternet.com>
 
4
 *      Copyright 2006-2007 Enrico Troeger <enrico.troeger@uvena.de>
 
5
 *      Copyright 2006-2007 Nick Treleaven <nick.treleaven@btinternet.com>
6
6
 *
7
7
 *      This program is free software; you can redistribute it and/or modify
8
8
 *      it under the terms of the GNU General Public License as published by
18
18
 *      along with this program; if not, write to the Free Software
19
19
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
20
 *
21
 
 * $Id: ui_utils.c 1140 2006-12-21 20:47:31Z eht16 $
 
21
 * $Id: ui_utils.c 1300 2007-02-17 16:59:36Z ntrel $
22
22
 */
23
23
 
24
24
 
120
120
                        (doc_list[idx].readonly) ? ", read only" : "",
121
121
                        cur_tag,
122
122
                        (doc_list[idx].encoding) ? doc_list[idx].encoding : _("unknown"),
123
 
                        (utils_is_unicode_charset(doc_list[idx].encoding)) ? ((doc_list[idx].has_bom) ? _("(with BOM)") : _("(without BOM)")) : "",
 
123
                        (encodings_is_unicode_charset(doc_list[idx].encoding)) ? ((doc_list[idx].has_bom) ? _("(with BOM)") : _("(without BOM)")) : "",
124
124
                        (doc_list[idx].file_type) ? doc_list[idx].file_type->title : _("unknown"));
125
125
                set_statusbar(text, TRUE);      // can be overridden by status messages
126
126
                g_free(text);
706
706
                                                                                                                                                                        TRUE);
707
707
 
708
708
        gtk_widget_set_sensitive(lookup_widget(app->window, "menu_write_unicode_bom1"),
709
 
                        utils_is_unicode_charset(doc_list[idx].encoding));
 
709
                        encodings_is_unicode_charset(doc_list[idx].encoding));
710
710
 
711
711
        encodings_select_radio_item(doc_list[idx].encoding);
712
712
        filetypes_select_radio_item(doc_list[idx].file_type);
1179
1179
void ui_update_tab_status(gint idx)
1180
1180
{
1181
1181
        GdkColor *color = document_get_status(idx);
1182
 
        static GtkStyle *style = NULL;
1183
 
 
1184
 
        if (style == NULL) // use and store default foreground colour
1185
 
                style = gtk_rc_get_style(doc_list[idx].tab_label);
1186
 
 
1187
 
        gtk_widget_modify_fg(doc_list[idx].tab_label, GTK_STATE_NORMAL,
1188
 
                color ? color : &(style->fg[GTK_STATE_NORMAL]));
1189
 
        gtk_widget_modify_fg(doc_list[idx].tab_label, GTK_STATE_ACTIVE,
1190
 
                color ? color : &(style->fg[GTK_STATE_ACTIVE]));
 
1182
 
 
1183
        // NULL color will reset to default
 
1184
        gtk_widget_modify_fg(doc_list[idx].tab_label, GTK_STATE_NORMAL, color);
 
1185
        gtk_widget_modify_fg(doc_list[idx].tab_label, GTK_STATE_ACTIVE, color);
 
1186
        gtk_widget_modify_fg(doc_list[idx].tabmenu_label, GTK_STATE_NORMAL, color);
 
1187
        gtk_widget_modify_fg(doc_list[idx].tabmenu_label, GTK_STATE_ACTIVE, color);
1191
1188
 
1192
1189
        treeviews_openfiles_update(idx);
1193
1190
}
1221
1218
                if (! gtk_tree_model_iter_next(model, &iter))
1222
1219
                        return FALSE;   // no more items
1223
1220
        }
 
1221
        // scroll item in view
 
1222
        if (app->msgwindow_visible)
 
1223
        {
 
1224
                GtkTreePath *path = gtk_tree_model_get_path(
 
1225
                        gtk_tree_view_get_model(treeview), &iter);
 
1226
 
 
1227
                gtk_tree_view_scroll_to_cell(treeview, path, NULL, TRUE, 0.5, 0.5);
 
1228
                gtk_tree_path_free(path);
 
1229
        }
1224
1230
        return TRUE;
1225
1231
}
1226
1232