BottomNavigation.qml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import QtQuick 2.15
  2. import QtQuick.Controls 2.15
  3. import QtQuick.Layouts 1.15
  4. import "." as Components
  5. Rectangle {
  6. id: bottomNav
  7. property int currentIndex: 0
  8. signal tabClicked(int index)
  9. height: Components.ThemeManager.navHeight
  10. color: Components.ThemeManager.navBackground
  11. Rectangle {
  12. anchors.top: parent.top
  13. width: parent.width
  14. height: 1
  15. color: Components.ThemeManager.navBorder
  16. }
  17. RowLayout {
  18. anchors.fill: parent
  19. spacing: 0
  20. BottomNavTab {
  21. Layout.fillWidth: true
  22. Layout.fillHeight: true
  23. icon: "search"
  24. text: "Browse"
  25. active: bottomNav.currentIndex === 0
  26. onClicked: bottomNav.tabClicked(0)
  27. }
  28. BottomNavTab {
  29. Layout.fillWidth: true
  30. Layout.fillHeight: true
  31. icon: "playlist_play"
  32. text: "Playlists"
  33. active: bottomNav.currentIndex === 1
  34. onClicked: bottomNav.tabClicked(1)
  35. }
  36. BottomNavTab {
  37. Layout.fillWidth: true
  38. Layout.fillHeight: true
  39. icon: "tune"
  40. text: "Control"
  41. active: bottomNav.currentIndex === 2
  42. onClicked: bottomNav.tabClicked(2)
  43. }
  44. BottomNavTab {
  45. Layout.fillWidth: true
  46. Layout.fillHeight: true
  47. icon: "light_mode"
  48. text: "Light"
  49. active: bottomNav.currentIndex === 3
  50. onClicked: bottomNav.tabClicked(3)
  51. }
  52. BottomNavTab {
  53. Layout.fillWidth: true
  54. Layout.fillHeight: true
  55. icon: "play_circle"
  56. text: "Now Playing"
  57. active: bottomNav.currentIndex === 4
  58. onClicked: bottomNav.tabClicked(4)
  59. }
  60. }
  61. }