History

check-in after menu experiments

https://highfidelity.fogbugz.com/f/cases/3714

Triplelexx committed 9 years ago

Commit 255e7811 parent 07e6b764 files · +58 −13Browse files

Showing the changes to interface/src/AvatarBookmarks.cpp (1 of 4 files). Show all

Unified · Split

interface/src/AvatarBookmarks.cpp+13−3
@@ -14,6 +14,7 @@ · 13 unmodified lines
1414 #include <QMessageBox>
1515 #include <QStandardPaths>
1616 #include <QQmlContext>
17+//#include <QQmlEngine>
1718
1819 #include <Application.h>
1920 #include <OffscreenUi.h>
@@ -39,7 +40,7 @@ void AvatarBookmarks::setupMenus(Menu* menubar, MenuWrapper* menu) { · 19 unmodified lines
3940 QObject::connect(_deleteBookmarksAction, SIGNAL(triggered()), this, SLOT(deleteBookmark()), Qt::QueuedConnection);
4041
4142 Bookmarks::setupMenus(menubar, menu);
42−
43+ Bookmarks::sortActions(menubar, _bookmarksMenu);
4344 auto offscreenUi = DependencyManager::get<OffscreenUi>();
4445 auto context = offscreenUi->getRootContext();
4546 context->setContextProperty("avatarBookmarks", this);
@@ -74,7 +75,16 @@ void AvatarBookmarks::addBookmarkToMenu(Menu* menubar, const QString& name, cons · 28 unmodified lines
7475 QAction* changeAction = _bookmarksMenu->newAction();
7576 changeAction->setData(address);
7677 connect(changeAction, SIGNAL(triggered()), this, SLOT(changeToBookmarkedAvatar()));
78+ if (!_isMenuSorted) {
79+ menubar->addActionToQMenuAndActionHash(_bookmarksMenu, changeAction, name, 0, QAction::NoRole);
80+ } else {
81+ // TODO: this is aggressive but all other alternative have proved less fruitful so far.
82+ // having experimented with various pointer types, It is possible the issues are deeper routed in the MenuWrapper/Menu Qt/QML architecture
83+ // further research did not produce better results
7784
78− menubar->addActionToQMenuAndActionHash(_bookmarksMenu, changeAction, name, 0, QAction::NoRole);
79− Bookmarks::sortActions(_bookmarksMenu);
85+ //menubar->addActionToQMenuAndActionHash(_bookmarksMenu, changeAction, name, 0, QAction::NoRole,
86+ //Bookmarks::getMenuItemLocation(_bookmarksMenu->actions(), name));
87+ menubar->addActionToQMenuAndActionHash(_bookmarksMenu, changeAction, name, 0, QAction::NoRole);
88+ Bookmarks::sortActions(menubar, _bookmarksMenu);
89+ }
8090 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t