Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #253: Reset indicator time on NewUser, NewSeat and NewSession events #254

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

hotsezus
Copy link

@hotsezus hotsezus commented Mar 30, 2021

Fix #253

@hotsezus hotsezus force-pushed the master branch 2 times, most recently from 0e585cb to 488ae99 Compare March 30, 2021 08:00
@davidmhewitt
Copy link
Member

I don't think this fixes #253 as the TimeManager class is not used for the calendar widget.

@hotsezus
Copy link
Author

I don't think this fixes #253 as the TimeManager class is not used for the calendar widget.

Got it. Will look further to fix a bug

@jeremypw jeremypw marked this pull request as draft April 7, 2021 18:30
@Dirli
Copy link

Dirli commented May 14, 2021

DateTime.Widgets.Grid:
public void set_focus_to_today () { if (grid_range == null) { return; } Gee.List<GLib.DateTime> dates = grid_range.to_list (); for (int i = 0; i < dates.size; i++) { var date = dates[i]; GridDay? day = data[day_hash (date)]; if (day != null && day.name == "today") { day.grab_focus_force (); return; } } }
Think about it, it looks like that's where the problem is. I haven't checked yet, but it seems that you need to abandon the reference to "name=today", and directly access the desired day (via day_hash), and so that the old day is not lost, write it to a variable.
Perhaps tomorrow in my fork I will fix this error, you can do it by analogy.

@Dirli
Copy link

Dirli commented Jun 22, 2021

The problem turned out to be a little wider than I originally thought. There are two ways to solve it, in my opinion:

  1. the simple way is to reset the carousel when opening the widget. the carousel will be built again and correctly determine the current day
  2. a difficult way (in my opinion, more correct), to determine the current day at the level of the CalendarView (now you have at the level of CalendarGrid's). This will take much more time, unfortunately, I am not ready to transfer my conjectures to the main branch, but you can take this commit as a vector: Dirli/wingpanel-indicator-datetime@93f5a14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Highlighted 'today' day number falls out of sync over time
4 participants