开发者

Default dialog padding

开发者 https://www.devze.com 2022-12-17 16:06 出处:网络
What should be the default value for a dialog pad开发者_运维百科ding? 8px 10px?The Windows UX guidelines tell you to use a 7 DLU padding all the way around on a dialog.

What should be the default value for a dialog pad开发者_运维百科ding? 8px 10px?


The Windows UX guidelines tell you to use a 7 DLU padding all the way around on a dialog.


  • A Dialog Unit (DLU) is based on the average size of a character. It's defined so that the "average" character is 4 DLUs wide by 8 DLUs high.

  • The size of an average character changes depending on the font, the font size, and the dpi that the user is currently running. This means that DLUs are not a constant between machines, or between users on the same machine.

  • Different fonts have different aspect ratios. This ends up meaning that the size in pixels of a DLU will be different in the horizontal and vertical directions.


Looking at this particular size (dialog padding of 7 dlus):

         Segoe UI 9pt, 96dpi    Tahoma 8pt, 96dpi
dlus      px      py              px      py
==================================================
1x1      1.75    1.875            1.250   1.625
4x8      7      15                6      13        Definition of DLU: Average character=4x8
7x7     12.25   13.125            8.75   11.375    Dialog box margin - all sides (7)

So if the user is running Segoe UI 9pt at 96 dpi (the Windows Vista and 7 default), you want a top and bottom margin of 13px, and a left and right margin of 12px.

If the user is running Tahoma 9pt at 96dpi (the Windows 2000 and XP default), you want a top and bottom margin of 11px and a left and right margin of 9px.

Other common sizes:

  • MS Sans Serif, 8pt, 96dpi (Windows 9x default)
  • Tahoma 8pt, 96dpi (Windows 2000/XP default)
  • Tahoma 8pt, 120dpi (Windows 2000/XP large fonts)
  • Segoe UI 9pt, 96dpi (Windows Vista/7 default)
  • Segoe UI 9pt, 120 dpi (Windows Vista large fonts default, Windows 7 high-dpi default)
  • Segoe UI 11pt, 96 dpi (what i run at work)
  • Segoe UI 9pt, 137 dpi (what i run at home)

And this is why creating user interfaces is hard. It's hard to get it right, and most developers would rather just stick their head in the sand and pretend users didn't have font preferences, or change their dpi setting.

And the fact that the question was asked 4 months ago, and then abandoned, seems to confirm that developers don't want to hear the hard answers.


This depends on the platform and its respective design guidelines.

On Windows it's 7 DLU or 11 px:

Dialog box margins: 7 DLU on all sides or 11 pixels on all sides

—Windows User Experience Interaction Guidelines

In Mac OS X, Apple doesn't mandate a specific size of the dialog padding, but instead only recommends

Equal margins on both sides and the bottom edge of the window (the window in Figure 16-4 uses a 20-pixel margin in these areas).

—Apple Human Interface Guidelines

For GNOME it's 12 px:

Leave a 12-pixel border between the edge of the window and the nearest controls.

—GNOME Human Interface Guidelines 2.2


Consistent across your app.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号