1
0
Fork 0

version 2 maybe?

This commit is contained in:
Raatty 2020-04-17 15:52:01 +12:00
parent b96074afe0
commit 358968327d
3 changed files with 38 additions and 4 deletions

View File

@ -97,7 +97,7 @@
<object class="GtkImage">
<property name="visible">True</property>
<property name="icon_name">edit-clear-symbolic</property>
<property name="icon_size">80</property>
<property name="icon_size">6</property>
</object>
</child>
</object>
@ -105,13 +105,17 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="focus-on-click">False</property>
<signal name="clicked" handler="backspace"/>
<signal name="clicked" handler="de_popover"/>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="icon_name">applications-system-symbolic</property>
<property name="icon_size">80</property>
<property name="icon_size">6</property>
</object>
</child>
</object>
<object class="GtkPopover" id="de_select">
<property name="relative_to">settings_btn</property>
<property name="position">GTK_POS_RIGHT</property>
</object>
</interface>

View File

@ -20,9 +20,28 @@ class Handler:
self.greeter.connect("show-prompt", self.show_prompt)
self.pmpt_label = builder.get_object("prompt_label")
self.msg_label = builder.get_object("message_label")
self.de_select = builder.get_object("de_select")
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, visible=True)
self.de_select.add(vbox)
self.greeter.connect_sync()
self.conf = Config()
self.greeter.authenticate(self.conf.user)
self.session = self.greeter.get_default_session_hint()
sessions = iter([(s.get_name(), s.get_key()) for s in LightDM.get_sessions()])
name, key = sessions.__next__()
first = Gtk.RadioButton.new_with_label(None, name)
first.connect("toggled", self.session_change, key)
vbox.add(first)
for name, key in sessions:
rb = Gtk.RadioButton.new_with_label_from_widget(first, name)
rb.connect("toggled", self.session_change, key)
vbox.add(rb)
if self.session == key:
rb.set_active(True)
vbox.show_all()
def session_change(self, rb, key):
self.session = key
def on_destry(self, window):
Gtk.main_quit()
@ -39,7 +58,7 @@ class Handler:
def auth_complete(self, greeter):
if greeter.get_is_authenticated():
greeter.start_session_sync(None)
greeter.start_session_sync(self.session)
else:
greeter.authenticate(self.conf.user)
@ -49,6 +68,9 @@ class Handler:
def show_prompt(self, greeter, text, type):
self.pmpt_label.set_text(text)
def de_popover(self, settings_btn):
self.de_select.popup()
Handy.Keypad()
builder: Gtk.Builder = Gtk.Builder.new_from_file(

View File

@ -43,3 +43,11 @@ hdykeypad > button label{
font-size: 2em;
}
popover {
background-color: black;
font-size: 2em;
}
popover radiobutton {
padding: 1em;
}