mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Start work on UI for font size
This commit is contained in:
parent
a09f70ea22
commit
c2e11c6ce5
@ -10,6 +10,7 @@ from widgets import create_spinner, create_button
|
|||||||
from gettext import gettext as _
|
from gettext import gettext as _
|
||||||
from read_book.toc import create_toc_panel
|
from read_book.toc import create_toc_panel
|
||||||
from read_book.prefs.main import create_prefs_panel
|
from read_book.prefs.main import create_prefs_panel
|
||||||
|
from read_book.prefs.font_size import create_font_size_panel
|
||||||
|
|
||||||
class LoadingMessage: # {{{
|
class LoadingMessage: # {{{
|
||||||
|
|
||||||
@ -170,7 +171,7 @@ class MainOverlay:
|
|||||||
),
|
),
|
||||||
|
|
||||||
E.ul(
|
E.ul(
|
||||||
ac(_('Font size'), _('Change text size'), None, 'Aa', True),
|
ac(_('Font size'), _('Change text size'), self.overlay.show_font_size_chooser, 'Aa', True),
|
||||||
ac(_('Preferences'), _('Configure the book reader'), self.overlay.show_prefs, 'cogs'),
|
ac(_('Preferences'), _('Configure the book reader'), self.overlay.show_prefs, 'cogs'),
|
||||||
),
|
),
|
||||||
class_=MAIN_OVERLAY_ACTIONS_CLASS
|
class_=MAIN_OVERLAY_ACTIONS_CLASS
|
||||||
@ -252,6 +253,14 @@ class PrefsOverlay: # {{{
|
|||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
class FontSizeOverlay:
|
||||||
|
|
||||||
|
def __init__(self, overlay):
|
||||||
|
self.overlay = overlay
|
||||||
|
|
||||||
|
def show(self, container):
|
||||||
|
create_font_size_panel(container)
|
||||||
|
|
||||||
class Overlay:
|
class Overlay:
|
||||||
|
|
||||||
def __init__(self, view):
|
def __init__(self, view):
|
||||||
@ -328,3 +337,7 @@ class Overlay:
|
|||||||
def show_prefs(self):
|
def show_prefs(self):
|
||||||
self.panels = [PrefsOverlay(self)]
|
self.panels = [PrefsOverlay(self)]
|
||||||
self.show_current_panel()
|
self.show_current_panel()
|
||||||
|
|
||||||
|
def show_font_size_chooser(self):
|
||||||
|
self.panels = [FontSizeOverlay(self)]
|
||||||
|
self.show_current_panel()
|
||||||
|
13
src/pyj/read_book/prefs/font_size.pyj
Normal file
13
src/pyj/read_book/prefs/font_size.pyj
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# vim:fileencoding=utf-8
|
||||||
|
# License: GPL v3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
|
||||||
|
from __python__ import hash_literals, bound_methods
|
||||||
|
|
||||||
|
from elementmaker import E
|
||||||
|
|
||||||
|
def create_font_size_panel(container):
|
||||||
|
container.appendChild(E.div(
|
||||||
|
style='margin:15vh auto; max-width: 500px; border-radius: 8px; border: solid 1px currentColor',
|
||||||
|
onclick=def(ev): ev.preventDefault(), ev.stopPropagation
|
||||||
|
))
|
||||||
|
|
||||||
|
develop = create_font_size_panel
|
Loading…
x
Reference in New Issue
Block a user