MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / scalePopupMenu

Method scalePopupMenu

ij/src/main/java/ij/gui/GUI.java:249–267  ·  view source on GitHub ↗
(final PopupMenu popup)

Source from the content-addressed store, hash-verified

247 }
248
249 @AstroImageJ(reason = "Replace default fonts", modified = true)
250 public static void scalePopupMenu(final PopupMenu popup) {
251 //System.out.println("scalePopupMenu1: "+popup);
252 if (Menus.getFontSize()!=0) {
253 popup.setFont(Menus.getFont(false));
254 //System.out.println("scalePopupMenu2: "+popup.getFont());
255 return;
256 }
257 final float scale = (float)Prefs.getGuiScale();
258 if (scale==1f)
259 return;
260 Font font=popup.getFont();
261 if (font==null)
262 font = new Font("Google Sans Flex", Font.PLAIN, (int)(scale*13));
263 else
264 font = font.deriveFont(scale*font.getSize());
265 popup.setFont(font);
266 //System.out.println("scalePopupMenu3: "+popup.getFont());
267 }
268
269 /**
270 * Tries to detect if a Swing component is unscaled and scales it it according

Callers 8

addPopupMenuMethod · 0.95
ChannelsMethod · 0.95
getDataPopupMenuMethod · 0.95
getMorePopupMenuMethod · 0.95
addRoiPopupMenuMethod · 0.95
newPopupMenuMethod · 0.95
installMenuMethod · 0.95
addPopupMenuMethod · 0.95

Calls 6

getFontSizeMethod · 0.95
getFontMethod · 0.95
getGuiScaleMethod · 0.95
setFontMethod · 0.65
getFontMethod · 0.65
getSizeMethod · 0.65

Tested by

no test coverage detected