Merge lp://qastaging/~unity-team/unity/unity.fix-741657 into lp://qastaging/unity

Proposed by Mirco Müller
Status: Merged
Approved by: Jason Smith
Approved revision: no longer in the source branch.
Merged at revision: 1077
Proposed branch: lp://qastaging/~unity-team/unity/unity.fix-741657
Merge into: lp://qastaging/unity
Diff against target: 86 lines (+42/-1)
2 files modified
src/QuicklistView.cpp (+39/-0)
src/QuicklistView.h (+3/-1)
To merge this branch: bzr merge lp://qastaging/~unity-team/unity/unity.fix-741657
Reviewer Review Type Date Requested Status
Jason Smith (community) Approve
Review via email: mp+55517@code.qastaging.launchpad.net

Description of the change

Skip over separator items in Quicklists, if walking them with keyboard-navigation. Fixes LP: #741657

To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) wrote :

On Thu, 31 Mar 2011 00:27:20 you wrote:
> Mirco Müller has proposed merging lp:~unity-team/unity/unity.fix-741657
> into lp:unity.
>
> Requested reviews:
> Unity Team (unity-team)
> Related bugs:
> Bug #741657 in unity: "quicklist key-nav needs to ignore separator items"
> https://bugs.launchpad.net/unity/+bug/741657
>
> For more details, see:
> https://code.launchpad.net/~unity-team/unity/unity.fix-741657/+merge/55517
>
> Skip over separator items in Quicklists, if walking them with
> keyboard-navigation. Fixes LP: #741657

How about adding a method like like:

bool menu_item_is_seperator(int index) const
{
  DbusmenuMenuitem* item = GetNthItems(index)->_menuItem;
  const gchar* label = dbusmenu_menuitem_property_get(
      item, DBUSMENU_MENUITEM_PROP_LABEL);
  return label != 0;
}

Then you can use it in the up and down code:

     case NUX_VK_UP:
       if (_current_item_index > 0)
       {
         GetNthItems (_current_item_index)->_prelight = false;
         --_current_item_index;
         while (menu_item_is_seperator(_current_item_index)
         {
           --_current_item_index;
         }
         GetNthItems (_current_item_index)->_prelight = true;
         QueueDraw ();
       }

This makes the code in the case a little easier to understand.

Revision history for this message
Mirco Müller (macslow) wrote :

Made code more readable.

Revision history for this message
Jason Smith (jassmith) wrote :

Does this handle the case where the last or first item is a separator?

review: Needs Information
Revision history for this message
Tim Penhey (thumper) wrote :

On Fri, 01 Apr 2011 08:41:06 you wrote:
> Review: Needs Information
> Does this handle the case where the last or first item is a separator?

Not very well in the original form.

Revision history for this message
Mirco Müller (macslow) wrote :

I does... now :)

Revision history for this message
Mirco Müller (macslow) wrote :

Doh... need to remerge with trunk.

Revision history for this message
Mirco Müller (macslow) wrote :

Ok, everything is in order again.

Revision history for this message
Jason Smith (jassmith) wrote :

Looks better now!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.