-
-
Notifications
You must be signed in to change notification settings - Fork 16
Add age declaration UI #270
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,8 +15,9 @@ public class SwitchboardPlugUserAccounts.NewUserDialog : Granite.Dialog { | |
|
|
||
| construct { | ||
| var accounttype_combobox = new Gtk.ComboBoxText (); | ||
| accounttype_combobox.append_text (_("Standard User")); | ||
| accounttype_combobox.append_text (_("Administrator")); | ||
| accounttype_combobox.append_text (_("Adult (Standard)")); | ||
| accounttype_combobox.append_text (_("Adult (Administrator)")); | ||
| accounttype_combobox.append_text (_("Child")); | ||
| accounttype_combobox.set_active (0); | ||
|
|
||
| var accounttype_label = new Granite.HeaderLabel (_("Account Type")) { | ||
|
|
@@ -32,6 +33,24 @@ public class SwitchboardPlugUserAccounts.NewUserDialog : Granite.Dialog { | |
| mnemonic_widget = realname_entry | ||
| }; | ||
|
|
||
| var dob_datepicker = new Granite.DatePicker () { | ||
| // elementary Icons birthday | ||
| date = new DateTime.from_unix_utc (1190401200) | ||
| }; | ||
|
|
||
| var dob_header = new Granite.HeaderLabel (_("Date of Birth")) { | ||
| secondary_text = _("Age and birthday are never shared. Age range is shared with apps to provide appropriate experiences."), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It gets a little tricky to say that "age and birthday are never shared" if the user uses an application the day their age bracket changes. This can be solved by using a small randomized offset that reduces the age value when exposing it to applications. But if this exists, explaining the age range has such offset and that the precise range is not shared is also helpful.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it will be better to wait to hash out the details of explainer text until the portal is more finalized. Please keep in mind this is only a draft and it is not marked ready for review |
||
| margin_top = 12 | ||
| }; | ||
|
|
||
| var dob_box = new Granite.Box (VERTICAL, HALF); | ||
| dob_box.append (dob_header); | ||
| dob_box.append (dob_datepicker); | ||
|
|
||
| var dob_revealer = new Gtk.Revealer () { | ||
| child = dob_box | ||
| }; | ||
|
|
||
| username_entry = new Granite.ValidatedEntry (); | ||
|
|
||
| var username_label = new Granite.HeaderLabel (_("Username")) { | ||
|
|
@@ -52,6 +71,7 @@ public class SwitchboardPlugUserAccounts.NewUserDialog : Granite.Dialog { | |
| form_box.append (new ErrorRevealer (".")); | ||
| form_box.append (realname_label); | ||
| form_box.append (realname_entry); | ||
| form_box.append (dob_revealer); | ||
| form_box.append (new ErrorRevealer (".")); | ||
| form_box.append (username_label); | ||
| form_box.append (username_entry); | ||
|
|
@@ -83,6 +103,10 @@ public class SwitchboardPlugUserAccounts.NewUserDialog : Granite.Dialog { | |
| update_create_button (); | ||
| }); | ||
|
|
||
| accounttype_combobox.changed.connect (() => { | ||
| dob_revealer.reveal_child = accounttype_combobox.active == 2; | ||
| }); | ||
|
|
||
| response.connect ((response_id) => { | ||
| if (response_id == Gtk.ResponseType.OK) { | ||
| string fullname = realname_entry.text; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we indicate below what age someone is a child? Does this depend on locale?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we're probably going to need a lot more explainer text in the end