Changeset View
Changeset View
Standalone View
Standalone View
kcmkwin/kwineffects/package/contents/ui/main.qml
Show All 39 Lines | 39 | Kirigami.SearchField { | |||
---|---|---|---|---|---|
40 | id: searchField | 40 | id: searchField | ||
41 | 41 | | |||
42 | Layout.fillWidth: true | 42 | Layout.fillWidth: true | ||
43 | } | 43 | } | ||
44 | 44 | | |||
45 | QtControls.Button { | 45 | QtControls.Button { | ||
46 | id: configureButton | 46 | id: configureButton | ||
47 | 47 | | |||
48 | QtControls.ToolTip.visible: hovered | 48 | checkable: true | ||
49 | QtControls.ToolTip.text: i18n("Configure filter") | | |||
50 | | ||||
51 | icon.name: "configure" | 49 | icon.name: "configure" | ||
52 | 50 | | |||
53 | onClicked: menu.opened ? menu.close() : menu.open() | 51 | onClicked: menu.opened ? menu.close() : menu.open() | ||
52 | | ||||
53 | QtControls.ToolTip { | ||||
54 | text: i18n("Configure Filter") | ||||
55 | } | ||||
54 | } | 56 | } | ||
55 | 57 | | |||
56 | QtControls.Menu { | 58 | QtControls.Menu { | ||
57 | id: menu | 59 | id: menu | ||
58 | 60 | | |||
59 | x: parent.width - width | 61 | x: parent.width - width | ||
60 | y: configureButton.height | 62 | y: configureButton.height | ||
61 | 63 | | |||
Show All 16 Lines | |||||
78 | } | 80 | } | ||
79 | } | 81 | } | ||
80 | 82 | | |||
81 | view: ListView { | 83 | view: ListView { | ||
82 | id: effectsList | 84 | id: effectsList | ||
83 | 85 | | |||
84 | property var _buttonGroups: [] | 86 | property var _buttonGroups: [] | ||
85 | 87 | | |||
86 | spacing: Kirigami.Units.smallSpacing | | |||
87 | | ||||
88 | model: Private.EffectsFilterProxyModel { | 88 | model: Private.EffectsFilterProxyModel { | ||
89 | id: searchModel | 89 | id: searchModel | ||
90 | 90 | | |||
91 | query: searchField.text | 91 | query: searchField.text | ||
92 | sourceModel: kcm.effectsModel | 92 | sourceModel: kcm.effectsModel | ||
93 | } | 93 | } | ||
94 | 94 | | |||
95 | delegate: Effect { | 95 | delegate: Effect { | ||
96 | width: effectsList.width | 96 | width: effectsList.width | ||
97 | } | 97 | } | ||
98 | 98 | | |||
99 | section.property: "CategoryRole" | 99 | section.property: "CategoryRole" | ||
100 | section.delegate: Item { | 100 | section.delegate:Kirigami.AbstractListItem { | ||
101 | width: effectsList.width | 101 | width: effectsList.width | ||
102 | height: sectionText.implicitHeight + 2 * Kirigami.Units.smallSpacing | | |||
103 | 102 | | |||
104 | QtControls.Label { | 103 | backgroundColor: Kirigami.Theme.backgroundColor | ||
105 | id: sectionText | 104 | Kirigami.Theme.inherit: false | ||
105 | Kirigami.Theme.colorSet: Kirigami.Theme.Window | ||||
106 | 106 | | |||
107 | anchors.fill: parent | 107 | hoverEnabled: false | ||
108 | supportsMouseEvents: false | ||||
108 | 109 | | |||
109 | color: Kirigami.Theme.disabledTextColor | 110 | QtControls.Label { | ||
110 | font.weight: Font.Bold | | |||
111 | horizontalAlignment: Text.AlignHCenter | | |||
112 | text: section | 111 | text: section | ||
113 | verticalAlignment: Text.AlignVCenter | | |||
114 | } | 112 | } | ||
115 | } | 113 | } | ||
116 | 114 | | |||
117 | function findButtonGroup(name) { | 115 | function findButtonGroup(name) { | ||
118 | for (let item of effectsList._buttonGroups) { | 116 | for (let item of effectsList._buttonGroups) { | ||
119 | if (item.name == name) { | 117 | if (item.name == name) { | ||
120 | return item.group; | 118 | return item.group; | ||
121 | } | 119 | } | ||
Show All 30 Lines |