Commit fcb8b412 authored by Julian Sparber's avatar Julian Sparber

set focus for each stack view, fix #118

parent c2a2816e
Pipeline #5893 passed with stage
in 21 minutes and 56 seconds
......@@ -976,8 +976,6 @@
<property name="width_request">330</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="is_focus">True</property>
<property name="margin_bottom">6</property>
<property name="placeholder_text" translatable="yes">Matrix username, email or phone number</property>
<accessibility>
......
......@@ -313,6 +313,20 @@ impl AppOp {
.get_object::<gtk::Stack>("headerbar_stack")
.expect("Can't find headerbar_stack in ui file.")
.set_visible_child_name(bar_name);
//set focus for views
let widget_focus = match self.state {
AppState::Login => "login_username",
AppState::Directory => "directory_search_entry",
_ => "",
};
if widget_focus != "" {
self.gtk_builder
.get_object::<gtk::Widget>(widget_focus)
.expect("Can't find widget to set focus in ui file.")
.grab_focus();
}
}
pub fn escape(&mut self) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment