Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶
type Component struct { *gtk.Box Inner *gtk.Box Loading *loading.PulsatingBar Methods *Methods Bottom *gtk.Box Remember *rememberMeBox ErrorRev *gtk.Revealer LogIn *gtk.Button // contains filtered or unexported fields }
LoginComponent is the main component in the login page.
func NewComponent ¶
NewComponent creates a new login Component.
type FormEntry ¶
type FormEntry struct { *gtk.Box Label *gtk.Label Entry *gtk.Entry }
FormEntry is a widget containing a label and an entry.
func NewFormEntry ¶
NewFormEntry creates a new FormEntry.
func (*FormEntry) ConnectActivate ¶
func (e *FormEntry) ConnectActivate(f func())
ConnectActivate connects the activate signal hanlder to the Entry.
func (*FormEntry) FocusNext ¶
func (e *FormEntry) FocusNext()
FocusNext navigates to the next widget.
func (*FormEntry) FocusNextOnActivate ¶
func (e *FormEntry) FocusNextOnActivate()
FocusNextOnActivate binds Enter to navigate to the next widget when it's pressed.
type LoadingPage ¶
type LoadingPage struct { *gtk.Box Header *gtk.HeaderBar Content struct { *gtk.WindowHandle Box *gtk.Box Spinner *gtk.Spinner Text *gtk.Label } }
LoadingPage is the busy spinner screen that's shown while the application is trying to log in.
func NewLoadingPage ¶
func NewLoadingPage(ctx context.Context) *LoadingPage
NewLoadingPage creates a new logging in loading screen.
func (*LoadingPage) SetText ¶
func (l *LoadingPage) SetText(text string)
SetText sets the text that's shown underneath the spinner.
type LoginController ¶
type LoginController interface { // Hook is called before the state is opened and before Ready is called. It // is meant to be called for hooking the handlers. Hook(*gtkcord.State) // Ready is called once the user has fully logged in. The session given to // the controller will have already been opened and have received the Ready // event. Ready(*gtkcord.State) // PromptLogin is called by the login page if the user needs to log in // again, either because their credentials are wrong or Discord returns a // server error. PromptLogin() }
LoginController is the parent controller that Page controls.
type Methods ¶
type Methods struct { *gtk.Notebook Email struct { *gtk.Box Email *FormEntry Password *FormEntry TOTP *FormEntry } Token struct { *gtk.Box Token *FormEntry } }
Methods is the notebook containing entries for different login methods.
type Page ¶
type Page struct { *gtk.Box Header *gtk.HeaderBar Login *Component // contains filtered or unexported fields }
Page is the page containing the login forms.
func NewPage ¶
func NewPage(ctx context.Context, ctrl LoginController) *Page
NewPage creates a new Page.
func (*Page) LoadKeyring ¶
func (p *Page) LoadKeyring()
LoadKeyring loads the session from the keyring.