~ubuntu-branches/ubuntu/utopic/anjuta/utopic-proposed

« back to all changes in this revision

Viewing changes to libanjuta/anjuta-entry.c

  • Committer: Package Import Robot
  • Author(s): Andreas Henriksson, Jackson Doak
  • Date: 2014-07-12 15:17:39 UTC
  • mfrom: (1.4.14)
  • Revision ID: package-import@ubuntu.com-20140712151739-p9xy0ntlgbpm2nxq
Tags: 2:3.12.0-1
* Team upload.

[ Jackson Doak ]
* New upstream release
* Drop 03_valac_0.22.patch, fixed upstream\
* debian/control:
  - Bump b-dep version on libgtk-3-dev (>= 3.6.0), libglib2.0-dev (>= 2.34.0)
  - Bump stardards-version to 3.9.5. No changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
static void
57
57
anjuta_entry_set_mode (AnjutaEntry *self, AnjutaEntryMode mode)
58
58
{
59
 
        GtkStyle *style;
 
59
        GtkStyleContext *style_context;
 
60
        GdkRGBA insensitive_color;
60
61
 
61
 
        style = gtk_widget_get_style (GTK_WIDGET (self));
 
62
        style_context = gtk_widget_get_style_context (GTK_WIDGET (self));
62
63
 
63
64
        switch (mode)
64
65
        {
67
68
                        if (self->priv->showing_help_text)
68
69
                                gtk_entry_set_text (GTK_ENTRY (self), "");
69
70
 
70
 
                        gtk_widget_modify_text (GTK_WIDGET (self), GTK_STATE_NORMAL, NULL);
 
71
                        gtk_widget_override_color (GTK_WIDGET (self), GTK_STATE_NORMAL,
 
72
                                                   NULL);
71
73
 
72
74
                        self->priv->showing_help_text = FALSE;
73
75
 
78
80
                        else
79
81
                                gtk_entry_set_text (GTK_ENTRY (self), "");
80
82
 
81
 
                        gtk_widget_modify_text (GTK_WIDGET (self),
82
 
                                                GTK_STATE_NORMAL,
83
 
                                                &(style->text[GTK_STATE_INSENSITIVE]));
 
83
                        /* FIXME: Ideally we should be using CSS here, but some themes,
 
84
                         * like Ubuntu's, don't define insensitive_fg_color. The help text
 
85
                         * renders white on these themes, which is unreadable in many cases.
 
86
                         * 
 
87
                         * This should make the help text readable on all themes, but the 
 
88
                         * color won't change if the theme changes while Anjuta is running.
 
89
                         */
 
90
                        gtk_style_context_get_color (style_context, GTK_STATE_FLAG_INSENSITIVE,
 
91
                                                     &insensitive_color);
 
92
                        gtk_widget_override_color (GTK_WIDGET (self), GTK_STATE_NORMAL,
 
93
                                                   &insensitive_color);
84
94
 
85
95
                        self->priv->showing_help_text = TRUE;
86
96
 
255
265
 * anjuta_entry_get_text:
256
266
 * @self: An AnjutaEntry
257
267
 *
258
 
 * Returns the contents of the entry. If the entry is empty, the help text will
 
268
 * Returns: The contents of the entry. If the entry is empty, the help text will
259
269
 * be displayed and an empty string will be returned.
260
270
 */
261
271
const gchar *
269
279
 * anjuta_entry_dup_text:
270
280
 * @self: An AnjutaEntry
271
281
 *
272
 
 * Returns a copy of the contents of the entry. If the entry is empty, the 
273
 
 * returned string will be empty. The returned string must be freed when no
274
 
 * longer needed. 
 
282
 * Returns: (transfer full): A copy of the contents of the entry. If the entry
 
283
 * is empty, the returned string will be empty. The returned string must be
 
284
 * freed when no longer needed.
275
285
 */
276
286
gchar *
277
287
anjuta_entry_dup_text (AnjutaEntry *self)
301
311
 * anjuta_entry_is_showing_help_text:
302
312
 * @self: An AnjutaEntry
303
313
 * 
304
 
 * Returns whether the entry is showing its help text. In practice, if this
 
314
 * Returns: Whether the entry is showing its help text. In practice, if this
305
315
 * method returns %TRUE, it means that the user has not entered anything.
306
316
 */
307
317
gboolean