summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Lundblad <ml@dfupdate.se>2022-05-01 21:43:14 +0200
committerMarcus Lundblad <ml@dfupdate.se>2022-05-01 21:43:14 +0200
commit99256e1a10da116275d22cf2541935f9570b88e3 (patch)
treeef5573f7d588c4382956982ceb6977d266050f3d
parentf2215b606f487e79fb3ccf975a85725b24111700 (diff)
downloadgnome-maps-wip/mlundblad/remove-dark-background.tar.gz
mapView: Don't set dark background patternwip/mlundblad/remove-dark-background
As we currently don't have dark tiles available, remove code setting a dark background, as it involves dealing with Clutter, and would anyway get removed when porting to GTK4 and libshumate.
-rw-r--r--src/mapView.js53
1 files changed, 0 insertions, 53 deletions
diff --git a/src/mapView.js b/src/mapView.js
index dd87c336..103a40d3 100644
--- a/src/mapView.js
+++ b/src/mapView.js
@@ -169,9 +169,6 @@ var MapView = GObject.registerClass({
Application.geoclue.connect('notify::state',
this._updateUserLocation.bind(this));
this._connectRouteSignals();
-
- // set dark background if we start up in dark theme
- this._setBackgroundPatternIfNeeded();
}
_initScale(view) {
@@ -202,8 +199,6 @@ var MapView = GObject.registerClass({
view.horizontal_wrap = true;
view.connect('notify::latitude', this._onViewMoved.bind(this));
- view.connect('notify::longitude',
- () => this._setBackgroundPatternIfNeeded());
// switching map type will set view min-zoom-level from map source
view.connect('notify::min-zoom-level', () => {
if (view.min_zoom_level < MapMinZoom) {
@@ -223,10 +218,6 @@ var MapView = GObject.registerClass({
this._onHybridAerialChanged.bind(this));
}
- this._gtkSettings = Gtk.Settings.get_default();
- this._gtkSettings.connect('notify::gtk-application-prefer-dark-theme',
- this._onPreferDarkThemeChanged.bind(this));
-
Application.settings.connect('changed::show-scale',
this._onShowScaleChanged.bind(this));
@@ -234,50 +225,6 @@ var MapView = GObject.registerClass({
return view;
}
- /* handler to draw background for dark theme,
- * these three functions should not be needed later with a native GTK
- * widget (Shumate)
- */
- _drawDarkBackground(canvas, cr, width, height) {
- // set this arbitrarily to try to match the typical dark tile set
- cr.setSourceRGB(0.2, 0.2, 0.2);
- cr.rectangle(0, 0, width, height);
- cr.fillPreserve();
-
- return true;
- }
-
- _createDarkBackground() {
- this._darkBackground = new Clutter.Canvas();
- this._darkBackground.set_size(512, 512);
- this._darkBackground.connect('draw',
- this._drawDarkBackground.bind(this));
- this._darkBackground.invalidate();
- }
-
- _isWrappingAround() {
- let bbox = this.view.get_bounding_box();
-
- return bbox.left > bbox.right;
- }
-
- _setBackgroundPatternIfNeeded() {
- if (this._gtkSettings.gtk_application_prefer_dark_theme &&
- !this._isWrappingAround()) {
- if (!this._darkBackgroud)
- this._createDarkBackground();
- this.view.set_background_pattern(this._darkBackground);
- this._customBackgroundSet = true;
- } else if (this._customBackgroundSet) {
- this.view.background_pattern = null;
- this._customBackgroundSet = false;
- }
- }
-
- _onPreferDarkThemeChanged() {
- this._setBackgroundPatternIfNeeded();
- }
-
_onDarkChanged() {
if (this._mapType === MapType.STREET) {
let overlay_sources = this.view.get_overlay_sources();