Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dbeaver/pro#2674 [TE] Shared credentials button is not visible on small screens #33271

Merged
merged 7 commits into from
May 27, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.CTabFolder2Adapter;
import org.eclipse.swt.custom.CTabFolderEvent;
import org.eclipse.swt.custom.CTabItem;
import org.eclipse.swt.custom.*;
import org.eclipse.swt.events.KeyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
Expand Down Expand Up @@ -425,9 +422,10 @@ private CTabItem createPageTab(@NotNull IDialogPage page, int index) {
item.setToolTipText(page.getDescription());

if (page.getControl() == null) {
final Composite placeholder = new Composite(tabFolder, SWT.NONE);
placeholder.setLayout(new FillLayout());
item.setControl(placeholder);
final ScrolledComposite sc = new ScrolledComposite(tabFolder, SWT.BORDER | SWT.H_SCROLL);
sc.setExpandHorizontal(true);
sc.setExpandVertical(true);
item.setControl(sc);
} else {
final Control control = page.getControl();
control.setParent(tabFolder);
Expand All @@ -447,9 +445,17 @@ private void activateCurrentItem() {
Composite panel = (Composite) selection.getControl();
panel.setRedraw(false);
try {
page.createControl(panel);
Dialog.applyDialogFont(panel);
panel.layout(true, true);
if (panel instanceof ScrolledComposite sc) {
page.createControl(sc);
Dialog.applyDialogFont(sc);
sc.setContent(page.getControl());
sc.setMinSize(page.getControl().computeSize(SWT.DEFAULT, SWT.DEFAULT));
sc.layout();
} else {
page.createControl(panel);
Dialog.applyDialogFont(panel);
panel.layout(true, true);
}
} catch (Throwable e) {
DBWorkbench.getPlatformUI().showError("Error creating configuration page", null, e);
} finally {
Expand Down