mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
Merge remote-tracking branch 'origin/GP-3419_dev747368_ctrl-0_reset_font'
This commit is contained in:
commit
d3301fc221
2 changed files with 22 additions and 0 deletions
|
@ -51,6 +51,10 @@ public class FontAdjustPlugin extends Plugin {
|
|||
.onAction(this::decrementFont)
|
||||
.buildAndInstall(tool);
|
||||
|
||||
new ActionBuilder("Reset Font", "tool")
|
||||
.keyBinding("ctrl 0")
|
||||
.onAction(this::resetFontSize)
|
||||
.buildAndInstall(tool);
|
||||
}
|
||||
|
||||
private void incrementFont(ActionContext context) {
|
||||
|
@ -67,4 +71,10 @@ public class FontAdjustPlugin extends Plugin {
|
|||
}
|
||||
}
|
||||
|
||||
private void resetFontSize(ActionContext context) {
|
||||
ComponentProvider provider = context.getComponentProvider();
|
||||
if (provider != null) {
|
||||
provider.resetFontSize();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -827,6 +827,18 @@ public abstract class ComponentProvider implements HelpDescriptor, ActionContext
|
|||
ThemeManager.getInstance().setFont(registeredFontId, font.deriveFont((float) size));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tells the provider to reset the font size for this provider.
|
||||
* <p>
|
||||
* See {@link #adjustFontSize(boolean)}
|
||||
*/
|
||||
public void resetFontSize() {
|
||||
if (registeredFontId == null) {
|
||||
return;
|
||||
}
|
||||
ThemeManager.getInstance().restoreFont(registeredFontId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a fontId for the font that will be automatically adjusted when
|
||||
* {@link #adjustFontSize(boolean)} is called.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue