Skip to content

Commit 3d7cb30

Browse files
authored
Merge branch 'main' into ryonakano/granite-init-explicit-gtk-init
2 parents d5e49ca + 1a96920 commit 3d7cb30

File tree

11 files changed

+429
-121
lines changed

11 files changed

+429
-121
lines changed

demo/Views/MapsView.vala

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,34 @@
44
*/
55

66
public class MapsView : DemoPage {
7+
private string styles = "
8+
map-marker.self {
9+
background-color: @base_color;
10+
border-radius: 50%;
11+
box-shadow:
12+
0 0 0 1px @borders,
13+
0 3px 4px alpha(black, 0.15),
14+
0 3px 3px -3px alpha(black, 0.35);
15+
padding: 0.25rem;
16+
}
17+
18+
map-marker.self grid {
19+
background: @accent_color;
20+
color: white;
21+
border-radius: 50%;
22+
min-height: 1rem;
23+
min-width: 1rem;
24+
}
25+
";
26+
727
construct {
828
title = "Shumate.SimpleMap";
929

30+
var style_provider = new Gtk.CssProvider ();
31+
style_provider.load_from_string (styles);
32+
33+
Gtk.StyleContext.add_provider_for_display (Gdk.Display.get_default (), style_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
34+
1035
var registry = new Shumate.MapSourceRegistry.with_defaults ();
1136

1237
var simple_map = new Shumate.SimpleMap () {
@@ -21,20 +46,28 @@ public class MapsView : DemoPage {
2146
simple_map.add_css_class (Granite.CssClass.CARD);
2247

2348
var point = new Shumate.Marker () {
24-
child = new Gtk.Image.from_icon_name ("emblem-favorite-symbolic"),
49+
child = new Gtk.Image.from_icon_name ("map-marker") { pixel_size = 48 },
2550
latitude = 38.580753,
2651
longitude = -121.487300
2752
};
2853

54+
var self_point = new Shumate.Marker () {
55+
child = new Gtk.Grid (),
56+
latitude = 38.575764,
57+
longitude = -121.478851
58+
};
59+
self_point.add_css_class ("self");
60+
2961
var marker_layer = new Shumate.MarkerLayer.full (simple_map.viewport, SINGLE);
3062
marker_layer.add_marker (point);
63+
marker_layer.add_marker (self_point);
3164

3265
var map_view = simple_map.viewport;
3366
map_view.zoom_level = 15;
3467

3568
var map = simple_map.map;
3669
map.add_layer (marker_layer);
37-
map.center_on (38.575764, -121.478851);
70+
map.center_on (self_point.latitude, self_point.longitude);
3871

3972
child = simple_map;
4073
}

demo/data/demo.gresource.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33
<gresource prefix="/io/elementary/granite/demo/icons">
44
<file alias="32x32/actions/git.svg" compressed="true" preprocess="xml-stripblanks">git.svg</file>
55
<file alias="32x32/actions/valadoc.svg" compressed="true" preprocess="xml-stripblanks">valadoc.svg</file>
6+
7+
<file alias="48x48/places/map-marker.svg" compressed="true" preprocess="xml-stripblanks">map-marker.svg</file>
68
</gresource>
79
</gresources>

demo/data/map-marker.svg

Lines changed: 220 additions & 0 deletions
Loading

lib/Styles/Shumate/MapMarker.scss

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +0,0 @@
1-
map-marker {
2-
// This stacks with the other shadows,
3-
// so reduce it's alpha by the sum of other shadows
4-
$shadow-border-color: scale-color($border-color, $alpha: -50%);
5-
@if $color-scheme == "dark" {
6-
$shadow-border-color: transparent
7-
}
8-
9-
background-color: bg-color(0);
10-
border-radius: 50%;
11-
box-shadow:
12-
highlight(),
13-
// Intentionally not in ems since it's used as a stroke
14-
0 0 0 1px $shadow-border-color,
15-
shadow(2);
16-
padding: $button-spacing / 3;
17-
18-
image {
19-
background: $BLUEBERRY_500;
20-
color: white;
21-
border-radius: 50%;
22-
padding: $button-spacing / 2;
23-
-gtk-icon-size: 1rem;
24-
}
25-
}

po/be.po

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,23 @@ msgstr ""
88
"Project-Id-Version: granite\n"
99
"Report-Msgid-Bugs-To: \n"
1010
"POT-Creation-Date: 2025-07-09 01:07+0000\n"
11-
"PO-Revision-Date: 2015-12-04 01:36+0000\n"
12-
"Last-Translator: Launchpad Translations Administrators <Unknown>\n"
13-
"Language-Team: Belarusian <[email protected]>\n"
11+
"PO-Revision-Date: 2025-07-19 10:55+0000\n"
12+
"Last-Translator: lenify <[email protected]>\n"
13+
"Language-Team: Belarusian <https://l10n.elementaryos.org/projects/desktop/"
14+
"granite/be/>\n"
1415
"Language: be\n"
1516
"MIME-Version: 1.0\n"
1617
"Content-Type: text/plain; charset=UTF-8\n"
1718
"Content-Transfer-Encoding: 8bit\n"
19+
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
20+
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
21+
"X-Generator: Weblate 5.11.4\n"
1822
"X-Launchpad-Export-Date: 2017-03-07 05:44+0000\n"
19-
"X-Generator: Launchpad (build 18330)\n"
2023

2124
#. / TRANSLATORS: a GLib.DateTime format showing the hour (12h format) with seconds
2225
#: lib/DateTime.vala:28
23-
#, fuzzy
2426
msgid "%-l:%M:%S %p"
25-
msgstr "%l:%M:%S %p"
27+
msgstr "%-l:%M:%S %p"
2628

2729
#. / TRANSLATORS: a GLib.DateTime format showing the hour (12h format)
2830
#: lib/DateTime.vala:31

po/extra/be.po

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ msgstr ""
88
"Project-Id-Version: extra\n"
99
"Report-Msgid-Bugs-To: \n"
1010
"POT-Creation-Date: 2025-07-09 01:07+0000\n"
11-
"PO-Revision-Date: 2019-12-10 12:56-0800\n"
12-
"Last-Translator: Automatically generated\n"
13-
"Language-Team: none\n"
11+
"PO-Revision-Date: 2025-07-19 10:55+0000\n"
12+
"Last-Translator: lenify <[email protected]>\n"
13+
"Language-Team: Belarusian <https://l10n.elementaryos.org/projects/desktop/"
14+
"granite-extra/be/>\n"
1415
"Language: be\n"
1516
"MIME-Version: 1.0\n"
1617
"Content-Type: text/plain; charset=UTF-8\n"
1718
"Content-Transfer-Encoding: 8bit\n"
18-
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
19-
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
19+
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
20+
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
21+
"X-Generator: Weblate 5.11.4\n"
2022

2123
#: data/granite.metainfo.xml.in:11
2224
msgid "Granite 7"
@@ -34,7 +36,7 @@ msgstr ""
3436

3537
#: data/granite.metainfo.xml.in:24
3638
msgid "elementary, Inc."
37-
msgstr ""
39+
msgstr "elementary, Inc."
3840

3941
#: data/granite.metainfo.xml.in:32
4042
msgid "New Icons:"
@@ -120,7 +122,7 @@ msgstr ""
120122
#: data/granite.metainfo.xml.in:139 data/granite.metainfo.xml.in:149
121123
#: data/granite.metainfo.xml.in:168 data/granite.metainfo.xml.in:204
122124
msgid "Updated translations"
123-
msgstr ""
125+
msgstr "Абноўлены пераклады"
124126

125127
#: data/granite.metainfo.xml.in:55 data/granite.metainfo.xml.in:108
126128
msgid "Deprecations:"

0 commit comments

Comments
 (0)