Equalized font size
This commit is contained in:
parent
019d150e78
commit
6dd6de16ce
6 changed files with 10 additions and 10 deletions
|
@ -26,6 +26,7 @@ fonts = {
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultfont = fonts[font_boldness]
|
defaultfont = fonts[font_boldness]
|
||||||
|
defaultfontsize = 14
|
||||||
|
|
||||||
datetime_locals = {
|
datetime_locals = {
|
||||||
"de" : "de_DE.UTF-8",
|
"de" : "de_DE.UTF-8",
|
||||||
|
|
|
@ -19,7 +19,6 @@ dayrowsarea_ypos = todayheader_size[1]
|
||||||
dayrowsarea_height = 1 - todayheader_size[1]
|
dayrowsarea_height = 1 - todayheader_size[1]
|
||||||
dayrow_min_format = 50 / 384
|
dayrow_min_format = 50 / 384
|
||||||
dayrow_max_format = 70 / 384
|
dayrow_max_format = 70 / 384
|
||||||
rss_x_fontsize = 14 / 384
|
|
||||||
rss_y_padding = 5
|
rss_y_padding = 5
|
||||||
|
|
||||||
class DayListPanel (PanelDesign):
|
class DayListPanel (PanelDesign):
|
||||||
|
@ -53,10 +52,9 @@ class DayListPanel (PanelDesign):
|
||||||
height = infoarea_replacedrowscount * self.dayrow_size[1] * self.size[1] - rss_y_padding
|
height = infoarea_replacedrowscount * self.dayrow_size[1] * self.size[1] - rss_y_padding
|
||||||
ypos = self.size[1] - height
|
ypos = self.size[1] - height
|
||||||
size = (self.size[0], height)
|
size = (self.size[0], height)
|
||||||
fontsize = rss_x_fontsize * size[0]
|
|
||||||
pos = (0, ypos)
|
pos = (0, ypos)
|
||||||
|
|
||||||
design = RssPostListDesign(size, rss, fontsize)
|
design = RssPostListDesign(size, rss)
|
||||||
design.pos = pos
|
design.pos = pos
|
||||||
self.draw_design(design)
|
self.draw_design(design)
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
from DesignEntity import DesignEntity
|
from DesignEntity import DesignEntity
|
||||||
from TableTextDesign import TableTextDesign
|
from TableTextDesign import TableTextDesign
|
||||||
from settings import language
|
from settings import language
|
||||||
|
from Assets import defaultfontsize
|
||||||
|
|
||||||
class EventListDesign (DesignEntity):
|
class EventListDesign (DesignEntity):
|
||||||
"""Creates a TableTextDesign filled with event
|
"""Creates a TableTextDesign filled with event
|
||||||
begin date and title"""
|
begin date and title"""
|
||||||
def __init__ (self, size, events, text_size = 16, line_spacing = 2, col_spacing = 10, event_prefix_func = None, font_family = None, general_color = "black", background_color = "white", highlight_color = "red", show_more_info = False):
|
def __init__ (self, size, events, text_size = defaultfontsize, line_spacing = 2, col_spacing = 10, event_prefix_func = None, font_family = None, general_color = "black", background_color = "white", highlight_color = "red", show_more_info = False):
|
||||||
super(EventListDesign, self).__init__(size)
|
super(EventListDesign, self).__init__(size)
|
||||||
self.events = events
|
self.events = events
|
||||||
self.__event_matrix__ = []
|
self.__event_matrix__ = []
|
||||||
|
|
|
@ -26,7 +26,6 @@ weekrownameboxsize = (0.143, 0.044)
|
||||||
eventcirclehorizontalsize = 0.100
|
eventcirclehorizontalsize = 0.100
|
||||||
infolisthorizontalpos = 0.008
|
infolisthorizontalpos = 0.008
|
||||||
infolistsize = (1, 0.77)
|
infolistsize = (1, 0.77)
|
||||||
infolisttextsizeize = 16
|
|
||||||
|
|
||||||
class MonthOvPanel (PanelDesign):
|
class MonthOvPanel (PanelDesign):
|
||||||
"""Overview that focuses on the current month and
|
"""Overview that focuses on the current month and
|
||||||
|
@ -71,7 +70,7 @@ class MonthOvPanel (PanelDesign):
|
||||||
month_height = self.month_block.get_real_height()
|
month_height = self.month_block.get_real_height()
|
||||||
size = self.__abs_pos__(infolistsize)
|
size = self.__abs_pos__(infolistsize)
|
||||||
size = (size[0], size[1] - month_height)
|
size = (size[0], size[1] - month_height)
|
||||||
info_list = RssPostListDesign(size, rss, text_size=infolisttextsizeize)
|
info_list = RssPostListDesign(size, rss)
|
||||||
info_list.pos = (int(month_pos[0] + infolisthorizontalpos * self.size[0]), int(month_pos[1] + month_height))
|
info_list.pos = (int(month_pos[0] + infolisthorizontalpos * self.size[0]), int(month_pos[1] + month_height))
|
||||||
self.draw_design(info_list)
|
self.draw_design(info_list)
|
||||||
|
|
||||||
|
@ -82,7 +81,7 @@ class MonthOvPanel (PanelDesign):
|
||||||
size = (size[0], size[1] - month_height)
|
size = (size[0], size[1] - month_height)
|
||||||
|
|
||||||
events = calendar.get_upcoming_events()
|
events = calendar.get_upcoming_events()
|
||||||
info_list = EventListDesign(size, events, text_size=infolisttextsizeize)
|
info_list = EventListDesign(size, events)
|
||||||
info_list.pos = (int(month_pos[0] + infolisthorizontalpos * self.size[0]), int(month_pos[1] + month_height))
|
info_list.pos = (int(month_pos[0] + infolisthorizontalpos * self.size[0]), int(month_pos[1] + month_height))
|
||||||
self.draw_design(info_list)
|
self.draw_design(info_list)
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
from DesignEntity import DesignEntity
|
from DesignEntity import DesignEntity
|
||||||
from TableTextDesign import TableTextDesign
|
from TableTextDesign import TableTextDesign
|
||||||
|
from Assets import defaultfontsize
|
||||||
|
|
||||||
class RssPostListDesign (DesignEntity):
|
class RssPostListDesign (DesignEntity):
|
||||||
"""Creates a TableTextDesign filled with rss post
|
"""Creates a TableTextDesign filled with rss post
|
||||||
date and title"""
|
date and title"""
|
||||||
def __init__ (self, size, rssfeed, text_size = 18):
|
def __init__ (self, size, rssfeed, text_size = defaultfontsize):
|
||||||
super(RssPostListDesign, self).__init__(size)
|
super(RssPostListDesign, self).__init__(size)
|
||||||
self.rssfeed = rssfeed
|
self.rssfeed = rssfeed
|
||||||
self.__post_matrix__ = []
|
self.__post_matrix__ = []
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
from EventListDesign import EventListDesign
|
from EventListDesign import EventListDesign
|
||||||
from settings import hours
|
from settings import hours
|
||||||
from Assets import fonts
|
from Assets import fonts, defaultfontsize
|
||||||
|
|
||||||
eventlist_allday_char = "•"
|
eventlist_allday_char = "•"
|
||||||
font = fonts["regular"]
|
font = fonts["regular"]
|
||||||
|
|
||||||
class SingelDayEventListDesign (EventListDesign):
|
class SingelDayEventListDesign (EventListDesign):
|
||||||
"""Specialized event list for day list design."""
|
"""Specialized event list for day list design."""
|
||||||
def __init__ (self, size, events, font_size = 16, line_spacing=2, col_spacing=5, general_color="black", background_color="white", highlight_color="red"):
|
def __init__ (self, size, events, font_size = defaultfontsize, line_spacing=2, col_spacing=5, general_color="black", background_color="white", highlight_color="red"):
|
||||||
prefix_func = lambda x : self.__get_event_prefix__(x)
|
prefix_func = lambda x : self.__get_event_prefix__(x)
|
||||||
super().__init__(size, events, text_size=font_size, line_spacing=line_spacing, col_spacing=col_spacing, event_prefix_func=prefix_func, font_family=font, show_more_info=True, general_color=general_color, background_color=background_color, highlight_color = highlight_color)
|
super().__init__(size, events, text_size=font_size, line_spacing=line_spacing, col_spacing=col_spacing, event_prefix_func=prefix_func, font_family=font, show_more_info=True, general_color=general_color, background_color=background_color, highlight_color = highlight_color)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue