Closed Bug 336457 Opened 18 years ago Closed 18 years ago

Mark selected search engine in the drop-down list

Categories

(Firefox :: Search, defect)

2.0 Branch
defect
Not set
trivial

Tracking

()

RESOLVED FIXED

People

(Reporter: pamg.bugs, Assigned: pamg.bugs)

References

Details

Attachments

(2 files, 2 obsolete files)

Indicate which search engine is currently selected in the drop-down list on the searchbar.
Blocks: 335435
Status: NEW → ASSIGNED
Assignee: nobody → pamg.bugs
Status: ASSIGNED → NEW
brainstormed ideas on how to do this, comments below:

 - overlay the search icon with a checkmark
 - replace the search icon with a checkmark (since it will be in the search box)
 - place a checkmark at the end of the search engine name string
 - always have the active engine at the top of the list
 - show the active engine as greyed out

Of these, I think one of the checkmark solutions is easiest and simplest.
If possible, I'd vote for a checkmark to the left of the menu item, matching what happens in a standard system menu.
(In reply to comment #1)
>  - replace the search icon with a checkmark (since it will be in the search
> box)
maybe not optimal ... uses like to go by icons.
>  - always have the active engine at the top of the list
User will be confused if the search engines jump around.
>  - show the active engine as greyed out
I would like this one, if it doesn't look disabled (not available, uninstalled).
Maybe if it was marked selected before user move the mouse over the list?

Maybe it looks just perfect if you bold the text? <-- I would like to see how that would look
True -- bold text looks nice, clean and obvious, where a checkmark plus an icon might be a bit cluttered.
No longer depends on: 335443
Attached patch Boldfaces selected engine name (obsolete) — Splinter Review
The changes in this patch only do what they're described to do after the changes in the patch for bug 335441 are applied.

Until that patch is in, this one will highlight the engine that is selected when you first launch the browser.  I'd rather have done everything in series, but reviewers are busy and deadlines loom.  (Also this is a very small patch.)
Attachment #220880 - Flags: ui-review?(beltzner)
Attachment #220880 - Flags: superreview?(bugs)
Attachment #220880 - Flags: review?(joe)
IDs should be unique to an element. Can't you use the class to style the element instead?
Attachment #220880 - Flags: ui-review?(beltzner) → ui-review+
Using a class rather than an ID.  Also, because of some concurrent changes to the patch for bug 335441, this patch is now independent of that one and works just as it is.
Attachment #220880 - Attachment is obsolete: true
Attachment #220889 - Flags: superreview?(bugs)
Attachment #220889 - Flags: review?(joe)
Attachment #220880 - Flags: superreview?(bugs)
Attachment #220880 - Flags: review?(joe)
Comment on attachment 220889 [details] [diff] [review]
Patch addressing Gavin's comments

+            menuitem.setAttribute("class", "menuitem-iconic searchbar-engine-menuitem");
+            if (this._engines[i] == this.currentEngine)
+              menuitem.setAttribute("selected", "true");

If the style is keyed to the "selected" attribute, why do you need to set the class?  (Also, how does the "selected" attribute get cleared?)
(In reply to comment #8)
> Also, how does the "selected" attribute get cleared?

I guess that was initially done by the rebuilding of the menu in the previous patches.
(In reply to comment #8)
> (From update of attachment 220889 [details] [diff] [review] [edit])
> +            menuitem.setAttribute("class", "menuitem-iconic
> searchbar-engine-menuitem");
> +            if (this._engines[i] == this.currentEngine)
> +              menuitem.setAttribute("selected", "true");
> 
> If the style is keyed to the "selected" attribute, why do you need to set the
> class?  (Also, how does the "selected" attribute get cleared?)

The class has to be set to menuitem-iconic in any case, so adding searchbar-engine-menuitem has very little cost, and would allow a theme to distinguish between these add-engine items and other items in the list.

The menu is now rebuilt when a new engine is selected, as well as when one is added or removed, which keeps the "selected" attribute in sync.  If we want, that could be done with a different function that only updates the "selected" mark on an "engine-current" notification.
Attachment #221002 - Flags: superreview?(bugs)
Attachment #221002 - Flags: review?(joe)
Attachment #220889 - Attachment is obsolete: true
Attachment #220889 - Flags: superreview?(bugs)
Attachment #220889 - Flags: review?(joe)
Attachment #221002 - Flags: review?(joe) → review+
Comment on attachment 221002 [details] [diff] [review]
Added comments explaining clearing of "selected" attribute

sr=ben@mozilla.org
Attachment #221002 - Flags: superreview?(bugs) → superreview+
fixed-1.8-branch, fixed-on-trunk
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
cool feature.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: