Skip to content
Snippets Groups Projects

qt: various corrections in sort menu

Open Fatih Uzunoğlu requested to merge fuzun/vlc:qt/sortmenufixes into master
1 unresolved thread

See individual commits.

Request review @chub.

Merge request reports

Members who can merge are allowed to add commits.

Merge request pipeline #512738 passed

Merge request pipeline passed for b8b632bd

Test coverage 18.41% (-0.04%) from 1 job
Ready to merge by members who can write to the target branch.
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • added MRStatus::InReview label and removed MRStatus::Reviewable label

  • Pierre Lamot
    Pierre Lamot @chub started a thread on commit b8b632bd
  • 1015 if (key == currentKey && currentOrder == order)
    1016 action->setChecked(true);
    1017 };
    1018
    1019 for (const QVariant& it: m_controler->getSortKeyTitleList())
    1020 {
    1021 const QVariantMap varmap = it.toMap();
    1022
    1023 auto key = static_cast<PlaylistController::SortKey>(varmap.value("key").toInt());
    1024 QString label = varmap.value("text").toString();
    1025
    1026 addSortAction(qtr("%1 Ascending").arg(label), key, PlaylistController::SORT_ORDER_ASC);
    1027 addSortAction(qtr("%1 Descending").arg(label), key, PlaylistController::SORT_ORDER_DESC);
    1028 }
    1001 action = m_menu->addAction( qtr("Sort menu...") );
    1002 connect(action, &QAction::triggered, this, &PlaylistContextMenu::requestOpenSortMenu);
    • that's weird.... I would expect the the sort menu to be a submenu of the current menu rather than closing the current menu to open a new one

    • Author Reporter
      • It is a really bad idea to re-implement sort menu multiple times for maintenance reasons. In fact, the current broken status proves that point. It seems you agree with me in this regard.
      • It seems that most applications do not provide sort sub menu in the right click context menu, so in my opinion it is not relevant if it is a sub-menu, or it is an independent menu. The point is providing a way for the keyboard to trigger sorting, and as the toolbar can not be focused, this is a way to do that.
      • Sort control manages the sort menu itself. I tried to embed the menu before, but decided to not do that because I did not want to map the sorting properties multiple times (as SortMenu is generic). SortControl does that already:
              const model = root.model.map(function(modelData) {
                  const checked = modelData.criteria === sortKey
                  const order = checked ? root.sortOrder : undefined
                  return {
                      "text": modelData.text,
                      "checked": checked,
                      "order": order
                  }
              })
    • Author Reporter

      Can we proceed?

    • no, sub-menu entries should not popup as independent menus, this breaks UX conventions. especially since this is the only submenu that behaves like this in our application

    • Author Reporter

      That's not a response to my previous message. Going this way is the best for maintenance.

      If this breaks UX conventions, I propose removing the sub-menu and letting the playlist tool bar buttons accept focus on tab.

    • the issue is that the SortMenu (the C++ class) is only designed to be used from QML. This make reusing the menu in other scenario difficult. perhaps we should split the menu creation (having static QMenu* SortMenu::buildMenu(...)` and the popup function which instantiate and shows the menu for QML purpose. this would make the menu reusable and embed-able in other menus.

    • Author Reporter

      Menu creation still needs mapped model. That is passed from SortControl, so we still can not add submenu in the context menu as you would need to access the sort control.

      Note that this is an already existing bug and I would prefer it to be fixed as soon as possible. It can be improved in the future.

    • Author Reporter

      I made the sort control focusable in !6280 (merged). If you want, I can remove the sort entry in the context menu. Sorting can be done through the sort button directly with keyboard, there is not much reason anymore to keep the entry in the context menu.

    • I don't think we should lose the menu entry

    • Author Reporter

      I don't have a strong opinion on that, but I prefer removing it if it is a maintenance burden. Is there any application that has sort menu in the context menu?

    • Is there any application that has sort menu in the context menu?

      VLC 3.0, Dolphin for instance

    • Please register or sign in to reply
  • Jean-Baptiste Kempf requested review from @chub

    requested review from @chub

  • Fatih Uzunoğlu mentioned in merge request !6590 (merged)

    mentioned in merge request !6590 (merged)

  • Steve Lhomme changed milestone to %4.0

    changed milestone to %4.0

  • added MRStatus::Stale label and removed MRStatus::InReview label

  • Please register or sign in to reply
    Loading