Closed Bug 871590 Opened 11 years ago Closed 11 years ago

Improve unified titlebar / toolbar handling

Categories

(Core :: Widget: Cocoa, defect)

All
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla24

People

(Reporter: mstange, Assigned: mstange)

References

(Depends on 1 open bug)

Details

Attachments

(2 files)

While working on bug 676241 I noticed some problems with the interaction between -moz-window-titlebar and toolbar.
This patch consists of parts from the patch in bug 625989. It was already reviewed there and is already present on the UX repo as https://hg.mozilla.org/projects/ux/rev/35d68446e000 - these are the parts that can land on mozilla-central.
This patch improves how -moz-appearance:-moz-window-titlebar and -moz-appearance:toolbar determine the unified toolbar height and fixes problems that occured when the content area is extended into the titlebar.
Attachment #748866 - Flags: review?(roc)
Attachment #748859 - Attachment description: add basic handling of -moz-window-titlebar → part 1: add basic handling of -moz-window-titlebar
Assignee: nobody → mstange
Comment on attachment 748866 [details] [diff] [review]
part 2: make it more robust

Review of attachment 748866 [details] [diff] [review]:
-----------------------------------------------------------------

::: widget/cocoa/nsChildView.mm
@@ +2080,3 @@
>    for (uint32_t i = 0; i < aThemeGeometries.Length(); ++i) {
> +    const nsIWidget::ThemeGeometry& g = aThemeGeometries[i];
> +    if ((g.mWidgetType == NS_THEME_WINDOW_TITLEBAR) &&

Don't need the extra parens here

@@ +2099,5 @@
>      if ((g.mWidgetType == NS_THEME_MOZ_MAC_UNIFIED_TOOLBAR ||
>           g.mWidgetType == NS_THEME_TOOLBAR) &&
>          g.mRect.X() <= 0 &&
> +        g.mRect.XMost() >= aWindowWidth &&
> +        g.mRect.Y() <= aTitlebarBottom) {

Shouldn't aTitlebarBottom be unifiedToolbarbottom here, so we can keep extending the unified toolbar bottom with multiple toolbars?
We could do that, but I don't think we want to. I don't know of any native apps which do it.
Here's a native example where the lower toolbar does not extend the upper one: http://dl.dropbox.com/u/2901861/Screenshots/Bildschirmfoto%202013-05-14%20um%2022.48.08.png
Comment on attachment 748866 [details] [diff] [review]
part 2: make it more robust

Review of attachment 748866 [details] [diff] [review]:
-----------------------------------------------------------------

r+ with that

::: widget/cocoa/nsChildView.mm
@@ +2099,5 @@
>      if ((g.mWidgetType == NS_THEME_MOZ_MAC_UNIFIED_TOOLBAR ||
>           g.mWidgetType == NS_THEME_TOOLBAR) &&
>          g.mRect.X() <= 0 &&
> +        g.mRect.XMost() >= aWindowWidth &&
> +        g.mRect.Y() <= aTitlebarBottom) {

OK, can you at least set unifiedToolbarBottom to the max of unifiedToolbarBottom and g.mRect.YMost(), so that this doesn't depend on the order of aThemeGeometries?
Attachment #748866 - Flags: review?(roc) → review+
Good call, will do.
Backed out:
https://hg.mozilla.org/integration/mozilla-inbound/rev/2861d9fba479

Without bug 676241 this appears to cause failed assertions.
https://hg.mozilla.org/mozilla-central/rev/1eca75a9574f
https://hg.mozilla.org/mozilla-central/rev/5d158673711c
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
Depends on: 880554
Depends on: 880620
Depends on: 890361
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: