View Single Post
Posts: 4 | Thanked: 45 times | Joined on Dec 2013
#3
Originally Posted by velox View Post
I really would like those favourite Items to be available in the "Pulley" PullDownMenu, but I have not figured out how to feed a Model (which is pretty easy to manipulate from JS, perfect for me) there – funny, because for SilicaListView it just did what I wanted instantly without me needing a clue about… anything, to be honest.
Have I missed something really obvious? It surely seems like it.
Maybe it's not obvious, but at least it's easy

Code:
PullDownMenu {
    Repeater {
        model: 4

        MenuItem {
            text: "Item #" + model.index
        }
    }
}
The "4" in this example can be any QML model type (http://qt-project.org/doc/qt-5.1/qtq...ew.html#models). In a quick test, changing the value updates the menu, at least as long as the menu isn't currently open.

Originally Posted by velox View Post
Also, what should be the expected outcome of a long press on a List Item in your opinion? Should there be a sub section popping out containing more options? Should I push a whole new Page to the Stack?
I feel that functionally a ContextMenu could suffice, but it's rather limited in displaying information like that appropriately, because it would have to tell the user the name, current state (enabled/disabled) and that you can actually toggle it. (Am I wrong? Please correct me!)
The convention in our UI is to highlight the item that the context menu is open for (using highlightBackgroundColor as its background, and highlightColor for text), and for context menu items to be verbs ("Enable", "Disable"). That seems like enough to show that you can toggle it. Maybe the current state should be part of the delegate itself, maybe by using the secondary text color?
 

The Following 4 Users Say Thank You to jbrooks For This Useful Post: