Commit 1cc2150
committed
Always set disabled icons in AbstractContributionItem
AbstractionContributionItems only set a disabled icon on the ToolItem in
case such a disabled icon is specified via an explicit URI to that icon.
If no such URI is specified, the ToolItem creates a disabled icon on the
fly. Since the ToolItem creates a new image every time the enablement
state of the ToolItem changes, this leads to unnecessary repeated
creation of images.
In contrast, ActionContributionItems always set the disabled icon for
their ToolItem, even if no disabled image descriptor is specified for
them, to avoid that the ToolItem repeatedly created that icon.
This change align the AbstractContributionItem handling for disabled
icons with the one of ActionContributionItems: in case no URI to a
disabled icon is specified, the SWT disablement mechanism is used to
create a disabled version and to explicitly set it at the ToolItem. This
avoids unnecessary repeated creation of the disabled version of an icon
for those items.1 parent 208faf9 commit 1cc2150
File tree
1 file changed
+23
-3
lines changed- bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt
1 file changed
+23
-3
lines changedLines changed: 23 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
152 | 156 | | |
153 | 157 | | |
154 | 158 | | |
155 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
156 | 163 | | |
157 | 164 | | |
158 | 165 | | |
| |||
169 | 176 | | |
170 | 177 | | |
171 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
172 | 183 | | |
173 | 184 | | |
174 | 185 | | |
| |||
184 | 195 | | |
185 | 196 | | |
186 | 197 | | |
187 | | - | |
| 198 | + | |
188 | 199 | | |
189 | | - | |
190 | | - | |
| 200 | + | |
| 201 | + | |
191 | 202 | | |
192 | 203 | | |
193 | 204 | | |
194 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
195 | 215 | | |
196 | 216 | | |
197 | 217 | | |
| |||
0 commit comments