Mainly added function to retreive the actual height, which depends on the month
This commit is contained in:
parent
0678a6711a
commit
dbfafda49a
1 changed files with 8 additions and 2 deletions
|
@ -25,7 +25,7 @@ class MonthBlockDesign (DesignEntity):
|
||||||
|
|
||||||
def __draw_month_overview__ (self):
|
def __draw_month_overview__ (self):
|
||||||
"""Using the built-in calendar function, draw icons for each
|
"""Using the built-in calendar function, draw icons for each
|
||||||
number of the month (1,2,3,...28,29,30)"""
|
number of the month (1,2,3,...29,30,31)"""
|
||||||
cal = callib.monthcalendar(self.year, self.month)
|
cal = callib.monthcalendar(self.year, self.month)
|
||||||
for week in cal:
|
for week in cal:
|
||||||
for numbers in week:
|
for numbers in week:
|
||||||
|
@ -74,4 +74,10 @@ class MonthBlockDesign (DesignEntity):
|
||||||
def __abs_pos__ (self, pos, size = None):
|
def __abs_pos__ (self, pos, size = None):
|
||||||
if size is None:
|
if size is None:
|
||||||
size = self.size
|
size = self.size
|
||||||
return (int(pos[0] * size[0]), int(pos[1] * size[1]))
|
return (int(pos[0] * size[0]), int(pos[1] * size[1]))
|
||||||
|
|
||||||
|
def get_real_height (self):
|
||||||
|
weeks_in_month = callib.monthcalendar(self.year, self.month)
|
||||||
|
num_size = self.__abs_pos__(daynumberboxsize)
|
||||||
|
num_pos = self.get_day_pos(len(weeks_in_month) - 1, 6)
|
||||||
|
return num_size[1] + num_pos[1]
|
Loading…
Reference in a new issue