centering the about dialog

This commit is contained in:
sezanzeb 2021-03-22 22:50:08 +01:00
parent c54258fc97
commit b4c0cf109f
2 changed files with 8 additions and 0 deletions

View File

@ -215,6 +215,7 @@ To give your keys back their original mapping.</property>
<property name="tooltip-text" translatable="yes">Presets need to be saved before they can be applied. <property name="tooltip-text" translatable="yes">Presets need to be saved before they can be applied.
Don't hold down any keys while the injection starts.</property> Don't hold down any keys while the injection starts.</property>
<property name="image">check-icon</property> <property name="image">check-icon</property>
<property name="relief">none</property>
<property name="always-show-image">True</property> <property name="always-show-image">True</property>
<signal name="clicked" handler="on_apply_preset_clicked" swapped="no"/> <signal name="clicked" handler="on_apply_preset_clicked" swapped="no"/>
</object> </object>
@ -232,6 +233,7 @@ Don't hold down any keys while the injection starts.</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="receives-default">True</property> <property name="receives-default">True</property>
<property name="image">copy-icon</property> <property name="image">copy-icon</property>
<property name="relief">none</property>
<property name="always-show-image">True</property> <property name="always-show-image">True</property>
<signal name="clicked" handler="on_copy_preset_clicked" swapped="no"/> <signal name="clicked" handler="on_copy_preset_clicked" swapped="no"/>
</object> </object>
@ -249,6 +251,7 @@ Don't hold down any keys while the injection starts.</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="receives-default">True</property> <property name="receives-default">True</property>
<property name="image">new-icon</property> <property name="image">new-icon</property>
<property name="relief">none</property>
<property name="always-show-image">True</property> <property name="always-show-image">True</property>
<signal name="clicked" handler="on_create_preset_clicked" swapped="no"/> <signal name="clicked" handler="on_create_preset_clicked" swapped="no"/>
</object> </object>
@ -266,6 +269,7 @@ Don't hold down any keys while the injection starts.</property>
<property name="can-focus">True</property> <property name="can-focus">True</property>
<property name="receives-default">True</property> <property name="receives-default">True</property>
<property name="image">delete-icon</property> <property name="image">delete-icon</property>
<property name="relief">none</property>
<property name="always-show-image">True</property> <property name="always-show-image">True</property>
<signal name="clicked" handler="on_delete_preset_clicked" swapped="no"/> <signal name="clicked" handler="on_delete_preset_clicked" swapped="no"/>
</object> </object>
@ -365,6 +369,7 @@ Don't hold down any keys while the injection starts.</property>
<property name="tooltip-text" translatable="yes">Save the entered name</property> <property name="tooltip-text" translatable="yes">Save the entered name</property>
<property name="margin-start">6</property> <property name="margin-start">6</property>
<property name="image">save-icon</property> <property name="image">save-icon</property>
<property name="relief">none</property>
<signal name="clicked" handler="on_rename_button_clicked" swapped="no"/> <signal name="clicked" handler="on_rename_button_clicked" swapped="no"/>
</object> </object>
<packing> <packing>

View File

@ -135,6 +135,9 @@ class Window:
self.confirm_delete = builder.get_object('confirm-delete') self.confirm_delete = builder.get_object('confirm-delete')
self.about = builder.get_object('about-dialog') self.about = builder.get_object('about-dialog')
self.about.connect('delete-event', on_close_about) self.about.connect('delete-event', on_close_about)
# set_position needs to be done once initially, otherwise the
# dialog is not centered when it is opened for the first time
self.about.set_position(Gtk.WindowPosition.CENTER_ON_PARENT)
self.get('version-label').set_text( self.get('version-label').set_text(
f'key-mapper {version} {COMMIT_HASH[:7]}' f'key-mapper {version} {COMMIT_HASH[:7]}'