TONT 42543 为什么任务栏默认位于屏幕底端?

请注意:本页内容发布于 2329 天前,内容可能已经过时,请注意甄别。

理所当然,或者,真的是这样?

It didn’t always.

并非一直以来都如此。

The original taskbar didn’t look at all like what you see today. It defaulted to the top of the screen and looked something like this.

任务栏曾经并非与你所见到的一模一样,它曾一度默认位于屏幕的顶端,而且长成下面这个样子:

(译注:原站配图失效,此处配图来自《The old new thing》)

This is definitely not what it actually looked like. It has been so long I forgot precisely what it looked like (I didn’t realize there was going to be a quiz ten years later), but this captures the basic flavor, at least for the purpose of this discussion.

这肯定不是它实际的样子就是了,时间已经过去很久,我已无法准确描绘它的样子(当时的我,怎么也想不到十年后会需要再回忆起来),不过基本概念是这样的,用来解释和讨论是足够了。

The point is that the bar took the form, not of buttons, but of tabs. Each tab corresponded to a running window, which melded into the tab. You switched window by clicking the corresponding tab.

重点在于,当时的任务栏采用了标签、而不是按钮的形制。每个标签代表一个运行中的窗口,窗口又与标签相融合,通过点击对应的标签来切换窗口。

You can see vestiges of this style in the TCS_BUTTONS style in the tab control. When we switched to the button-look for the taskbar, we still had a lot of switching code based on the tabs metaphor, and it was less work to add a button-look to the tab control than it was to rewrite all the switching code.

在标签控件的TCS_BUTTONS样式中,你仍可一窥上述设计的遗迹。后来我们将任务栏的样式重新设计为按钮式的时候,我们仍有很多切换(译注:切换窗口?)相关的代码是基于标签样式的,而让标签控件长得像按钮比重写所有的切换代码明显要简单多了。

The tabbed look was abandoned for various reasons, one of which was what everybody else has already noticed: If you put the taskbar at the top of the screen, lots of windows end up sliding under it, because they assumed that the usable area of the screen began at (0,0). Other windows would “creep” up the screen because they used GetWindowPlacement to save their window position (which returns workspace coordinates, where (0,0) is the first usable pixel) but use SetWindowPos to restore it (which uses screen coordinates, where (0,0) is the upper left pixel of the primary monitor).

标签式的任务栏设计被抛弃有很多原因,其中一个是很多人早已意识到的:如果将任务栏摆在窗口顶端,有很多窗口都会被盖在下面,因为这些窗口认为屏幕可用部分的坐标是从(0,0)开始的,而另一些窗口会『爬』上任务栏,因为它们用了GetWindowPlacement来保存窗口的位置(该方法返回的是工作区内的坐标(译注:去掉任务栏后剩余的空间,在任务栏在屏幕顶端的设计中,也就是任务栏以下的部分),(0,0)是第一个可用像素),但却使用了SetWindowPos来恢复窗口(该方法使用的是屏幕绝对坐标,此时(0,0)是住显示器左上角的坐标)。

There were too many apps that kept sliding under the top-docked taskbar so we had to abandon that idea and move it to the bottom.

溜到位于屏幕顶端任务栏下面的程序实在是太多了,我们不得不弃用了这个设计,把任务栏摆在了屏幕下方。

It’s somewhat disheartening to observe that now, eight years later, apps still mess up their coordinate systems and keep sliding under a top-docked or left-docked taskbar.

不过,想想八年后的今天,好多程序还是在任务栏被停靠在屏幕顶端或左边的时候,因为搞不清(屏幕和工作区的)坐标而溜到任务栏下面时,就让人感到一阵沮丧。

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

 剩余字数 ( Characters available )

Your comment will be available after auditing.
您的评论将在通过审核后显示。

Please DO NOT add any links in your comment, otherwise it would be identified as SPAM automatically and never be audited.
请不要在评论中插入任何链接,否则将被自动归类为垃圾评论,且永远不会被提交给博主进行复审。

*