From 358968327db17ec63fecddd975f69b425547821c Mon Sep 17 00:00:00 2001 From: Raatty Date: Fri, 17 Apr 2020 15:52:01 +1200 Subject: [PATCH] version 2 maybe? --- interface.ui | 10 +++++++--- lightdm-mobile-greeter.py | 24 +++++++++++++++++++++++- style.css | 8 ++++++++ 3 files changed, 38 insertions(+), 4 deletions(-) diff --git a/interface.ui b/interface.ui index 9122c7c..f3bbafa 100644 --- a/interface.ui +++ b/interface.ui @@ -97,7 +97,7 @@ True edit-clear-symbolic - 80 + 6 @@ -105,13 +105,17 @@ True True False - + True applications-system-symbolic - 80 + 6 + + settings_btn + GTK_POS_RIGHT + diff --git a/lightdm-mobile-greeter.py b/lightdm-mobile-greeter.py index 4086e27..2b2dca0 100644 --- a/lightdm-mobile-greeter.py +++ b/lightdm-mobile-greeter.py @@ -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( diff --git a/style.css b/style.css index 4cfe3e5..7879a93 100644 --- a/style.css +++ b/style.css @@ -43,3 +43,11 @@ hdykeypad > button label{ font-size: 2em; } +popover { + background-color: black; + font-size: 2em; +} + +popover radiobutton { + padding: 1em; +}