Welcome to mirror list, hosted at ThFree Co, Russian Federation.

AutoSizingMenu.qml « tray « gui « src - github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: efc23d1bf5da5c7e53f155f63e4a4f6209bfab70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import QtQuick 2.15
import QtQuick.Controls 2.3
import Style 1.0

Menu {
    background: Rectangle {
        border.color: Style.menuBorder
        color: Style.backgroundColor
    }

    width: {
        var result = 0;
        var padding = 0;
        for (var i = 0; i < count; ++i) {
            var item = itemAt(i);
            result = Math.max(item.contentItem.implicitWidth, result);
            padding = Math.max(item.padding, padding);
        }
        return result + padding * 2;
    }
}