PwmFansTab.qml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright (C) 2015 Malte Veerman <maldela@halloarsch.de>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU Lesser General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public License along
  15. * with this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  17. *
  18. */
  19. import QtQuick 2.4
  20. import QtQuick.Controls 1.2
  21. import "../scripts/arrayfunctions.js" as ArrayFunctions
  22. ScrollView {
  23. property QtObject loader
  24. property real size: 1.0
  25. property real minTemp: 30.0
  26. property real maxTemp: 90.0
  27. property string unit: "Celsius"
  28. id: scrollView
  29. anchors.fill: parent
  30. anchors.topMargin: 5
  31. Flow {
  32. spacing: 20 * size
  33. width: scrollView.viewport.width
  34. move: Transition {
  35. NumberAnimation {
  36. easing.type: Easing.OutQuad
  37. properties: "x,y"
  38. duration: 300
  39. }
  40. }
  41. Repeater {
  42. property var fans: loader ? ArrayFunctions.allPwmFans(loader.hwmons) : []
  43. id: repeater
  44. model: fans.length
  45. PwmFan {
  46. width: 1000 * size
  47. hwRatio: 0.8
  48. fan: repeater.fans[index]
  49. loader: loader
  50. minTemp: scrollView.minTemp
  51. maxTemp: scrollView.maxTemp
  52. unit: scrollView.unit
  53. }
  54. }
  55. }
  56. }