[gnome-maps] mainWindow: Print button in routing headerbar
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps] mainWindow: Print button in routing headerbar
- Date: Wed, 5 Aug 2020 21:03:33 +0000 (UTC)
commit 2ce25d60eebc60ada069bfb213e2c2fac6231ecd
Author: James Westman <james flyingpimonster net>
Date: Wed Jul 29 17:07:38 2020 -0500
mainWindow: Print button in routing headerbar
When the routing sidebar is covering the whole window, show a print button in
the headerbar.
data/ui/main-window.ui | 21 +++++++++++++++++++++
src/mainWindow.js | 5 +++++
2 files changed, 26 insertions(+)
---
diff --git a/data/ui/main-window.ui b/data/ui/main-window.ui
index 070b0399..b4b27981 100644
--- a/data/ui/main-window.ui
+++ b/data/ui/main-window.ui
@@ -91,6 +91,27 @@
</child>
</object>
</child>
+ <child>
+ <object class="GtkButton" id="routingHeaderBarPrintButton">
+ <property name="name">print-route</property>
+ <property name="can-focus">True</property>
+ <property name="tooltip-text" translatable="yes" comments="Translators: This is a
tooltip">Print Route</property>
+ <property name="action-name">win.print-route</property>
+ <property name="valign">center</property>
+ <style>
+ <class name="image-button"/>
+ </style>
+ <child>
+ <object class="GtkImage">
+ <property name="visible">True</property>
+ <property name="icon-name">document-print-symbolic</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="pack-type">end</property>
+ </packing>
+ </child>
</object>
</child>
</object>
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 02d811ee..c131ecb4 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -87,6 +87,7 @@ var MainWindow = GObject.registerClass({
'mapViewWrapper',
'noNetworkView',
'routingHeaderBar',
+ 'routingHeaderBarPrintButton',
'actionBar',
'actionBarRevealer' ]
}, class MainWindow extends Gtk.ApplicationWindow {
@@ -417,6 +418,10 @@ var MainWindow = GObject.registerClass({
// Show routing headerbar when the leaflet is folded, showing only the
// routing sidebar
this._leaflet.connect('notify::folded', this._updateRoutingHeaderBar.bind(this));
+
+ /* Show/hide the print button in the routing headerbar */
+ this._mapView.bind_property('routeShowing', this._routingHeaderBarPrintButton,
+ 'visible', GObject.BindingFlags.DEFAULT);
}
_saveWindowGeometry() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]