Skip to content
Snippets Groups Projects
Verified Commit 373a5576 authored by Nico's avatar Nico
Browse files

Make GTK logic for onboarding screen work

parent 5848972c
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,21 @@ from .gi_composites import GtkTemplate
class BriarGtkWindow(Gtk.ApplicationWindow):
__gtype_name__ = 'BriarGtkWindow'
username_grid = GtkTemplate.Child()
username_entry = GtkTemplate.Child()
password_grid = GtkTemplate.Child()
password_entry = GtkTemplate.Child()
password_confirm_entry = GtkTemplate.Child()
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.init_template()
def on_username_button_clicked(self, button):
self.username_grid.set_visible(False)
self.password_grid.set_visible(True)
self.username = self.username_entry.get_text()
def on_password_button_clicked(self, button):
self.password = self.password_entry.get_text()
......@@ -21,39 +21,97 @@
<property name="margin_right">18</property>
<property name="margin_top">18</property>
<property name="margin_bottom">18</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkLabel" id="username-label">
<object class="GtkGrid" id="username_grid">
<property name="visible">True</property>
<property name="halign">center</property>
<property name="label" translatable="yes">Nickname</property>
<property name="can_focus">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkLabel" id="username-label">
<property name="visible">True</property>
<property name="halign">center</property>
<property name="label" translatable="yes">Nickname</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="username">
<property name="visible">True</property>
<property name="placeholder_text" translatable="yes">Choose your nickname</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="username-next">
<property name="visible">True</property>
<property name="halign">center</property>
<property name="label" translatable="yes">Next</property>
<signal name="clicked" handler="on_username_button_clicked"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="username">
<property name="visible">True</property>
<property name="placeholder_text" translatable="yes">Choose your nickname</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="username-next">
<property name="visible">True</property>
<property name="halign">center</property>
<property name="label" translatable="yes">Next</property>
<object class="GtkGrid" id="password_grid">
<property name="visible">False</property>
<property name="can_focus">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkLabel" id="password-label">
<property name="visible">True</property>
<property name="halign">center</property>
<property name="label" translatable="yes">Password</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="password">
<property name="visible">True</property>
<property name="placeholder_text" translatable="yes">Choose your password</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="password_confirm">
<property name="visible">True</property>
<property name="placeholder_text" translatable="yes">Confirm your password</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="password-next">
<property name="visible">True</property>
<property name="halign">center</property>
<property name="label" translatable="yes">Next</property>
<signal name="clicked" handler="on_password_button_clicked"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
</packing>
</child>
</object>
</child>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment