UnreadMark.qml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /****************************************************************************
  2. **
  3. ** Copyright (C) 2012 Róbert Márki
  4. **
  5. ** This file is part of Web Feeds.
  6. **
  7. ** Web Feeds is free software: you can redistribute it and/or modify
  8. ** it under the terms of the GNU General Public License as published by
  9. ** the Free Software Foundation, either version 3 of the License, or
  10. ** (at your option) any later version.
  11. **
  12. ** Web Feeds is distributed in the hope that it will be useful,
  13. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. ** GNU General Public License for more details.
  16. **
  17. ** You should have received a copy of the GNU General Public License
  18. ** along with Web Feeds. If not, see <http://www.gnu.org/licenses/>.
  19. ****************************************************************************/
  20. import QtQuick 1.1
  21. import "../../../../shared/qml/UIConstants.js" as UIConstants
  22. Rectangle {
  23. id: unreadMark
  24. property bool active: false
  25. property int classification: 0
  26. color: unreadMark.active ?
  27. ((unreadMark.classification > 0) ? UIConstants.HIGHLIGHT_COLOR_POSITIVE : ((unreadMark.classification < 0) ? UIConstants.HIGHLIGHT_COLOR_NEGATIVE : UIConstants.HIGHLIGHT_COLOR)) :
  28. ((unreadMark.classification > 0) ? UIConstants.HIGHLIGHT_COLOR_POSITIVE_LIGHT : ((unreadMark.classification < 0) ? UIConstants.HIGHLIGHT_COLOR_NEGATIVE_LIGHT : UIConstants.HIGHLIGHT_COLOR_LIGHT));
  29. width: UIConstants.DEFAULT_HALF_MARGIN
  30. height: parent.height - UIConstants.DEFAULT_MARGIN
  31. }