Closed Bug 860535 Opened 11 years ago Closed 11 years ago

Make it possible to add widgets to the ends of customization areas

Categories

(Firefox :: Toolbars and Customization, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 28

People

(Reporter: mconley, Assigned: mconley)

References

Details

Attachments

(1 file, 2 obsolete files)

My patch for this bug focuses on making it possible to add widgets to the ends of customization areas, it also fixes the following:

1) Makes the nav-bar customization target not weirdly wide (with its flex="100") if the search bar is not in the panel by default
2) Makes it possible to add widgets to the nav-bar even if there were no widgets in there to begin with.

Patch coming in a second.
Attached patch Patch v1 (obsolete) — Splinter Review
Assignee: nobody → mconley
Status: NEW → ASSIGNED
Attachment #736024 - Flags: review?(jaws)
Comment on attachment 736024 [details] [diff] [review]
Patch v1

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

::: browser/base/content/browser.xul
@@ +659,5 @@
>                       label="&stopCmd.label;" removable="true"
>                       command="Browser:Stop"
>                       tooltiptext="&stopButton.tooltip;"/>
>  
> +      <hbox id="nav-bar-customizationtarget" class="customization-target" flex="1"/>

As we talked about in person, I don't think the change from flex=100 to flex=1 will be good for addon-compat. We may need to find a different route to go here.
Attachment #736024 - Flags: review?(jaws) → review-
Attached patch Patch v1.1 (obsolete) — Splinter Review
Alright, doing away with the flex="1" bit - we'll solve that problem down the road once we figure out what we're going to do with add-ons adding items to the toolbar.
Attachment #736024 - Attachment is obsolete: true
Attachment #736066 - Flags: review?(jaws)
Comment on attachment 736066 [details] [diff] [review]
Patch v1.1

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

::: browser/modules/CustomizableUI.jsm
@@ +1377,5 @@
> +    if (aElement.hasAttribute("flex")) {
> +      let parent = aElement.parentNode;
> +      let parentFlex = parent.hasAttribute("flex") ? parseInt(parent.getAttribute("flex"), 10) : 0;
> +      let elementFlex = parseInt(aElement.getAttribute("flex"), 10);
> +      parent.setAttribute("flex", parentFlex + elementFlex);

Negative flex or flex attributes that have non-numeric values are gonna make the behavior of this code somewhat undefined. In practice, I don't think add-ons with >10 users will have this type of issue, so I'm fine with leaving this as-is.

::: browser/themes/shared/customization.inc.css
@@ +36,5 @@
>  }
>  
> +#main-window[customizing] .customization-target {
> +  min-width: 100px;
> +  padding: 0 10px 0 10px;

Are we sure that we want to remove whatever vertical padding we had? Why not just use padding-left:10px; and padding-right:10px;? (besides the downside of the extra verbosity).
Attachment #736066 - Flags: review?(jaws) → review+
Thanks - swapped out the padding rule for padding-left and padding-right.
Attachment #736066 - Attachment is obsolete: true
Attachment #736443 - Flags: review+
Landed in jamun as https://hg.mozilla.org/projects/jamun/rev/29e4ed6f3d35
Whiteboard: [fixed in jamun]
Landed in UX as https://hg.mozilla.org/projects/ux/rev/29e4ed6f3d35
Whiteboard: [fixed in jamun] → [fixed in jamun][fixed in ux]
https://hg.mozilla.org/mozilla-central/rev/db946ac26b87
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed in jamun][fixed in ux]
Target Milestone: --- → Firefox 28
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: