mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 01:15:29 +02:00
Bug 417559 - Enhanced debug hover doesn't remember its size when
expanded Change-Id: Ife281405691fe6fd39a4aac4f13a4ff12e7a2b19 Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com> Reviewed-on: https://git.eclipse.org/r/16623 Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com> IP-Clean: Marc Khouzam <marc.khouzam@ericsson.com>
This commit is contained in:
parent
331ff203d6
commit
f78c4431b2
1 changed files with 29 additions and 1 deletions
|
@ -8,6 +8,7 @@
|
|||
* Contributors:
|
||||
* IBM Corporation - initial API and implementation
|
||||
* Wind River Systems - adapted for DSF
|
||||
* Marc-Andre Laperle (Ericsson) - Remember hover size when expanded (Bug 417559)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.dsf.debug.internal.ui;
|
||||
|
||||
|
@ -198,8 +199,34 @@ public class ExpressionInformationControlCreator implements IInformationControlC
|
|||
create();
|
||||
}
|
||||
|
||||
/**
|
||||
* Override the size constraints so that it can be as big as
|
||||
* when the hover was last displayed (IDialogSettings).
|
||||
*/
|
||||
@Override
|
||||
public Point computeSizeConstraints(int widthInChars, int heightInChars) {
|
||||
// Bug 417559: The TextViewerHoverManager constrains the size of a newly created
|
||||
// ExpressionInformationControl by 100 chars by 12 chars (602x182). The control
|
||||
// size can be expanded beyond that, however when re-created it will still be constrained.
|
||||
// By removing the constraint in the presence of a non-null IDialogSettings,
|
||||
// the size gets restored properly even when previously expanded.
|
||||
Point dialogSettingsSize = getDialogSettingsSize();
|
||||
if (dialogSettingsSize != null) {
|
||||
return dialogSettingsSize;
|
||||
}
|
||||
return super.computeSizeConstraints(widthInChars, heightInChars);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Point computeSizeHint() {
|
||||
Point dialogSettingsSize = getDialogSettingsSize();
|
||||
if (dialogSettingsSize != null) {
|
||||
return dialogSettingsSize;
|
||||
}
|
||||
return super.computeSizeHint();
|
||||
}
|
||||
|
||||
private Point getDialogSettingsSize() {
|
||||
IDialogSettings settings = getDialogSettings(false);
|
||||
if (settings != null) {
|
||||
int x = getIntSetting(settings, WIDTH);
|
||||
|
@ -210,7 +237,8 @@ public class ExpressionInformationControlCreator implements IInformationControlC
|
|||
}
|
||||
}
|
||||
}
|
||||
return super.computeSizeHint();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Reference in a new issue