Skip to content

[New module] FancyContextMenu #9

Description

@roundedrectangle

In Quickddit, there are a few files related to extended ContextMenu functionality (FancyContextMenu, FancyMenuItemRow, FancyMenuItem, and FancyMenuImage). I thought it would be nice to organize this in an Opal module, so created one here.

Here is an example (with my modified version linked above):

Screenshot_20241218_160751_001

import QtQuick 2.0
import Sailfish.Silica 1.0
import '../modules/FancyContextMenu'

Page {
    SilicaListView {
        anchors.fill: parent
        model: 3

        delegate: ListItem {
            id: item
            Label {
                text: "Message"
                x: Theme.horizontalPageMargin
                y: Theme.paddingLarge
            }

            menu: Component {
                FancyContextMenu {
                    listItem: item
                    FancyMenuRow {
                        FancyMenuIcon {
                            icon.source: "image://theme/icon-m-clipboard"
                            onClicked: console.log("copying")
                        }
                        FancyMenuIcon {
                            icon.source: "image://theme/icon-m-delete"
                        }
                        FancyMenuIcon {
                            icon.source: "image://theme/icon-m-edit"
                        }
                    }

                    FancyMenuRow {
                        FancyIconMenuItem {
                            icon.source: "image://theme/icon-m-message-reply"
                            text: "Reply"
                            onClicked: console.log("replying")
                        }
                        FancyMenuItem {
                            text: "Forward"
                        }
                    }

                    MenuItem {
                        text: "About user"
                        onClicked: console.log("opening about user")
                    }

                    FancyAloneIconMenuItem {
                        icon.source: "image://theme/icon-m-favorite"
                        text: "Add to favourites"
                        onClicked: console.log("adding to favourites")
                    }
                }
            }
        }
    }
}

This is not yet fully complete, I still have to write documentation and add screenshots

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions