diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -71,8 +71,6 @@ add_subdirectory( mac ) endif(APPLE) -# FIXME ktimezonewidget.h is gone -#add_subdirectory( plasmoid ) - +add_subdirectory( plasma ) add_subdirectory( plasmarunner ) add_subdirectory( thumbnailer ) diff --git a/src/lib/marble/declarative/MarbleDeclarativePlugin.h b/src/lib/marble/declarative/MarbleDeclarativePlugin.h --- a/src/lib/marble/declarative/MarbleDeclarativePlugin.h +++ b/src/lib/marble/declarative/MarbleDeclarativePlugin.h @@ -21,7 +21,8 @@ */ class MARBLE_DECLARATIVE_EXPORT MarbleDeclarativePlugin : public QQmlExtensionPlugin { - Q_PLUGIN_METADATA(IID "org.kde.marble.MarbleDeclarativePlugin") + // Disabled for now while libmarbledeclarative is used as shared library + // Q_PLUGIN_METADATA(IID "org.kde.marble.MarbleDeclarativePlugin") Q_OBJECT public: /** Overriding QQmlExtensionPlugin to register types */ diff --git a/src/lib/marble/declarative/MarbleQuickItem.h b/src/lib/marble/declarative/MarbleQuickItem.h --- a/src/lib/marble/declarative/MarbleQuickItem.h +++ b/src/lib/marble/declarative/MarbleQuickItem.h @@ -36,6 +36,7 @@ Q_PROPERTY(int mapWidth READ mapWidth WRITE setMapWidth NOTIFY mapWidthChanged) Q_PROPERTY(int mapHeight READ mapHeight WRITE setMapHeight NOTIFY mapHeightChanged) Q_PROPERTY(int zoom READ zoom WRITE setZoom NOTIFY zoomChanged) + Q_PROPERTY(int radius READ radius WRITE setRadius NOTIFY radiusChanged) Q_PROPERTY(bool showFrameRate READ showFrameRate WRITE setShowFrameRate NOTIFY showFrameRateChanged) Q_PROPERTY(Projection projection READ projection WRITE setProjection NOTIFY projectionChanged) Q_PROPERTY(QString mapThemeId READ mapThemeId WRITE setMapThemeId NOTIFY mapThemeIdChanged) @@ -76,11 +77,13 @@ MarbleInputHandler *inputHandler(); int zoom() const; + int radius() const; public Q_SLOTS: void goHome(); void setZoom(int zoom, FlyToMode mode = Instant); Q_INVOKABLE void setZoomToMaximumLevel(); + void setRadius(int radius); void centerOn(const GeoDataPlacemark& placemark, bool animated = false); void centerOn(const GeoDataLatLonBox& box, bool animated = false); void centerOn(const GeoDataCoordinates& coordinate); @@ -199,6 +202,7 @@ void angleChanged(); void speedChanged(); void zoomChanged(); + void radiusChanged(int radius); void inertialGlobeRotationChanged(bool inertialGlobeRotation); void placemarkDelegateChanged(QQmlComponent* placemarkDelegate); diff --git a/src/lib/marble/declarative/MarbleQuickItem.cpp b/src/lib/marble/declarative/MarbleQuickItem.cpp --- a/src/lib/marble/declarative/MarbleQuickItem.cpp +++ b/src/lib/marble/declarative/MarbleQuickItem.cpp @@ -203,6 +203,7 @@ connect(this, SIGNAL(heightChanged()), this, SLOT(resizeMap())); connect(&d->m_map, SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)), this, SLOT(updatePositionVisibility())); connect(&d->m_map, SIGNAL(visibleLatLonAltBoxChanged(GeoDataLatLonAltBox)), this, SIGNAL(visibleLatLonAltBoxChanged())); + connect(&d->m_map, SIGNAL(radiusChanged(int)), this, SIGNAL(radiusChanged(int))); connect(&d->m_map, SIGNAL(radiusChanged(int)), this, SIGNAL(zoomChanged())); connect(&d->m_reverseGeocoding, SIGNAL(reverseGeocodingFinished(GeoDataCoordinates,GeoDataPlacemark)), this, SLOT(handleReverseGeocoding(GeoDataCoordinates,GeoDataPlacemark))); @@ -518,6 +519,11 @@ return QPointF(x, y); } + void MarbleQuickItem::setRadius(int radius) + { + d->m_map.setRadius(radius); + } + void MarbleQuickItem::setZoom(int newZoom, FlyToMode mode) { d->m_presenter.setZoom(newZoom, mode); @@ -940,6 +946,11 @@ return &d->m_inputHandler; } + int MarbleQuickItem::radius() const + { + return d->m_map.radius(); + } + int MarbleQuickItem::zoom() const { return d->m_presenter.logzoom(); diff --git a/src/plasma/CMakeLists.txt b/src/plasma/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/src/plasma/CMakeLists.txt @@ -0,0 +1,17 @@ +set(KDE_SKIP_UNINSTALL_TARGET ON CACHE BOOL "KDE uninstall target must be disabled") +find_package(ECM QUIET) +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH}) +if(ECM_FOUND) + include(KDEInstallDirs) +endif() +macro_optional_find_package(KF5 QUIET COMPONENTS Config Plasma Service) + +if (NOT KF5_FOUND) + return() +endif() + + +add_subdirectory(qmlplugin) + +add_subdirectory(applets) +add_subdirectory(wallpapers) diff --git a/src/plasma/applets/CMakeLists.txt b/src/plasma/applets/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/src/plasma/applets/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(worldclock) diff --git a/src/plasma/applets/worldclock/CMakeLists.txt b/src/plasma/applets/worldclock/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/src/plasma/applets/worldclock/CMakeLists.txt @@ -0,0 +1 @@ +plasma_install_package(package org.kde.plasma.worldclock) diff --git a/src/plasma/applets/worldclock/Messages.sh b/src/plasma/applets/worldclock/Messages.sh new file mode 100644 --- /dev/null +++ b/src/plasma/applets/worldclock/Messages.sh @@ -0,0 +1,2 @@ +#! /usr/bin/env bash +$XGETTEXT `find . -name \*.qml -o -name \*.cpp` -o $podir/plasma_applet_org.kde.plasma.worldclock.pot diff --git a/src/plasma/applets/worldclock/package/contents/config/config.qml b/src/plasma/applets/worldclock/package/contents/config/config.qml new file mode 100644 --- /dev/null +++ b/src/plasma/applets/worldclock/package/contents/config/config.qml @@ -0,0 +1,36 @@ +/* + * Copyright 2016 Friedrich W. H. Kossebau + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program. If not, see . + */ + +import QtQuick 2.1 + +import org.kde.plasma.configuration 2.0 + +ConfigModel { + ConfigCategory { + name: i18n("Map Display") + icon: "preferences-desktop-display" + source: "configMapDisplay.qml" + } + +/* TODO: readd later + ConfigCategory { + name: i18n("Time Zones") + icon: "preferences-system-time" + source: "configTimeZones.qml" + } +*/ +} diff --git a/src/plasma/applets/worldclock/package/contents/config/main.xml b/src/plasma/applets/worldclock/package/contents/config/main.xml new file mode 100644 --- /dev/null +++ b/src/plasma/applets/worldclock/package/contents/config/main.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + Equirectangular + + + + false + + + + + + diff --git a/src/plasma/applets/worldclock/package/contents/ui/configMapDisplay.qml b/src/plasma/applets/worldclock/package/contents/ui/configMapDisplay.qml new file mode 100644 --- /dev/null +++ b/src/plasma/applets/worldclock/package/contents/ui/configMapDisplay.qml @@ -0,0 +1,72 @@ +/* + * Copyright 2016 Friedrich W. H. Kossebau + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program. If not, see . + */ + +import QtQuick 2.1 +import QtQuick.Controls 1.0 as QtControls +import QtQuick.Layouts 1.0 + +ColumnLayout { + id: mapDisplayPage + + property int cfg_projection: plasmoid.configuration.projection // Enum needs manual set/get for now + property alias cfg_showDate: showDateCheckBox.checked + + GridLayout { + columns: 2 + + QtControls.Label { + Layout.row: 0 + Layout.column: 0 + Layout.alignment: Qt.AlignRight + anchors { + verticalCenter: projectionComboBox.verticalCenter + } + text: i18n("Projection:") + } + + QtControls.ComboBox { + id: projectionComboBox + model: [ + i18n("Equirectangular"), + i18n("Mercator") + ] + onCurrentIndexChanged: { + cfg_projection = currentIndex; + } + Component.onCompleted: { + currentIndex = plasmoid.configuration.projection; + } + } + + QtControls.Label { + Layout.row: 4 + Layout.column: 0 + Layout.alignment: Qt.AlignRight + text: i18n("Show date:") + } + + QtControls.CheckBox { + Layout.row: 4 + Layout.column: 1 + id: showDateCheckBox + } + } + + Item { // tighten layout + Layout.fillHeight: true + } +} diff --git a/src/plasma/applets/worldclock/package/contents/ui/configTimeZones.qml b/src/plasma/applets/worldclock/package/contents/ui/configTimeZones.qml new file mode 100644 --- /dev/null +++ b/src/plasma/applets/worldclock/package/contents/ui/configTimeZones.qml @@ -0,0 +1,42 @@ +/* + * Copyright 2016 Friedrich W. H. Kossebau + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program. If not, see . + */ + +import QtQuick 2.1 +import QtQuick.Controls 1.0 as QtControls +import QtQuick.Layouts 1.0 + +ColumnLayout { + id: timeZonesPage + + property alias cfg_customTimeZone: customTimeZoneCheckBox.checked + + RowLayout { + QtControls.Label { + text: i18n("Use custom time zone selection:") + } + + QtControls.CheckBox { + id: customTimeZoneCheckBox + } + } + + QtControls.TableView { + id: timeZoneView + Layout.fillHeight: true + } +} + diff --git a/src/plasma/applets/worldclock/package/contents/ui/main.qml b/src/plasma/applets/worldclock/package/contents/ui/main.qml new file mode 100644 --- /dev/null +++ b/src/plasma/applets/worldclock/package/contents/ui/main.qml @@ -0,0 +1,127 @@ +/* + * Copyright 2016 Friedrich W. H. Kossebau + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program. If not, see . + */ + +import QtQuick 2.1 +import QtQuick.Layouts 1.1 + +import org.kde.plasma.plasmoid 2.0 +import org.kde.plasma.core 2.0 as PlasmaCore +import org.kde.plasma.components 2.0 as PlasmaComponents +import org.kde.plasma.extras 2.0 as PlasmaExtras + +import org.kde.marble.private.plasma 0.20 + +Item { + id: root + + readonly property date currentDateTime: dataSource.data.Local ? dataSource.data.Local.DateTime : new Date() + + Plasmoid.toolTipMainText: Qt.formatTime(currentDateTime) + Plasmoid.toolTipSubText: Qt.formatDate(currentDateTime, Qt.locale().dateFormat(Locale.LongFormat)) + + PlasmaCore.DataSource { + id: dataSource + engine: "time" + connectedSources: ["Local"] + interval: 60000 + intervalAlignment: PlasmaCore.Types.AlignToMinute + } + + Plasmoid.preferredRepresentation: Plasmoid.fullRepresentation + + Plasmoid.fullRepresentation: MarbleItem { + id: marbleItem + + enabled: false // do not handle input + Layout.minimumWidth: units.gridUnit * 20 + Layout.minimumHeight: units.gridUnit * 10 + + radius: { + var ratio = width/height; + if (projection === MarbleItem.Equirectangular) { + if (ratio > 2) { + return height / 2; + } + return width / 4; + } else { + if (ratio > 1) { + return height / 4; + } + return width / 4 + } + } + + // Theme settings. + projection: (plasmoid.configuration.projection === 0) ? MarbleItem.Equirectangular : MarbleItem.Mercator + mapThemeId: "earth/bluemarble/bluemarble.dgml" + + // Visibility of layers/plugins. + showAtmosphere: false + showClouds: false + showBackground: false + + showGrid: false + showCrosshairs: false + showCompass: false + showOverviewMap: false + showScaleBar: false + // TODO: showCredit: false + + Component.onCompleted: { + marbleMap.setShowSunShading(true); + marbleMap.setShowCityLights(true); + + marbleMap.setShowPlaces(false); + marbleMap.setShowOtherPlaces(false); + marbleMap.setShowCities(false); + marbleMap.setShowTerrain(false); + + // will depend on plasmoid.configuration.centerSun + marbleMap.setLockToSubSolarPoint(true); + marbleMap.setSubSolarPointIconVisible(true); + } + + ColumnLayout { + anchors.centerIn: parent + + PlasmaExtras.Heading { + id: timeLabel + + Layout.alignment: Qt.AlignHCenter + + level: 1 + text: plasmoid.configuration.showDate ? Qt.formatDateTime(currentDateTime) : Qt.formatTime(currentDateTime) + + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + } + /* + PlasmaExtras.Heading { + id: timezoneLabel + + Layout.alignment: Qt.AlignHCenter + + level: 3 + text: "Internet" + + visible: text.length > 0 + horizontalAlignment: Text.AlignHCenter + } + */ + } + } +} diff --git a/src/plasma/applets/worldclock/package/metadata.desktop b/src/plasma/applets/worldclock/package/metadata.desktop new file mode 100644 --- /dev/null +++ b/src/plasma/applets/worldclock/package/metadata.desktop @@ -0,0 +1,21 @@ +[Desktop Entry] +Name=World Clock +# not yet... Comment=Shows the time in different parts of the world + +Icon=marble +Type=Service + +X-KDE-ServiceTypes=Plasma/Applet + +X-KDE-PluginInfo-Author=Friedrich W. H. Kossebau +X-KDE-PluginInfo-Email=kossebau@kde.org +X-KDE-PluginInfo-Name=org.kde.plasma.worldclock +X-KDE-PluginInfo-Version=0.2 +X-KDE-PluginInfo-Website=https://marble.kde.org/ +X-KDE-PluginInfo-Category=Date and Time +X-KDE-PluginInfo-License=LGPL + +X-Plasma-API=declarativeappletscript +X-Plasma-StandAloneApp=true +X-Plasma-NotificationArea=false +X-Plasma-MainScript=ui/main.qml diff --git a/src/plasma/qmlplugin/CMakeLists.txt b/src/plasma/qmlplugin/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/src/plasma/qmlplugin/CMakeLists.txt @@ -0,0 +1,16 @@ +include_directories( + ${CMAKE_SOURCE_DIR}/src/lib/marble/declarative +) + +set(marblequick_SRCS + qmlplugin.cpp +) + +install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/marble/private/plasma) +add_library(marblequick SHARED ${marblequick_SRCS}) + +target_link_libraries(marblequick + marbledeclarative +) + +install(TARGETS marblequick DESTINATION ${QML_INSTALL_DIR}/org/kde/marble/private/plasma) diff --git a/src/plasma/qmlplugin/qmldir b/src/plasma/qmlplugin/qmldir new file mode 100644 --- /dev/null +++ b/src/plasma/qmlplugin/qmldir @@ -0,0 +1,2 @@ +module org.kde.marble.private.plasma +plugin marblequick diff --git a/src/plasma/qmlplugin/qmlplugin.h b/src/plasma/qmlplugin/qmlplugin.h new file mode 100644 --- /dev/null +++ b/src/plasma/qmlplugin/qmlplugin.h @@ -0,0 +1,35 @@ +/* + * Copyright 2016 Friedrich W. H. Kossebau + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program. If not, see . + */ + +#ifndef PLUGIN_H +#define PLUGIN_H + +#include + +/** + * For now installing this separate Marble QtQuick plugin under a private namespace, + * org.kde.marble.private.plasma (see qmldir) + * until we have sorted out a general public Marble QtQuick plugin API + * and libmarbledeclarative is turned back into a plugin instead of shared library + */ +class MarbleQuickPlugin : public MarbleDeclarativePlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") +}; + +#endif // PLUGIN_H diff --git a/src/plasma/qmlplugin/qmlplugin.cpp b/src/plasma/qmlplugin/qmlplugin.cpp new file mode 100644 --- /dev/null +++ b/src/plasma/qmlplugin/qmlplugin.cpp @@ -0,0 +1,18 @@ +/* + * Copyright 2016 Friedrich W. H. Kossebau + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program. If not, see . + */ + +#include "qmlplugin.h" diff --git a/src/plasma/wallpapers/CMakeLists.txt b/src/plasma/wallpapers/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/src/plasma/wallpapers/CMakeLists.txt @@ -0,0 +1 @@ +plasma_install_package(worldmap org.kde.plasma.wallpaper.worldmap wallpapers wallpaper) diff --git a/src/plasma/wallpapers/worldmap/Messages.sh b/src/plasma/wallpapers/worldmap/Messages.sh new file mode 100644 --- /dev/null +++ b/src/plasma/wallpapers/worldmap/Messages.sh @@ -0,0 +1,2 @@ +#! /usr/bin/env bash +$XGETTEXT `find . -name \*.qml` -o $podir/plasma_wallpaper_org.kde.plasma.worldmap.pot diff --git a/src/plasma/wallpapers/worldmap/contents/config/main.xml b/src/plasma/wallpapers/worldmap/contents/config/main.xml new file mode 100644 --- /dev/null +++ b/src/plasma/wallpapers/worldmap/contents/config/main.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + Equirectangular + + + + diff --git a/src/plasma/wallpapers/worldmap/contents/ui/config.qml b/src/plasma/wallpapers/worldmap/contents/ui/config.qml new file mode 100644 --- /dev/null +++ b/src/plasma/wallpapers/worldmap/contents/ui/config.qml @@ -0,0 +1,66 @@ +/* + * Copyright 2016 Friedrich W. H. Kossebau + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program. If not, see . + */ + +import QtQuick 2.1 +import QtQuick.Layouts 1.0 +import QtQuick.Controls 1.0 as QtControls + +// for "units" +import org.kde.plasma.core 2.0 as PlasmaCore + + +ColumnLayout { + id: root + property int cfg_projection: plasmoid.configuration.projection // Enum needs manual set/get for now + + RowLayout { + spacing: units.largeSpacing / 2 + + // To allow aligned integration in the settings form, + // "formAlignment" is a property injected by the config containment + // which defines the offset of the value fields + QtControls.Label { + Layout.minimumWidth: width + Layout.maximumWidth: width + width: formAlignment - units.largeSpacing + horizontalAlignment: Text.AlignRight + anchors { + verticalCenter: projectionComboBox.verticalCenter + } + + // use i18nd, as textdomain otherwise would be defined by config containment + text: i18nd("plasma_wallpaper_org.kde.plasma.worldmap", "Projection:") + } + QtControls.ComboBox { + id: projectionComboBox + model: [ + i18nd("plasma_wallpaper_org.kde.plasma.worldmap", "Equirectangular"), + i18nd("plasma_wallpaper_org.kde.plasma.worldmap", "Mercator") + ] + onCurrentIndexChanged: { + cfg_projection = currentIndex; + } + Component.onCompleted: { + currentIndex = plasmoid.configuration.projection; + } + } + } + + Item { // tighten layout + Layout.fillHeight: true + } +} diff --git a/src/plasma/wallpapers/worldmap/contents/ui/main.qml b/src/plasma/wallpapers/worldmap/contents/ui/main.qml new file mode 100644 --- /dev/null +++ b/src/plasma/wallpapers/worldmap/contents/ui/main.qml @@ -0,0 +1,72 @@ +/* + * Copyright 2016 Friedrich W. H. Kossebau + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program. If not, see . + */ + +import QtQuick 2.1 + +import org.kde.plasma.extras 2.0 as PlasmaExtras + +import org.kde.marble.private.plasma 0.20 + +MarbleItem { + id: marbleItem + + enabled: false // do not handle input + + radius: { + var ratio = width/height; + if (projection === MarbleItem.Equirectangular) { + if (ratio > 2) { + return height / 2; + } + return width / 4; + } else { + if (ratio > 1) { + return height / 4; + } + return width / 4 + } + } + + // Theme settings. + projection: (wallpaper.configuration.projection === 0) ? MarbleItem.Equirectangular : MarbleItem.Mercator + mapThemeId: "earth/bluemarble/bluemarble.dgml" + + // Visibility of layers/plugins. + showAtmosphere: false + showClouds: false + showBackground: false + + showGrid: false + showCrosshairs: false + showCompass: false + showOverviewMap: false + showScaleBar: false + + Component.onCompleted: { + marbleMap.setShowSunShading(true); + marbleMap.setShowCityLights(true); + + marbleMap.setShowPlaces(false); + marbleMap.setShowCities(false); + marbleMap.setShowTerrain(false); + marbleMap.setShowOtherPlaces(false); + + // will depend on wallpaper.configuration.centerSun + marbleMap.setLockToSubSolarPoint(true); + marbleMap.setSubSolarPointIconVisible(true); + } +} diff --git a/src/plasma/wallpapers/worldmap/metadata.desktop b/src/plasma/wallpapers/worldmap/metadata.desktop new file mode 100644 --- /dev/null +++ b/src/plasma/wallpapers/worldmap/metadata.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Name=World Map +Type=Service +Icon=marble + +X-KDE-ServiceTypes=Plasma/Wallpaper +X-KDE-PluginInfo-Author=Friedrich W. H. Kossebau +X-KDE-PluginInfo-Email=kossebau@kde.org +X-KDE-PluginInfo-License=LGPL +X-KDE-PluginInfo-Name=org.kde.plasma.worldmap +X-KDE-PluginInfo-Version=0.1 +X-KDE-PluginInfo-Website=https://marble.kde.org/ +X-Plasma-MainScript=ui/main.qml