M himitsu_gtk/ui/main.glade => himitsu_gtk/ui/main.glade +18 -9
@@ 367,19 367,28 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
- <object class="GtkMenuButton">
+ <object class="GtkBox">
<property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="focus-on-click">False</property>
- <property name="receives-default">True</property>
- <property name="draw-indicator">True</property>
- <property name="popup">addmenu</property>
+ <property name="can-focus">False</property>
<child>
- <object class="GtkLabel">
+ <object class="GtkButton" id="add">
<property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="label" translatable="yes">Add</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <signal name="clicked" handler="on_add_clicked" swapped="no"/>
+ <child>
+ <object class="GtkImage">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="icon-name">value-increase-symbolic</property>
+ </object>
+ </child>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
</child>
</object>
<packing>
M himitsu_gtk/window.py => himitsu_gtk/window.py +2 -14
@@ 264,28 264,16 @@ class KeyringWindow:
self.addkey.insert(row, -1)
def on_add_clicked(self, widget, *args):
- name = Gtk.Buildable.get_name(widget)
self.mainstack.set_visible_child_name('add')
self.empty(self.addkey)
self.add_entry_key = []
self.add_entry_val = []
- if name == 'web':
- self.addkey_add_placeholder('proto', 'web')
- self.addkey_add_placeholder('host')
- self.addkey_add_placeholder('username')
- self.addkey_add_placeholder('password!')
- else:
- self.addkey_add_placeholder('proto')
-
+ self.addkey_add_placeholder('proto')
self.addkey_add_placeholder()
self.addkey.show_all()
self.leaflet.set_visible_child_name("main")
-
- if name == 'basic':
- self.add_entry_val[0].grab_focus()
- elif name == 'web':
- self.add_entry_val[1].grab_focus()
+ self.add_entry_val[0].grab_focus()
def on_add_keypress(self, *args):
has_empty = False