Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ private void restoreEnableState(Control control, Map<String,Object> saveState, S
if (control != null) {
Boolean b = (Boolean) saveState.get(key);
if (b != null) {
control.setEnabled(b.booleanValue());
setButtonEnabled(control, b.booleanValue());
}
}
}
Expand Down Expand Up @@ -1066,10 +1066,25 @@ public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable
private void saveEnableStateAndSet(Control control, Map<String, Object> saveState, String key, boolean enabled) {
if (control != null) {
saveState.put(key, control.getEnabled() ? Boolean.TRUE : Boolean.FALSE);
control.setEnabled(enabled);
setButtonEnabled(control, enabled);
}
}

/**
* Sets the enabled state of a button and updates the CSS class name so that
* the dark theme can style disabled buttons differently. The CSS class
* "disabled" is set when the button is disabled, and cleared when enabled.
* This triggers a reskin so that the CSS engine re-applies styles.
*
* @param control the button control
* @param enabled whether the button should be enabled
*/
private static void setButtonEnabled(Control control, boolean enabled) {
control.setEnabled(enabled);
control.setData("org.eclipse.e4.ui.css.CssClassName", enabled ? null : "disabled"); //$NON-NLS-1$ //$NON-NLS-2$
control.reskin(SWT.NONE);
}

/**
* Captures and returns the enabled/disabled state of the wizard dialog's
* buttons and the tree of controls for the currently showing page. All
Expand Down Expand Up @@ -1332,13 +1347,13 @@ public void updateButtons() {
boolean canFinish = wizard.canFinish();
if (backButton != null) {
boolean backEnabled = currentPage != null && currentPage.getPreviousPage() != null;
backButton.setEnabled(backEnabled);
setButtonEnabled(backButton, backEnabled);
}
if (nextButton != null) {
canFlipToNextPage = currentPage != null && currentPage.canFlipToNextPage();
nextButton.setEnabled(canFlipToNextPage);
setButtonEnabled(nextButton, canFlipToNextPage);
}
finishButton.setEnabled(canFinish);
setButtonEnabled(finishButton, canFinish);
// finish is default unless it is disabled and next is enabled
if (canFlipToNextPage && !canFinish) {
getShell().setDefaultButton(nextButton);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ Group > StyledText {
color:'#org-eclipse-ui-workbench-DARK_FOREGROUND';
}

/* Disabled buttons should appear dimmed to distinguish them from enabled buttons */
Button.disabled {
color: #777777;
}

/* ############################## Toolbar ############################## */
/* Ensure that the labels in the tabfolder gets updated
See Bug 552780
Expand Down
Loading