Jump to content

4.0.12 dialog bugs


edgar

Recommended Posts

You have the Menu font size increased from within Windows' control panel?

 

For now, if you need larger text for readability, I recommend increasing the "DPI" settings instead. That will increase the size of *all* elements, not just text.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

2 hours ago, Rick Brewster said:

You have the Menu font size increased from within Windows' control panel?

 

For now, if you need larger text for readability, I recommend increasing the "DPI" settings instead. That will increase the size of *all* elements, not just text.

Exactly - I have changed the menu font (family and size) for readability. Changing the DPI messes up many other programs and negates the benefits of my 65" 1920X1080 monitors.

 

You said "For now" - does that mean you hope to make your dialogs font sensitive? I have reverted to 4.0.10 (which seems to ignore the OS specified fonts).

 

BTW, I am a programmer and technical document editor/author; years ago I worked on Microsoft's Accessibility Team where (among other things) I worked on application font sensitivity - especially where it impacted folks with low visual acuity. I have had a couple of patches applied on the wxWidgets code and done extensive work on the code and technical documentation of Audacity. I use paint.net a lot (probably average 2-3 hours per day) and would really enjoy being able to help you with your code and, to a lesser extent, documentation.

 

10.png

Link to comment
Share on other sites

  • 2 months later...
  • 7 years later...

Bump

Things have gotten a lot better!

I think the only dialog left which is really suffering is the “Colors” Dialog. 1

 

This is not a bug, but more of a feature request…

When the “Text Tool” Is Selected, There Is a Font selection ComboBox – it is very narrow; traditionally this box would be wide enough to display the widest font family name. The drop down width is better, but it is still failing to show the information for fonts with long family names. 2 & 3

 



      public static void SetComboBoxSize(out SizeF pSize, ComboBox pComboBox, string pExample = "") {
         SizeF stringSize = new SizeF(0, 0),
            paddingSize = new SizeF(0, 0);
         pSize = stringSize;
         Font font = pComboBox.Font;

         using (Graphics graphics = pComboBox.CreateGraphics()) {
            paddingSize = graphics.MeasureString("0yÑ", font);
            paddingSize.Height += (font.SizeInPoints / 2.7f);
            if (!string.IsNullOrEmpty(pExample)) //Prefer example
               stringSize = graphics.MeasureString(pExample, font);
            else if (pComboBox.Items.Count > 0) {
               foreach (string phrase in pComboBox.Items) {
                  if (!string.IsNullOrEmpty(phrase)) {
                     SizeF temporaryStringSize = new SizeF(0, 0);
                     temporaryStringSize = graphics.MeasureString(phrase, font);
                     if (temporaryStringSize.Width > stringSize.Width)
                        stringSize.Width = temporaryStringSize.Width;
                  }
               }
            }
            else//Worst-case
               stringSize = graphics.MeasureString("The quick brown fox", font);
         }
         pSize.Width = stringSize.Width + paddingSize.Width + SystemInformation.VerticalScrollBarWidth;
         pSize.Height = stringSize.Height + paddingSize.Height;
      }

      public static void SetComboBoxDropDownWidth(ComboBox pComboBox, int pMinimumWidth = 50) {
         if (pComboBox.Items.Count == 0)
            return;//don't change the width
         Font font = pComboBox.Font;
         float boxWidth = 0;
         SizeF stringSize = new SizeF();
         int minWidth = pMinimumWidth;

         if (minWidth == 0)
            minWidth = pComboBox.Width;
         try {
            using (Graphics graphics = pComboBox.CreateGraphics()) {
               foreach (string phrase in pComboBox.Items) {
                  if (!string.IsNullOrEmpty(phrase)) {
                     stringSize = graphics.MeasureString(phrase, font);
                     if (stringSize.Width > boxWidth)
                        boxWidth = stringSize.Width;
                  }
               }
            }
            if (boxWidth < minWidth)
               boxWidth = minWidth;
            if (boxWidth > COMBOBOX_MAXIMUM_DROPDOWN_WIDTH)
               boxWidth = COMBOBOX_MAXIMUM_DROPDOWN_WIDTH;
            pComboBox.DropDownWidth = (int)boxWidth;
         }
         catch (Exception /*pException*/) {
            //_ = AskingAsync(new TM("SetComboBoxDropDownWidth; exception caught and handled", pException));
            pComboBox.DropDownWidth = 200;
         }
      }

 

pdn.png

Link to comment
Share on other sites

I suppose as long as I am sharing…



      public static void SetUpDownBoxWidth(NumericUpDown pNumericUpDown) {
         float boxWidth = 0f, boxHeight = 0f;
         SizeF stringSize = new SizeF();
         string minimumValue = string.Format("{0}", pNumericUpDown.Minimum),
            maximumValue = string.Format("{0}", pNumericUpDown.Maximum);

         using (Graphics graphics = pNumericUpDown.CreateGraphics()) {
            if (maximumValue.Length > minimumValue.Length)
               stringSize = graphics.MeasureString(maximumValue + "0", pNumericUpDown.Font);
            else
               stringSize = graphics.MeasureString(minimumValue + "0", pNumericUpDown.Font);
            if (stringSize.Width > boxWidth)
               boxWidth = stringSize.Width;
            if (stringSize.Height > boxHeight)
               boxHeight = stringSize.Height;
         }
         //The Up/Down arrows is about the same width as the scrollbar width
         pNumericUpDown.Width = (int)(boxWidth + SystemInformation.VerticalScrollBarWidth);
         pNumericUpDown.Height = (int)(boxHeight + sIndent);
      }

 

Link to comment
Share on other sites

@edgar You should really be using the scaling settings in Windows Settings -> Display instead of changing the font sizes. This isn't something I can feasibly support, it's not going to be "fixed."

 

This is also what I said in 2016 (in my reply above).

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...