You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123 lines
3.4 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. # -*- coding: utf-8 -*-
  2. #:kivy 1.9.0
  3. #:import SearchBox hadaly.search.SearchBox
  4. #:import SearchItemInfo hadaly.search.SearchItemInfo
  5. <SearchScreen>
  6. box: _box
  7. action_bar: _box.action_bar
  8. SearchBox:
  9. id: _box
  10. <SearchView@ContextualActionView>:
  11. action_group: _action_group
  12. use_separator: True
  13. ActionPrevious:
  14. app_icon: app.icon
  15. title:'Hadaly'
  16. with_previous: True
  17. on_press: app.root.current = 'editor'
  18. ActionOverflow:
  19. id: action_overflow
  20. ActionGroup:
  21. mode: 'spinner'
  22. auto_dismiss: True
  23. font_size: '20sp'
  24. text:_('Select a search engine')
  25. id: _action_group
  26. ActionButton:
  27. text: 'MetMuseum'
  28. on_press: _action_group.text = self.text
  29. on_release: _action_group._dropdown.select(self.parent.parent.select(self.text))
  30. ActionButton:
  31. text: 'Getty OCI'
  32. on_press: _action_group.text = self.text
  33. on_release: _action_group._dropdown.select(self.parent.parent.select(self.text))
  34. <SearchBox>:
  35. app: app
  36. orientation: 'vertical'
  37. padding: [0,0,0,0]
  38. spacing: dp(5)
  39. grid: _grid
  40. term: _term
  41. action_bar: _action_bar
  42. ActionBar:
  43. id: _action_bar
  44. search_view: _search_view
  45. SearchView:
  46. id: _search_view
  47. BoxLayout:
  48. orientation: 'horizontal'
  49. size_hint: 1, 0.1
  50. TextInput:
  51. id: _term
  52. on_text_validate: root.search(self.text, root.action_bar.search_view.action_group.text)
  53. font_size: '20sp'
  54. multiline: False
  55. GridLayout:
  56. id: _grid
  57. cols: 10
  58. padding: [dp(10),0,dp(10),dp(10)]
  59. spacing: dp(10)
  60. BoxLayout:
  61. id: _navigation_bar
  62. orientation: 'horizontal'
  63. padding: [dp(10),0,dp(10),dp(10)]
  64. size_hint: 1, 0.1
  65. Button:
  66. background_color: [1, 1, 1, 0]
  67. border_color: [1,1,1,1]
  68. text: u'\uf137'
  69. valign: 'middle'
  70. font_name: 'data/fonts/fontawesome-webfont.ttf'
  71. font_size: '40sp'
  72. size_hint: (None, None)
  73. size: (40, 40)
  74. size: self.texture_size
  75. on_release: root.search_previous(root.term.text, root.action_bar.search_view.action_group.text)
  76. Label:
  77. id: _status
  78. text: root.status
  79. Button:
  80. background_color: [1, 1, 1, 0]
  81. border_color: [1,1,1,1]
  82. text: u'\uf138'
  83. valign: 'middle'
  84. font_name: 'data/fonts/fontawesome-webfont.ttf'
  85. font_size: '40sp'
  86. size_hint: (None, None)
  87. size: (40, 40)
  88. size: self.texture_size
  89. on_release: root.search_next(root.term.text, root.action_bar.search_view.action_group.text)
  90. <SearchItemInfo>:
  91. app: app
  92. box: _box
  93. size_hint: 0.5, 0.7
  94. title: root.photo['title']
  95. BoxLayout:
  96. orientation: 'vertical'
  97. id: _box
  98. AsyncImage:
  99. id: _image
  100. source: root.thumbnail
  101. Button:
  102. size_hint_y: 0.1
  103. text: _('Add to presentation')
  104. size: self.texture_size
  105. on_press: root.dismiss()
  106. on_release: root.add_to_presentation()
  107. <ProgressDialog@Popup>:
  108. title: _('Downloading file...')
  109. id: _progress_dialog
  110. ProgressBar:
  111. max: root.max_value