WIP: icônes
This commit is contained in:
parent
ddc7a362be
commit
e06b241d01
|
@ -36,6 +36,9 @@ class GemGraphApplication(Adw.Application):
|
|||
self.create_action('quit', self.quit, ['<primary>q'])
|
||||
self.create_action('about', self.on_about_action)
|
||||
self.create_action('preferences', self.on_preferences_action)
|
||||
self.create_action('editmode', self.on_editmode_action, ['<primary>e'])
|
||||
self.create_action('runmode', self.on_runmode_action, ['<primary>r'])
|
||||
self.create_action('presentmode', self.on_presentmode_action, ['<primary>p'])
|
||||
|
||||
def do_activate(self):
|
||||
"""Called when the application is activated.
|
||||
|
@ -58,6 +61,18 @@ class GemGraphApplication(Adw.Application):
|
|||
"""Callback for the app.preferences action."""
|
||||
print('app.preferences action activated')
|
||||
|
||||
def on_editmode_action(self, widget, _):
|
||||
"""Callback for the app.preferences action."""
|
||||
print('app.editmode action activated')
|
||||
|
||||
def on_runmode_action(self, widget, _):
|
||||
"""Callback for the app.preferences action."""
|
||||
print('app.runmode action activated')
|
||||
|
||||
def on_presentmode_action(self, widget, _):
|
||||
"""Callback for the app.preferences action."""
|
||||
print('app.presentmode action activated')
|
||||
|
||||
def create_action(self, name, callback, shortcuts=None):
|
||||
"""Add an application action.
|
||||
|
||||
|
@ -77,4 +92,4 @@ class GemGraphApplication(Adw.Application):
|
|||
def main(version):
|
||||
"""The application's entry point."""
|
||||
app = GemGraphApplication()
|
||||
return app.run(sys.argv)
|
||||
return app.run(sys.argv)
|
||||
|
|
|
@ -80,16 +80,22 @@
|
|||
<attribute name="label" translatable="yes">Switch session mode</attribute>
|
||||
|
||||
<item>
|
||||
<attribute name="icon">document-edit-symbolic</attribute>
|
||||
<attribute name="label" translatable="yes">_Edit</attribute>
|
||||
<attribute name="action">app.switch_to_edit</attribute>
|
||||
<attribute name="action">app.editmode</attribute>
|
||||
<attribute name="use-icon">True</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="icon">run-start-symbolic</attribute>
|
||||
<attribute name="label" translatable="yes">_Run</attribute>
|
||||
<attribute name="action">app.switch_to_run</attribute>
|
||||
<attribute name="action">app.runmode</attribute>
|
||||
<attribute name="use-icon">True</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="icon">run-start-symbolic</attribute>
|
||||
<attribute name="label" translatable="yes">_Presentation</attribute>
|
||||
<attribute name="action">app.switch_to_presentation</attribute>
|
||||
<attribute name="action">app.presentmode</attribute>
|
||||
<attribute name="use-icon">True</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
|
|
Loading…
Reference in New Issue