Disabled unused buttons in grid
This commit is contained in:
parent
d0c59e2667
commit
a0e806b024
1 changed files with 13 additions and 9 deletions
|
|
@ -143,8 +143,9 @@ func setup_day_buttons():
|
|||
# print("weekday for {month}/{day}/{year}: ".format(date), get_weekday(date))
|
||||
clear_buttons()
|
||||
var iter = 1
|
||||
for i in range(first_weekday_month, first_weekday_month+days_in_month):
|
||||
var button = days.get_child(7+i) # +7 for labels
|
||||
for i in range (7, days.get_child_count()):
|
||||
var button = days.get_child(i)
|
||||
if i >= first_weekday+7 and i < first_weekday+days_in_month+7:
|
||||
button.set_text(str(iter))
|
||||
if button.is_connected("pressed", self, "emit_signal"):
|
||||
button.disconnect("pressed", self, "emit_signal")
|
||||
|
|
@ -152,6 +153,9 @@ func setup_day_buttons():
|
|||
if i == day:
|
||||
button.set_pressed(true)
|
||||
iter += 1
|
||||
button.set_disabled(false)
|
||||
else:
|
||||
button.set_disabled(true)
|
||||
|
||||
|
||||
func clear_buttons():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue