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

« back to all changes in this revision

Viewing changes to src/unity-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:
53
53
    N_CATEGORIES
54
54
  }
55
55
 
 
56
  public enum IconSizeHint
 
57
  {
 
58
    DEFAULT,
 
59
    SMALL,
 
60
    LARGE
 
61
  }
 
62
 
56
63
  /*
57
64
   * AnnotatedIcon can be used to add various icon and text overlays to an icon.
58
65
   * Add desired overlays using properties of this class and use the to_string()
88
95
      set { _pai.category = (Protocol.CategoryType) value; }
89
96
    }
90
97
 
 
98
    public IconSizeHint size_hint
 
99
    {
 
100
      get
 
101
      {
 
102
        return _pai.use_small_icon ? IconSizeHint.SMALL : IconSizeHint.DEFAULT;
 
103
      }
 
104
      set { _pai.use_small_icon = value == IconSizeHint.SMALL; }
 
105
    }
 
106
 
91
107
    public AnnotatedIcon (Icon base_icon)
92
108
    {
93
109
      Object (icon: base_icon);