Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gnome-maps
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
134
Issues
134
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
gnome-maps
Commits
fe270c55
Commit
fe270c55
authored
Mar 12, 2015
by
Mattias Bengtsson
Committed by
Jonas Danielsson
Apr 13, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
InstructionRow: Use Templates
https://bugzilla.gnome.org/show_bug.cgi?id=740647
parent
74d3a12c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
79 additions
and
73 deletions
+79
-73
data/org.gnome.Maps.data.gresource.xml
data/org.gnome.Maps.data.gresource.xml
+1
-0
data/ui/instruction-row.ui
data/ui/instruction-row.ui
+71
-0
data/ui/sidebar.ui
data/ui/sidebar.ui
+0
-63
src/sidebar.js
src/sidebar.js
+7
-10
No files found.
data/org.gnome.Maps.data.gresource.xml
View file @
fe270c55
...
...
@@ -7,6 +7,7 @@
<file
preprocess=
"xml-stripblanks"
>
ui/check-in-dialog.ui
</file>
<file
preprocess=
"xml-stripblanks"
>
ui/context-menu.ui
</file>
<file
preprocess=
"xml-stripblanks"
>
ui/favorites-popover.ui
</file>
<file
preprocess=
"xml-stripblanks"
>
ui/instruction-row.ui
</file>
<file
preprocess=
"xml-stripblanks"
>
ui/layers-popover.ui
</file>
<file
preprocess=
"xml-stripblanks"
>
ui/location-service-notification.ui
</file>
<file
preprocess=
"xml-stripblanks"
>
ui/main-window.ui
</file>
...
...
data/ui/instruction-row.ui
0 → 100644
View file @
fe270c55
<?xml version="1.0" encoding="utf-8"?>
<interface>
<requires
lib=
"gtk+"
version=
"3.14"
/>
<template
class=
"Gjs_InstructionRow"
parent=
"GtkListBoxRow"
>
<property
name=
"visible"
>
True
</property>
<child>
<object
class=
"GtkBox"
id=
"instructionBox"
>
<property
name=
"name"
>
instruction-box
</property>
<property
name=
"height_request"
>
48
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"spacing"
>
6
</property>
<property
name=
"baseline_position"
>
top
</property>
<child>
<object
class=
"GtkImage"
id=
"directionImage"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"margin-start"
>
2
</property>
<property
name=
"margin-end"
>
2
</property>
<!-- width: 32 + spacing * 2 -->
<property
name=
"width-request"
>
44
</property>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
0
</property>
</packing>
</child>
<child>
<object
class=
"GtkLabel"
id=
"instructionLabel"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"halign"
>
start
</property>
<!-- Somehow we need this xalign, otherwise multi-line -->
<!-- labels does not get left-aligned. -->
<property
name=
"xalign"
>
0
</property>
<property
name=
"margin-top"
>
3
</property>
<property
name=
"margin-bottom"
>
3
</property>
<property
name=
"use_underline"
>
True
</property>
<property
name=
"wrap"
>
True
</property>
<property
name=
"ellipsize"
>
end
</property>
<property
name=
"width_chars"
>
20
</property>
<property
name=
"max_width_chars"
>
20
</property>
<property
name=
"lines"
>
3
</property>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
1
</property>
</packing>
</child>
<child>
<object
class=
"GtkLabel"
id=
"distanceLabel"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"halign"
>
end
</property>
<property
name=
"use_underline"
>
True
</property>
<property
name=
"wrap"
>
True
</property>
<property
name=
"lines"
>
3
</property>
<property
name=
"margin_end"
>
5
</property>
</object>
<packing>
<property
name=
"expand"
>
True
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
3
</property>
</packing>
</child>
</object>
</child>
</template>
</interface>
data/ui/sidebar.ui
View file @
fe270c55
...
...
@@ -183,67 +183,4 @@
</object>
</child>
</object>
<object
class=
"GtkBox"
id=
"instruction-box"
>
<property
name=
"name"
>
instruction-box
</property>
<property
name=
"height_request"
>
48
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"spacing"
>
6
</property>
<property
name=
"baseline_position"
>
top
</property>
<child>
<object
class=
"GtkImage"
id=
"direction-image"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"margin-start"
>
2
</property>
<property
name=
"margin-end"
>
2
</property>
<!-- width: 32 + spacing * 2 -->
<property
name=
"width-request"
>
44
</property>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
0
</property>
</packing>
</child>
<child>
<object
class=
"GtkLabel"
id=
"instruction-label"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"halign"
>
start
</property>
<!-- Somehow we need this xalign, otherwise multi-line -->
<!-- labels does not get left-aligned. -->
<property
name=
"xalign"
>
0
</property>
<property
name=
"margin-top"
>
3
</property>
<property
name=
"margin-bottom"
>
3
</property>
<property
name=
"use_underline"
>
True
</property>
<property
name=
"wrap"
>
True
</property>
<property
name=
"ellipsize"
>
end
</property>
<property
name=
"width_chars"
>
20
</property>
<property
name=
"max_width_chars"
>
20
</property>
<property
name=
"lines"
>
3
</property>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
1
</property>
</packing>
</child>
<child>
<object
class=
"GtkLabel"
id=
"distance-label"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can_focus"
>
False
</property>
<property
name=
"halign"
>
end
</property>
<property
name=
"use_underline"
>
True
</property>
<property
name=
"wrap"
>
True
</property>
<property
name=
"lines"
>
3
</property>
<property
name=
"margin_end"
>
5
</property>
</object>
<packing>
<property
name=
"expand"
>
True
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
3
</property>
</packing>
</child>
</object>
</interface>
src/sidebar.js
View file @
fe270c55
...
...
@@ -34,6 +34,10 @@ const Utils = imports.utils;
const
InstructionRow
=
new
Lang
.
Class
({
Name
:
"
InstructionRow
"
,
Extends
:
Gtk
.
ListBoxRow
,
Template
:
'
resource:///org/gnome/Maps/ui/instruction-row.ui
'
,
InternalChildren
:
[
'
directionImage
'
,
'
instructionLabel
'
,
'
distanceLabel
'
],
_init
:
function
(
params
)
{
this
.
turnPoint
=
params
.
turnPoint
;
...
...
@@ -41,18 +45,11 @@ const InstructionRow = new Lang.Class({
this
.
parent
(
params
);
this
.
visible
=
true
;
let
ui
=
Utils
.
getUIObject
(
'
sidebar
'
,
[
'
instruction-box
'
,
'
direction-image
'
,
'
instruction-label
'
,
'
distance-label
'
]);
ui
.
instructionLabel
.
label
=
this
.
turnPoint
.
instruction
;
ui
.
directionImage
.
icon_name
=
this
.
turnPoint
.
iconName
;
this
.
_instructionLabel
.
label
=
this
.
turnPoint
.
instruction
;
this
.
_directionImage
.
icon_name
=
this
.
turnPoint
.
iconName
;
if
(
this
.
turnPoint
.
distance
>
0
)
ui
.
distanceLabel
.
label
=
Utils
.
prettyDistance
(
this
.
turnPoint
.
distance
);
this
.
add
(
ui
.
instructionBox
);
this
.
_distanceLabel
.
label
=
Utils
.
prettyDistance
(
this
.
turnPoint
.
distance
);
}
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment