Commit ba435245 authored by Nate Graham's avatar Nate Graham
Browse files

Don't put HeaderBar in a parent Item

Summary: It seems unnecessary to have this kind of indirection, and now the code is simplified.

Test Plan:
- Maximize headerbar
- Look at main window

No visual changes in any case

Reviewers: mgallien, #elisa

Reviewed By: mgallien, #elisa

Differential Revision: https://phabricator.kde.org/D21938
parent 93bcbd07
......@@ -176,90 +176,84 @@ ApplicationWindow {
anchors.fill: parent
spacing: 0
Item {
id: headerBarParent
HeaderBar {
id: headerBar
focus: true
Layout.minimumHeight: mainWindow.height * 0.2 + elisaTheme.mediaPlayerControlHeight
Layout.maximumHeight: mainWindow.height * 0.2 + elisaTheme.mediaPlayerControlHeight
Layout.fillWidth: true
HeaderBar {
id: headerBar
focus: true
anchors.fill: parent
tracksCount: elisa.manageHeaderBar.remainingTracks
album: elisa.manageHeaderBar.album
title: elisa.manageHeaderBar.title
artist: elisa.manageHeaderBar.artist
albumArtist: elisa.manageHeaderBar.albumArtist
image: elisa.manageHeaderBar.image
albumID: elisa.manageHeaderBar.albumId
ratingVisible: false
playerControl.duration: elisa.audioPlayer.duration
playerControl.seekable: elisa.audioPlayer.seekable
playerControl.volume: persistentSettings.playControlItemVolume
playerControl.muted: persistentSettings.playControlItemMuted
playerControl.position: elisa.audioPlayer.position
playerControl.skipBackwardEnabled: elisa.playerControl.skipBackwardControlEnabled
playerControl.skipForwardEnabled: elisa.playerControl.skipForwardControlEnabled
playerControl.playEnabled: elisa.playerControl.playControlEnabled
playerControl.isPlaying: elisa.playerControl.musicPlaying
playerControl.repeat: elisa.mediaPlayList.repeatPlay
playerControl.shuffle: elisa.mediaPlayList.randomPlay
playerControl.onSeek: elisa.audioPlayer.seek(position)
playerControl.onPlay: elisa.audioControl.playPause()
playerControl.onPause: elisa.audioControl.playPause()
playerControl.onPlayPrevious: elisa.mediaPlayList.skipPreviousTrack()
playerControl.onPlayNext: elisa.mediaPlayList.skipNextTrack()
playerControl.isMaximized: persistentSettings.headerBarIsMaximized
onOpenArtist: { contentView.openArtist(artist) }
onOpenNowPlaying: { contentView.openNowPlaying() }
onOpenAlbum: { contentView.openAlbum(album, albumArtist, image, albumID) }
TrackImportNotification {
id: importedTracksCountNotification
anchors
{
right: headerBar.right
top: headerBar.top
rightMargin: elisaTheme.layoutHorizontalMargin * 1.75
topMargin: elisaTheme.layoutHorizontalMargin * 3
}
tracksCount: elisa.manageHeaderBar.remainingTracks
album: elisa.manageHeaderBar.album
title: elisa.manageHeaderBar.title
artist: elisa.manageHeaderBar.artist
albumArtist: elisa.manageHeaderBar.albumArtist
image: elisa.manageHeaderBar.image
albumID: elisa.manageHeaderBar.albumId
ratingVisible: false
playerControl.duration: elisa.audioPlayer.duration
playerControl.seekable: elisa.audioPlayer.seekable
playerControl.volume: persistentSettings.playControlItemVolume
playerControl.muted: persistentSettings.playControlItemMuted
playerControl.position: elisa.audioPlayer.position
playerControl.skipBackwardEnabled: elisa.playerControl.skipBackwardControlEnabled
playerControl.skipForwardEnabled: elisa.playerControl.skipForwardControlEnabled
playerControl.playEnabled: elisa.playerControl.playControlEnabled
playerControl.isPlaying: elisa.playerControl.musicPlaying
playerControl.repeat: elisa.mediaPlayList.repeatPlay
playerControl.shuffle: elisa.mediaPlayList.randomPlay
playerControl.onSeek: elisa.audioPlayer.seek(position)
playerControl.onPlay: elisa.audioControl.playPause()
playerControl.onPause: elisa.audioControl.playPause()
playerControl.onPlayPrevious: elisa.mediaPlayList.skipPreviousTrack()
playerControl.onPlayNext: elisa.mediaPlayList.skipNextTrack()
playerControl.isMaximized: persistentSettings.headerBarIsMaximized
onOpenArtist: { contentView.openArtist(artist) }
onOpenNowPlaying: { contentView.openNowPlaying() }
onOpenAlbum: { contentView.openAlbum(album, albumArtist, image, albumID) }
TrackImportNotification {
id: importedTracksCountNotification
anchors
{
right: headerBar.right
top: headerBar.top
rightMargin: elisaTheme.layoutHorizontalMargin * 1.75
topMargin: elisaTheme.layoutHorizontalMargin * 3
}
}
Binding {
target: importedTracksCountNotification
property: 'musicManager'
value: elisa.musicManager
when: elisa.musicManager !== undefined
}
Binding {
target: importedTracksCountNotification
property: 'musicManager'
value: elisa.musicManager
when: elisa.musicManager !== undefined
}
Binding {
id: indexerBusyBinding
Binding {
id: indexerBusyBinding
target: importedTracksCountNotification
property: 'indexingRunning'
value: elisa.musicManager.indexerBusy
when: elisa.musicManager !== undefined
}
target: importedTracksCountNotification
property: 'indexingRunning'
value: elisa.musicManager.indexerBusy
when: elisa.musicManager !== undefined
}
Binding {
target: importedTracksCountNotification
property: 'importedTracksCount'
value: elisa.musicManager.importedTracksCount
when: elisa.musicManager !== undefined
}
Binding {
target: importedTracksCountNotification
property: 'importedTracksCount'
value: elisa.musicManager.importedTracksCount
when: elisa.musicManager !== undefined
}
}
......@@ -291,7 +285,7 @@ ApplicationWindow {
explicit: true
},
PropertyChanges {
target: headerBarParent
target: headerBar
Layout.minimumHeight: mainWindow.height * 0.2 + elisaTheme.mediaPlayerControlHeight
Layout.maximumHeight: mainWindow.height * 0.2 + elisaTheme.mediaPlayerControlHeight
}
......@@ -307,7 +301,7 @@ ApplicationWindow {
explicit: true
},
PropertyChanges {
target: headerBarParent
target: headerBar
Layout.minimumHeight: mainWindow.height
Layout.maximumHeight: mainWindow.height
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment