4
$\begingroup$

One of the, hmm, "pleasures" of Mathematica is the appearance of those half-broken UI elements, that are hardcoded in some inappropriate way or another. Another example I just came across is the Image Assistant Toolbar. Here is what it looks like for me:

enter image description here

It turns out that the StyleSheet that's in use does have some effect on how much of that "more..." text fits into its button, but even if I use the default StyleSheet it doesn't fit, on my particular Windows 7 x64 machine. I'm sure there's some Windows machines where this works, but none of mine fall in this class. My guess is that OS settings affect the display of this as well, in possibly mysterious ways. Does anyone know how that toolbar is coded? Is there a notebook that I could edit so this looks the way it's supposed to?


After trying Karsten's suggestion in his answer (which solved the issue in the original image I posted), I checked the other tabs of that bar, and found this:

enter image description here

Overall, font sizes in this interface are a complete and hopeless mess. See this:

enter image description here

and notice the font size for the "other" label at the bottom. Well, I am sure that Karsten may be able to help me ultimately fix this one too, but I am certain that I'll find similar issues with pretty much every single new toolbar that I may discover. One may ask why Mathematica users have to redesign their user interface themselves if they want it to be rendered correctly.

$\endgroup$
  • $\begingroup$ No, I did not modify the Default.nb StyleSheet. $\endgroup$ – Pirx Aug 22 '16 at 22:51
3
$\begingroup$

Edit:

The reason, why your UI elements appear to be broken, is, that the font is enlarged due to your customization of FontProperties. You can make this UI use the correct FontProperties by adding the default as an option to its Cell:

Export[
 FileNameJoin[{$UserBaseDirectory, "SystemFiles", "FrontEnd", 
   "SystemResources", "AttachedImage2D.nb"}],
 Insert[
  Import@FileNameJoin[{$InstallationDirectory, "SystemFiles", "FrontEnd", 
     "SystemResources", "AttachedImage2D.nb"}],
  FontProperties -> {"ScreenResolution" -> 72},
  {1, 1, -1}
  ]
 ]

Original Answer:

Before changing the underlying file you can use, e.g.,

CellPrint@First[
  Import@FileNameJoin[{$InstallationDirectory, "SystemFiles", "FrontEnd", 
      "SystemResources", "AttachedImage2D.nb"}] /. 
 {(BaseStyle -> {"TextStyling"}) -> (BaseStyle -> {"TextStyling", FontSize -> 10})}]

to check, if changing the FontSize resolves that issue for you.

When you found the setting that works for you, you can save it to your $UserBaseDirectory instead of modifying the original file. For example via

Export[FileNameJoin[{$UserBaseDirectory, "SystemFiles", "FrontEnd", 
   "SystemResources", "AttachedImage2D.nb"}], 
 Import@FileNameJoin[{$InstallationDirectory, "SystemFiles", "FrontEnd", 
   "SystemResources", "AttachedImage2D.nb"}] /. 
 {(BaseStyle -> {"TextStyling"}) -> (BaseStyle -> {"TextStyling", FontSize -> 9})}
 ]
$\endgroup$
  • $\begingroup$ Yes, I use my own StyleSheet for my new notebooks anyway. I tried the code you gave, and to me it looks like if I put a FontSize->13 in there, the result looks like what I get with Default.nb. If I want the text to fit in the button, I need to set FontSize->12 if I use Default.nb, but I need to set FontSize->9 if I use my own StyleSheet (which has the ScreenResolution property set to the correct value of 96DPI rather than the incorrect value of 72DPI Mma on Windows uses by default). So, what do I need to do to fix this issue using my StyleSheet? $\endgroup$ – Pirx Aug 22 '16 at 23:06
  • $\begingroup$ Of course, I don't want to change font sizes of already existing styles in my StyleSheet. $\endgroup$ – Pirx Aug 22 '16 at 23:07
  • $\begingroup$ 7: This kind of works, but see my answer (so that I can post another image). No Magnification never solves anything, in my opinion, because of the different effects it may have on different types of notebook cells. $\endgroup$ – Pirx Aug 23 '16 at 2:25
  • $\begingroup$ On the Magnification versus ScreenResolution topic, also see my response here. $\endgroup$ – Pirx Aug 23 '16 at 2:44
  • $\begingroup$ No, while my changing the Font Properties makes things worse, the dialog boxes are broken even with the standard Default style sheet. My guess is this is related to Mathematica relying on people using a standard set of fonts, at the standard sizes, in Windows. The solution would have to be button sizes, frame sizes, etc., that can adjust to accommodate the font sizes that are being used. Or, to specify the fonts to be used for these interfaces independently. You know, the way hundreds of thousands of other Windows applications do it... $\endgroup$ – Pirx Aug 27 '16 at 13:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.