Codebase list xapp / be1eace
mate-xapp-status-applet: Fix set icon error handling when an icon name is missing. Michael Webster 2 years ago
1 changed file(s) with 8 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
143143 self.label.set_margin_start(0)
144144
145145 def set_icon(self, string):
146 if "symbolic" in string:
147 size = SYMBOLIC_ICON_SIZE
148 else:
149 size = self.size - ICON_SIZE_REDUCTION
150
151 self.image.set_pixel_size(size)
152
153146 fallback = True
154147
155148 if string:
149 if "symbolic" in string:
150 size = SYMBOLIC_ICON_SIZE
151 else:
152 size = self.size - ICON_SIZE_REDUCTION
153
154 self.image.set_pixel_size(size)
155
156156 try:
157157 if os.path.exists(string):
158158 icon_file = Gio.File.new_for_path(string)
171171
172172 #fallback
173173 if fallback:
174 self.image.set_pixel_size(self.size - ICON_SIZE_REDUCTION)
174175 self.image.set_from_icon_name("image-missing", Gtk.IconSize.MENU)
175176
176177 # TODO?