Skip to content

Commit 33a9a74

Browse files
vogellatrancexpress
authored andcommitted
Prevent mouse wheel from changing selection in product and application
combo Disables mouse wheel scrolling on the product and application selection combo to avoid accidental selection changes when the user scrolls over the control. This improves usability when the combo is hovered during scroll operations, especially in scrollable containers. Fixes: eclipse-pde#1854
1 parent f3ce861 commit 33a9a74

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductInfoSection.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,10 @@ private void createProductEntry(Composite client, FormToolkit toolkit) {
231231
fProductCombo.add(""); //$NON-NLS-1$
232232
fProductCombo.addSelectionListener(
233233
widgetSelectedAdapter(e -> getProduct().setProductId(fProductCombo.getSelection())));
234-
234+
fProductCombo.getControl().addListener(SWT.MouseWheel, event -> {
235+
// Cancel the event to prevent default scrolling
236+
event.doit = false;
237+
});
235238
Button button = toolkit.createButton(client, PDEUIMessages.ProductInfoSection_new, SWT.PUSH);
236239
button.setEnabled(isEditable());
237240
button.addSelectionListener(widgetSelectedAdapter(e -> handleNewDefinition()));
@@ -264,7 +267,10 @@ private void createApplicationEntry(Composite client, FormToolkit toolkit) {
264267
fAppCombo.add(""); //$NON-NLS-1$
265268
fAppCombo.addSelectionListener(
266269
widgetSelectedAdapter(e -> getProduct().setApplication(fAppCombo.getSelection())));
267-
270+
fProductCombo.getControl().addListener(SWT.MouseWheel, event -> {
271+
// Cancel the event to prevent default scrolling
272+
event.doit = false;
273+
});
268274
fAppCombo.getControl().setEnabled(isEditable());
269275
}
270276

0 commit comments

Comments
 (0)