From 2a94c1fb90ad2463602be8a7268f1b0134aa7ac2 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 17 May 2019 09:04:26 +0200 Subject: [PATCH] Implemented line_thickness setting in all designs --- Calendar/AgendaListDesign.py | 3 ++- Calendar/AgendaListPanel.py | 4 ++-- Calendar/DayViewPanel.py | 4 ++-- Calendar/HourListDesign.py | 6 +++--- Calendar/MonthOvPanel.py | 4 ++-- Calendar/MonthViewPanel.py | 4 ++-- Calendar/settings.py.sample | 2 +- README.md | 3 ++- 8 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Calendar/AgendaListDesign.py b/Calendar/AgendaListDesign.py index 096c66d..c938c6e 100644 --- a/Calendar/AgendaListDesign.py +++ b/Calendar/AgendaListDesign.py @@ -4,8 +4,9 @@ from datetime import datetime, date, timedelta from TableDesign import TableDesign from PIL import ImageDraw, ImageFont from TextFormatter import date_summary_str, event_prefix_str +from settings import line_thickness -separator_width = 1 +separator_width = line_thickness class AgendaListDesign (DesignEntity): '''Lists upcoming events in chronological order and groups them by days''' diff --git a/Calendar/AgendaListPanel.py b/Calendar/AgendaListPanel.py index 9cf8b6c..44cd6bf 100644 --- a/Calendar/AgendaListPanel.py +++ b/Calendar/AgendaListPanel.py @@ -1,14 +1,14 @@ from PanelDesign import PanelDesign from AgendaListDesign import AgendaListDesign from WeatherHeaderDesign import WeatherHeaderDesign -from settings import general_settings +from settings import general_settings, line_thickness from PIL import ImageDraw from Assets import colors from RssPostListDesign import RssPostListDesign agenda_ypadding = 5 weatherheader_height = 0.113 -seperator_width = 3 +seperator_width = line_thickness infolist_size = (1, 0.24) infolist_padding = 2 diff --git a/Calendar/DayViewPanel.py b/Calendar/DayViewPanel.py index 95bac18..88e6b9f 100644 --- a/Calendar/DayViewPanel.py +++ b/Calendar/DayViewPanel.py @@ -2,7 +2,7 @@ from PanelDesign import PanelDesign from datetime import datetime, timedelta, date from DayHeaderDesign import DayHeaderDesign from HourListDesign import HourListDesign -from settings import general_settings +from settings import general_settings, line_thickness from RssPostListDesign import RssPostListDesign from PIL import ImageDraw from Assets import colors @@ -13,7 +13,7 @@ hourlist_size = (1, 1 - header_size[1]) default_shownhours_count = 12 infoarea_replaced_hours = 4 -infoarea_borderline_width = 1 +infoarea_borderline_width = line_thickness infoarea_padding = 5 class DayViewPanel (PanelDesign): diff --git a/Calendar/HourListDesign.py b/Calendar/HourListDesign.py index b6e43b5..47283a7 100644 --- a/Calendar/HourListDesign.py +++ b/Calendar/HourListDesign.py @@ -1,5 +1,5 @@ from DesignEntity import DesignEntity -from settings import hours, language +from settings import hours, language,line_thickness from TextDesign import TextDesign from PIL import ImageDraw from Assets import colors, defaultfontsize, fonts @@ -14,8 +14,8 @@ hoursubtext_height = 0.45 event_title_fontsize = defaultfontsize event_title_xpadding = 3 event_title_ypadding = 5 -line_thickness = 1 -currenttimeline_thickness = 2 +line_thickness = line_thickness +currenttimeline_thickness = line_thickness event_title_font = fonts['bold'] diff --git a/Calendar/MonthOvPanel.py b/Calendar/MonthOvPanel.py index b935b8f..29263e1 100644 --- a/Calendar/MonthOvPanel.py +++ b/Calendar/MonthOvPanel.py @@ -11,7 +11,7 @@ from EllipseDesign import EllipseDesign from MonthBlockDesign import MonthBlockDesign, daynumberboxsize from EventListDesign import EventListDesign from RssPostListDesign import RssPostListDesign -from settings import general_settings +from settings import general_settings, line_thickness weatherheadersize = (1,0.113) monthboxsize = (1, 0.085) @@ -110,7 +110,7 @@ class MonthOvPanel (PanelDesign): def __draw_seperator__ (self): """Draw a line seperating the weather and Calendar section""" - ImageDraw.Draw(self.__image__).line([ self.__abs_pos__(seperatorplace), self.__abs_pos__((1, seperatorplace[1])) ], fill='red', width=5) + ImageDraw.Draw(self.__image__).line([ self.__abs_pos__(seperatorplace), self.__abs_pos__((1, seperatorplace[1])) ], fill='red', width=line_thickness) def __draw_month_name__ (self): """Draw the icon with the current month's name""" diff --git a/Calendar/MonthViewPanel.py b/Calendar/MonthViewPanel.py index fe130f0..294520d 100644 --- a/Calendar/MonthViewPanel.py +++ b/Calendar/MonthViewPanel.py @@ -1,5 +1,5 @@ from PanelDesign import PanelDesign -from settings import general_settings, week_starts_on +from settings import general_settings, week_starts_on, line_thickness from PIL import ImageDraw from datetime import date from Assets import colors @@ -12,7 +12,7 @@ from WeatherHeaderDesign import WeatherHeaderDesign weather_height = 0.113 info_height = 0.25 info_padding = 5 -seperator_width = 3 +seperator_width = line_thickness class MonthViewPanel (PanelDesign): """Displays a grid of the day of the current month diff --git a/Calendar/settings.py.sample b/Calendar/settings.py.sample index 9af2205..8327d14 100644 --- a/Calendar/settings.py.sample +++ b/Calendar/settings.py.sample @@ -26,8 +26,8 @@ update_interval = 60 """DESIGN""" font_size = 14 # does not affect every text font_boldness = "semibold" # extralight, light, regular, semibold, bold, extrabold -line_thickness = 1 #1-3 Thickness advised // Default = 1 // day-list view only! choosen_design = "month-overview" # month-overview, day-list, day-view, agenda-list, month-view +line_thickness = 1 # 1-3 Thickness advised general_settings = { # General settings that designs may use "info-area" : "rss", # empty, events, rss "highlight-event-days" : True, diff --git a/README.md b/README.md index 628f8f9..5fa6c30 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,8 @@ Once the packages are installed, navigate to the home directory, open 'E-Paper-M | --- | --- | | font_size | Varies the size of the font. Can be any number >0. In some cases the size of the font is fixed by the design. Default value is `14`. | | font_boldness | Varies the boldness of the font. Can be one of `extralight`, `light`, `regular`, `semibold`, `bold` or `extrabold`. In some cases the boldness of the font is fixed by the design. Default value is `regular`. | -| choosen_design | Sets the desired panel design. Can be one of `month-overview` or `day-list`. | +| choosen_design | Sets the desired panel design. | +| line_thickness | Varies the boldness of separation lines in the choosen design. | | general_settings | A dictionary containing options that some designs use to optimize there design. Possible options are as follows: | | `"info-area"` | Defines the content type of an additionaly info area on the design. Can be one of `"rss"`, `"events"` or empty, to remove this area or keep it clean. | | `"highlight-event-days"` | If set to `True`, days with events are highlighted in contrast to days without events. |