Browse Source

Fix search results size & code cleaning

Removed forced option for logging & fullscreen.
fix_readme v0.1a
octogene 6 years ago
parent
commit
5fd99b895f
4 changed files with 10 additions and 11 deletions
  1. +1
    -4
      hadaly/app.py
  2. +1
    -0
      hadaly/editor.kv
  3. +2
    -2
      hadaly/search.kv
  4. +6
    -5
      hadaly/search.py

+ 1
- 4
hadaly/app.py View File

@ -24,9 +24,6 @@ from PIL import Image
import tarfile
from kivy.config import Config
Config.set('kivy', 'log_level', 'debug')
Config.set('graphics', 'fullscreen', '0')
from kivy.app import App
from kivy.core.window import Window
from kivy.properties import StringProperty, ListProperty, DictProperty, NumericProperty
@ -499,7 +496,7 @@ class HadalyApp(App):
for photo in results:
Logger.debug('Search (MET): Loading {url}'.format(url=photo['thumb']))
image = ItemButton(photo=photo, source=photo['thumb'], keep_ratio=True, size_hint=(None, None))
image = ItemButton(photo=photo, source=photo['thumb'], keep_ratio=True)
search_screen.box.grid.add_widget(image)
search_screen.box.status = "Page {page} on {total_page}".format(page=search_screen.box.current_page,


+ 1
- 0
hadaly/editor.kv View File

@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
#:kivy 1.9.0
#:import win kivy.core.window
<EditorScreen@Screen>:
slides_view: _slides_view


+ 2
- 2
hadaly/search.kv View File

@ -57,9 +57,9 @@
multiline: False
GridLayout:
id: _grid
cols: self.width / 100
cols: 10
padding: [dp(10),0,dp(10),dp(10)]
spacing: dp(5)
spacing: dp(10)
BoxLayout:
id: _navigation_bar
orientation: 'horizontal'


+ 6
- 5
hadaly/search.py View File

@ -7,19 +7,20 @@ except ImportError:
from urllib.parse import urlparse, parse_qs
import urllib
from lxml import html
from os.path import splitext, basename
from kivy.uix.boxlayout import BoxLayout
from kivy.factory import Factory
from kivy.uix.image import AsyncImage
from kivy.uix.button import ButtonBehavior, Button
from kivy.properties import DictProperty, ObjectProperty, StringProperty
from kivy.uix.popup import Popup
from kivy.uix.label import Label
from kivy.core.window import Window
from .editor import Slide
from kivy.logger import Logger
from kivy.uix.screenmanager import Screen
from kivy.uix.dropdown import DropDown
from kivy.metrics import dp
class SearchScreen(Screen):
@ -58,9 +59,9 @@ class SearchBox(BoxLayout):
popup.add_widget(Label(text=_('Please select a search engine.')))
popup.open()
elif provider == 'MetMuseum':
results = self.app.search_term(term, providers[provider], self.current_page)
self.app.search_term(term, providers[provider], self.current_page)
elif provider == 'Getty OCI':
results = self.app.search_term(term, providers[provider], self.current_page)
self.app.search_term(term, providers[provider], self.current_page)
def search_next(self, text, provider):
if self.current_page < self.total_pages:


Loading…
Cancel
Save