~didrocks/libunity/add-remote-disabling-support

« back to all changes in this revision

Viewing changes to protocol/protocol-icon.vala

  • Committer: Tarmac
  • Author(s): Michal Hruby
  • Date: 2012-09-25 10:10:11 UTC
  • mfrom: (179.1.2 libunity)
  • Revision ID: tarmac-20120925101011-bygwjogjpvstw35i
Added size hint to AnnotatedIcon. Fixes: https://bugs.launchpad.net/bugs/1052513. Approved by Pawel Stolowski.

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
  public Icon icon { get; set; }
58
58
  public string ribbon { get; set; }
59
59
  public CategoryType category { get; set; default = CategoryType.NONE; }
 
60
  public bool use_small_icon { get; set; }
60
61
 
61
62
  public AnnotatedIcon (Icon? base_icon)
62
63
  {
128
129
      icon._hints.remove ("ribbon");
129
130
    }
130
131
 
 
132
    unowned Variant small_icon_variant = icon.get_hint ("use-small-icon");
 
133
    if (small_icon_variant != null)
 
134
    {
 
135
      icon.use_small_icon = small_icon_variant.get_boolean ();
 
136
      icon._hints.remove ("use-small-icon");
 
137
    }
 
138
 
131
139
    return icon;
132
140
  }
133
141
 
142
150
      add_hint ("category", new Variant.uint32 (category));
143
151
    if (ribbon != null && ribbon[0] != '\0')
144
152
      add_hint ("ribbon", ribbon);
 
153
    if (use_small_icon)
 
154
      add_hint ("use-small-icon", new Variant.boolean (true));
145
155
 
146
156
    Variant dict = _hints;
147
157
    tokens.add (dict.print (true));