Equalized font size

This commit is contained in:
Maximilian Giller 2019-03-24 21:27:32 +01:00
parent 019d150e78
commit 6dd6de16ce
6 changed files with 10 additions and 10 deletions

View file

@ -26,6 +26,7 @@ fonts = {
}
defaultfont = fonts[font_boldness]
defaultfontsize = 14
datetime_locals = {
"de" : "de_DE.UTF-8",

View file

@ -19,7 +19,6 @@ dayrowsarea_ypos = todayheader_size[1]
dayrowsarea_height = 1 - todayheader_size[1]
dayrow_min_format = 50 / 384
dayrow_max_format = 70 / 384
rss_x_fontsize = 14 / 384
rss_y_padding = 5
class DayListPanel (PanelDesign):
@ -53,10 +52,9 @@ class DayListPanel (PanelDesign):
height = infoarea_replacedrowscount * self.dayrow_size[1] * self.size[1] - rss_y_padding
ypos = self.size[1] - height
size = (self.size[0], height)
fontsize = rss_x_fontsize * size[0]
pos = (0, ypos)
design = RssPostListDesign(size, rss, fontsize)
design = RssPostListDesign(size, rss)
design.pos = pos
self.draw_design(design)

View file

@ -1,11 +1,12 @@
from DesignEntity import DesignEntity
from TableTextDesign import TableTextDesign
from settings import language
from Assets import defaultfontsize
class EventListDesign (DesignEntity):
"""Creates a TableTextDesign filled with event
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)
self.events = events
self.__event_matrix__ = []

View file

@ -26,7 +26,6 @@ weekrownameboxsize = (0.143, 0.044)
eventcirclehorizontalsize = 0.100
infolisthorizontalpos = 0.008
infolistsize = (1, 0.77)
infolisttextsizeize = 16
class MonthOvPanel (PanelDesign):
"""Overview that focuses on the current month and
@ -71,7 +70,7 @@ class MonthOvPanel (PanelDesign):
month_height = self.month_block.get_real_height()
size = self.__abs_pos__(infolistsize)
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))
self.draw_design(info_list)
@ -82,7 +81,7 @@ class MonthOvPanel (PanelDesign):
size = (size[0], size[1] - month_height)
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))
self.draw_design(info_list)

View file

@ -1,10 +1,11 @@
from DesignEntity import DesignEntity
from TableTextDesign import TableTextDesign
from Assets import defaultfontsize
class RssPostListDesign (DesignEntity):
"""Creates a TableTextDesign filled with rss post
date and title"""
def __init__ (self, size, rssfeed, text_size = 18):
def __init__ (self, size, rssfeed, text_size = defaultfontsize):
super(RssPostListDesign, self).__init__(size)
self.rssfeed = rssfeed
self.__post_matrix__ = []

View file

@ -1,13 +1,13 @@
from EventListDesign import EventListDesign
from settings import hours
from Assets import fonts
from Assets import fonts, defaultfontsize
eventlist_allday_char = ""
font = fonts["regular"]
class SingelDayEventListDesign (EventListDesign):
"""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)
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)