Changeset View
Changeset View
Standalone View
Standalone View
src/qml/MediaPlayListView.qml
Show First 20 Lines • Show All 136 Lines • ▼ Show 20 Line(s) | 107 | ColumnLayout { | |||
---|---|---|---|---|---|
137 | 137 | | |||
138 | RowLayout { | 138 | RowLayout { | ||
139 | Layout.fillWidth: true | 139 | Layout.fillWidth: true | ||
140 | 140 | | |||
141 | LabelWithToolTip { | 141 | LabelWithToolTip { | ||
142 | id: playListInfo | 142 | id: playListInfo | ||
143 | 143 | | |||
144 | text: i18np("1 track", "%1 tracks", playListModel.tracksCount) | 144 | text: i18np("1 track", "%1 tracks", playListModel.tracksCount) | ||
145 | visible: playListModelDelegate.count > 0 | ||||
145 | color: myPalette.text | 146 | color: myPalette.text | ||
146 | Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter | 147 | Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter | ||
147 | } | 148 | } | ||
148 | 149 | | |||
149 | Item { Layout.fillWidth: true } | 150 | Item { Layout.fillWidth: true } | ||
150 | 151 | | |||
151 | Controls1.ToolButton { action: showCurrentTrack } | 152 | Controls1.ToolButton { action: showCurrentTrack } | ||
152 | Controls1.ToolButton { action: savePlaylist } | 153 | Controls1.ToolButton { action: savePlaylist } | ||
153 | Controls1.ToolButton { action: loadPlaylist } | 154 | Controls1.ToolButton { action: loadPlaylist } | ||
154 | Controls1.ToolButton { action: clearPlayList } | 155 | Controls1.ToolButton { action: clearPlayList } | ||
155 | } | 156 | } | ||
156 | 157 | | |||
157 | Item { Layout.fillHeight: true } | 158 | Item { Layout.fillHeight: true } | ||
158 | 159 | | |||
159 | } | 160 | } | ||
160 | 161 | | |||
162 | ColumnLayout { | ||||
163 | id: emptyPlaylistText | ||||
164 | spacing: 0 | ||||
165 | visible: playListModelDelegate.count === 0 | ||||
166 | Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter | ||||
167 | Layout.fillHeight: true | ||||
astippich: Anchors on layout gives a warning. You should be able to remove it or use the Layout. | |||||
168 | Layout.fillWidth: true | ||||
169 | | ||||
170 | Item { Layout.fillHeight: true } | ||||
Unfortunately, now this creates a binding loop and gives a warning, because the parent height also depends on the margin. Item { Layout.fillHeight: true } astippich: Unfortunately, now this creates a binding loop and gives a warning, because the parent height… | |||||
True, but I can't think of any other way to center this item vertically otherwise. If I use the previous property it ends up too low (because it's taking into account the height of the entire sidebar). januz: True, but I can't think of any other way to center this item vertically otherwise. If I use the… | |||||
171 | | ||||
172 | Image { | ||||
173 | Layout.alignment: Qt.AlignHCenter | ||||
174 | | ||||
175 | width: elisaTheme.gridDelegateWidth * 5 | ||||
176 | height: elisaTheme.gridDelegateWidth * 5 | ||||
177 | | ||||
178 | source: elisaTheme.playlistIcon | ||||
179 | opacity: 0.25 | ||||
180 | | ||||
181 | sourceSize { | ||||
182 | width: elisaTheme.viewSelectorDelegateHeight * 5 | ||||
183 | height: elisaTheme.viewSelectorDelegateHeight * 5 | ||||
184 | } | ||||
185 | } | ||||
186 | | ||||
187 | Text { | ||||
188 | font.pointSize: elisaTheme.defaultFontPointSize * 2 | ||||
189 | Layout.fillWidth: true | ||||
190 | Layout.alignment: Qt.AlignHCenter | ||||
191 | | ||||
192 | color: myPalette.text | ||||
193 | horizontalAlignment: Text.AlignHCenter | ||||
194 | text: i18nc("Your playlist is empty", "Your playlist is empty") | ||||
195 | } | ||||
small nitpick here: it's imho not really a title, so I would write astippich: small nitpick here: it's imho not really a title, so I would write
"Your playlist is empty." | |||||
196 | | ||||
197 | Text { | ||||
198 | Layout.topMargin: 5 | ||||
199 | font.pointSize: elisaTheme.defaultFontPointSize | ||||
200 | Layout.maximumWidth: 300 | ||||
201 | Layout.preferredWidth: 300 | ||||
202 | Layout.alignment: Qt.AlignHCenter | ||||
203 | wrapMode: Text.WordWrap | ||||
204 | color: myPalette.text | ||||
205 | horizontalAlignment: Text.AlignHCenter | ||||
206 | text: i18nc("Text shown when play list is empty", "Add some songs to get started. You can browse your music using the views on the left.") | ||||
207 | } | ||||
208 | | ||||
209 | Item { Layout.fillHeight: true } | ||||
210 | | ||||
211 | } | ||||
161 | 212 | | |||
162 | ListView { | 213 | ListView { | ||
163 | id: playListView | 214 | id: playListView | ||
164 | Layout.fillWidth: true | 215 | Layout.fillWidth: true | ||
165 | Layout.fillHeight: true | 216 | Layout.fillHeight: true | ||
166 | Layout.topMargin: elisaTheme.layoutVerticalMargin | | |||
167 | 217 | | |||
168 | focus: true | 218 | focus: true | ||
169 | 219 | | |||
170 | ScrollBar.vertical: ScrollBar { | 220 | ScrollBar.vertical: ScrollBar { | ||
171 | id: scrollBar | 221 | id: scrollBar | ||
172 | } | 222 | } | ||
173 | boundsBehavior: Flickable.StopAtBounds | 223 | boundsBehavior: Flickable.StopAtBounds | ||
174 | clip: true | 224 | clip: true | ||
175 | 225 | | |||
176 | ScrollHelper { | 226 | ScrollHelper { | ||
177 | id: scrollHelper | 227 | id: scrollHelper | ||
178 | flickable: playListView | 228 | flickable: playListView | ||
179 | anchors.fill: playListView | 229 | anchors.fill: playListView | ||
180 | } | 230 | } | ||
181 | 231 | | |||
182 | TextEdit { | | |||
183 | readOnly: true | | |||
184 | visible: playListModelDelegate.count === 0 | | |||
185 | wrapMode: TextEdit.Wrap | | |||
186 | | ||||
187 | color: myPalette.text | | |||
188 | | ||||
189 | font.weight: Font.ExtraLight | | |||
190 | font.pixelSize: elisaTheme.defaultFontPixelSize * 1.5 | | |||
191 | | ||||
192 | text: i18nc("Text shown when play list is empty", "Your play list is empty.\nIn order to start, you can explore your music library with the views on the left.\nUse the available buttons to add your selection.") | | |||
193 | anchors.fill: parent | | |||
194 | anchors.margins: elisaTheme.layoutHorizontalMargin | | |||
195 | } | | |||
196 | | ||||
197 | add: Transition { | 232 | add: Transition { | ||
198 | NumberAnimation { | 233 | NumberAnimation { | ||
199 | property: "opacity"; | 234 | property: "opacity"; | ||
200 | from: 0; | 235 | from: 0; | ||
201 | to: 1; | 236 | to: 1; | ||
202 | duration: 100 } | 237 | duration: 100 } | ||
203 | } | 238 | } | ||
204 | 239 | | |||
▲ Show 20 Lines • Show All 107 Lines • Show Last 20 Lines |
Anchors on layout gives a warning. You should be able to remove it or use the Layout.fillWidth/Height properties