Skip to content

Commit

Permalink
[styles] Rename styles to default/vehicle/outdoors + light/dark
Browse files Browse the repository at this point in the history
clear/style-clear    -> default/style-light
clear/style-night    -> default/style-dark
vehicle/style-clear  -> vehicle/style-light
vehicle/style-night  -> vehicle/style-dark
outdoors/style-clear -> outdoors/style-light
outdoors/style-night -> outdoors/style-dark

Signed-off-by: David Martinez <[email protected]>
  • Loading branch information
dvdmrtnz authored and vng committed May 23, 2024
1 parent 64c8703 commit 1276dc7
Show file tree
Hide file tree
Showing 91 changed files with 278 additions and 275 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ screenlog.0

data/styles/*/*/out/*
data/resources-*_design/*
data/drules_proto_design.bin
data/drules_proto_default_design.bin
data/colors_design.txt
data/patterns_design.txt
data/bookmarks
Expand Down
1 change: 0 additions & 1 deletion android/app/src/main/assets/drules_proto_clear.bin

This file was deleted.

1 change: 0 additions & 1 deletion android/app/src/main/assets/drules_proto_dark.bin

This file was deleted.

1 change: 1 addition & 0 deletions android/app/src/main/assets/drules_proto_default_dark.bin
1 change: 1 addition & 0 deletions android/app/src/main/assets/drules_proto_default_light.bin

This file was deleted.

1 change: 0 additions & 1 deletion android/app/src/main/assets/drules_proto_vehicle_clear.bin

This file was deleted.

1 change: 1 addition & 0 deletions android/app/src/main/assets/drules_proto_vehicle_light.bin
1 change: 0 additions & 1 deletion android/app/src/main/assets/resources-6plus_clear

This file was deleted.

1 change: 1 addition & 0 deletions android/app/src/main/assets/resources-6plus_light
1 change: 0 additions & 1 deletion android/app/src/main/assets/resources-hdpi_clear

This file was deleted.

1 change: 1 addition & 0 deletions android/app/src/main/assets/resources-hdpi_light
1 change: 0 additions & 1 deletion android/app/src/main/assets/resources-mdpi_clear

This file was deleted.

1 change: 1 addition & 0 deletions android/app/src/main/assets/resources-mdpi_light
1 change: 0 additions & 1 deletion android/app/src/main/assets/resources-xhdpi_clear

This file was deleted.

1 change: 1 addition & 0 deletions android/app/src/main/assets/resources-xhdpi_light
1 change: 0 additions & 1 deletion android/app/src/main/assets/resources-xxhdpi_clear

This file was deleted.

1 change: 1 addition & 0 deletions android/app/src/main/assets/resources-xxhdpi_light
1 change: 0 additions & 1 deletion android/app/src/main/assets/resources-xxxhdpi_clear

This file was deleted.

1 change: 1 addition & 0 deletions android/app/src/main/assets/resources-xxxhdpi_light
18 changes: 9 additions & 9 deletions android/script/replace_links.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ cp ../data/classificator.txt assets/
cp ../data/colors.txt assets/
cp ../data/copyright.html assets/
cp ../data/countries.txt assets/
cp ../data/drules_proto_dark.bin assets/
cp ../data/drules_proto_clear.bin assets/
cp ../data/drules_proto_default_dark.bin assets/
cp ../data/drules_proto_default_light.bin assets/
cp ../data/drules_proto_vehicle_dark.bin assets/
cp ../data/drules_proto_vehicle_clear.bin assets/
cp ../data/drules_proto_vehicle_light.bin assets/
cp ../data/drules_proto_outdoors_dark.bin assets/
cp ../data/drules_proto_outdoors_clear.bin assets/
cp ../data/drules_proto_outdoors_light.bin assets/
cp ../data/editor.config assets/
cp ../data/faq.html assets/
cp ../data/fonts_blacklist.txt assets/
Expand All @@ -27,15 +27,15 @@ cp ../data/opening_hours_how_to_edit.html assets/
cp ../data/ugc_types.csv assets/

cp -r ../data/resources-hdpi_dark/ assets/
cp -r ../data/resources-hdpi_clear/ assets/
cp -r ../data/resources-hdpi_light/ assets/
cp -r ../data/resources-mdpi_dark/ assets/
cp -r ../data/resources-mdpi_clear/ assets/
cp -r ../data/resources-mdpi_light/ assets/
cp -r ../data/resources-xhdpi_dark/ assets/
cp -r ../data/resources-xhdpi_clear/ assets/
cp -r ../data/resources-xhdpi_light/ assets/
cp -r ../data/resources-xxhdpi_dark/ assets/
cp -r ../data/resources-xxhdpi_clear/ assets/
cp -r ../data/resources-xxhdpi_light/ assets/
cp -r ../data/resources-6plus_dark/ assets/
cp -r ../data/resources-6plus_clear/ assets/
cp -r ../data/resources-6plus_light/ assets/

cp -r ../data/sound-strings/ assets/
cp -r ../data/countries-strings/ assets/
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
2 changes: 1 addition & 1 deletion data/styles/clear/style-clear/colors.mapcss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* ~~~~ CONTENT OF COLORS-DAY ~~~~~
/* ~~~~ CONTENT OF COLORS-LIGHT ~~~~~

1.BASEMAP
2.BOUNDARY
Expand Down
2 changes: 1 addition & 1 deletion data/styles/clear/style-night/colors.mapcss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* ~~~~ CONTENT OF COLORS-NIGHT ~~~~~
/* ~~~~ CONTENT OF COLORS-DARK ~~~~~

1.BASEMAP
2.BOUNDARY
Expand Down
2 changes: 1 addition & 1 deletion data/styles/outdoors/include/Basemap.mapcss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Keep here changes of the base map style file only. */
@import("../../clear/include/Basemap.mapcss");
@import("../../default/include/Basemap.mapcss");


/* 6.WATER */
Expand Down
2 changes: 1 addition & 1 deletion data/styles/outdoors/include/Basemap_label.mapcss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Keep here changes of the base map style file only. */
@import("../../clear/include/Basemap_label.mapcss");
@import("../../default/include/Basemap_label.mapcss");


/* 9. ISOLINES */
Expand Down
2 changes: 1 addition & 1 deletion data/styles/outdoors/include/Icons.mapcss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Keep here changes of the base map style file only. */
@import("../../clear/include/Icons.mapcss");
@import("../../default/include/Icons.mapcss");


/* 2. NATURAL */
Expand Down
2 changes: 1 addition & 1 deletion data/styles/outdoors/include/Roads.mapcss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Keep here changes of the base map style file only. */
@import("../../clear/include/Roads.mapcss");
@import("../../default/include/Roads.mapcss");


/* Make all roads more contrast */
Expand Down
2 changes: 1 addition & 1 deletion data/styles/outdoors/include/Roads_label.mapcss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Keep here changes of the base map style file only. */
@import("../../clear/include/Roads_label.mapcss");
@import("../../default/include/Roads_label.mapcss");


line|z13-[highway=track],
Expand Down
2 changes: 1 addition & 1 deletion data/styles/outdoors/include/Subways.mapcss
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/* Keep here changes of the base map style file only. */
@import("../../clear/include/Subways.mapcss");
@import("../../default/include/Subways.mapcss");
4 changes: 2 additions & 2 deletions data/styles/outdoors/style-clear/colors.mapcss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* Keep here changes of the base map style file only. */
@import("../../clear/style-clear/colors.mapcss");
@import("../../default/light/colors.mapcss");

/* ~~~~ CONTENT OF COLORS-DAY ~~~~~
/* ~~~~ CONTENT OF COLORS-LIGHT ~~~~~

1.BASEMAP
2.BOUNDARY
Expand Down
4 changes: 2 additions & 2 deletions data/styles/outdoors/style-night/colors.mapcss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* Keep here changes of the base map style file only. */
@import("../../clear/style-night/colors.mapcss");
@import("../../default/dark/colors.mapcss");

/* ~~~~ CONTENT OF COLORS-NIGHT ~~~~~
/* ~~~~ CONTENT OF COLORS-DARK ~~~~~

1.BASEMAP
2.BOUNDARY
Expand Down
2 changes: 1 addition & 1 deletion data/styles/vehicle/include/Icons.mapcss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
2.NATURAL
3.TRANSPORT
3.1 Train Station
3.2 Subway Station (Moved to /clear/Subways.mapcss)
3.2 Subway Station (Moved to /default/include/Subways.mapcss)
3.3 Tram Station
3.4 Bus Station
3.5 Ferry terminal
Expand Down
2 changes: 1 addition & 1 deletion data/styles/vehicle/include/Subways.mapcss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Keep here changes of the base map style file only. */
@import("../../clear/include/Subways.mapcss");
@import("../../default/include/Subways.mapcss");


/*only render captions from z16*/
Expand Down
2 changes: 1 addition & 1 deletion data/styles/vehicle/style-night/colors.mapcss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* ~~~~ CONTENT OF COLORS-NIGHT ~~~~~
/* ~~~~ CONTENT OF COLORS-DARK ~~~~~

1.BASEMAP
2.BOUNDARY
Expand Down
34 changes: 17 additions & 17 deletions docs/STYLES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Map styling and icons

Here is the basic workflow to update styles:
1. Edit the styles file you want, e.g. [`Roads.mapcss`](../data/styles/clear/include/Roads.mapcss)
1. Edit the styles file you want, e.g. [`Roads.mapcss`](../data/styles/default/include/Roads.mapcss)
2. Run the `tools/unix/generate_drules.sh` script
3. Test how your changes look in the app
4. Commit your edits and files changed by the script
Expand Down Expand Up @@ -37,27 +37,27 @@ If you use WSL on Windows 10 you might need to run [X Server](INSTALL.md#windows

## Files

Map styles are defined in text files located in `data/styles/clear/include/`:
* Forests, rivers, buildings, etc. [`Basemap.mapcss`](../data/styles/clear/include/Basemap.mapcss)
* Their text labels [`Basemap_label.mapcss`](../data/styles/clear/include/Basemap_label.mapcss)
* Roads, bridges, foot and bicycle paths, etc. [`Roads.mapcss`](../data/styles/clear/include/Roads.mapcss)
* Their text labels [`Roads_label.mapcss`](../data/styles/clear/include/Roads_label.mapcss)
* Icons for POIs and other features [`Icons.mapcss`](../data/styles/clear/include/Icons.mapcss)
* City-specific subway networks [`Subways.mapcss`](../data/styles/clear/include/Subways.mapcss)
* Light (default) theme colors: [`style-clear/colors.mapcss`](../data/styles/clear/style-clear/colors.mapcss)
* Dark/night theme colors: [`style-night/colors.mapcss`](../data/styles/clear/style-night/colors.mapcss)
* Priorities of overlays (icons, captions..) [`priorities_4_overlays.prio.txt`](../data/styles/clear/include/priorities_4_overlays.prio.txt)
* Priorities of lines and areas [`priorities_3_FG.prio.txt`](../data/styles/clear/include/priorities_3_FG.prio.txt), [`priorities_2_BG-top.prio.txt`](../data/styles/clear/include/priorities_2_BG-top.prio.txt), [`priorities_1_BG-by-size.prio.txt`](../data/styles/clear/include/priorities_1_BG-by-size.prio.txt)
Map styles are defined in text files located in `data/styles/default/include/`:
* Forests, rivers, buildings, etc. [`Basemap.mapcss`](../data/styles/default/include/Basemap.mapcss)
* Their text labels [`Basemap_label.mapcss`](../data/styles/default/include/Basemap_label.mapcss)
* Roads, bridges, foot and bicycle paths, etc. [`Roads.mapcss`](../data/styles/default/include/Roads.mapcss)
* Their text labels [`Roads_label.mapcss`](../data/styles/default/include/Roads_label.mapcss)
* Icons for POIs and other features [`Icons.mapcss`](../data/styles/default/include/Icons.mapcss)
* City-specific subway networks [`Subways.mapcss`](../data/styles/default/include/Subways.mapcss)
* Light (default) theme colors: [`light/colors.mapcss`](../data/styles/default/light/colors.mapcss)
* Dark/night theme colors: [`dark/colors.mapcss`](../data/styles/default/dark/colors.mapcss)
* Priorities of overlays (icons, captions..) [`priorities_4_overlays.prio.txt`](../data/styles/default/include/priorities_4_overlays.prio.txt)
* Priorities of lines and areas [`priorities_3_FG.prio.txt`](../data/styles/default/include/priorities_3_FG.prio.txt), [`priorities_2_BG-top.prio.txt`](../data/styles/default/include/priorities_2_BG-top.prio.txt), [`priorities_1_BG-by-size.prio.txt`](../data/styles/default/include/priorities_1_BG-by-size.prio.txt)

There is a separate set of these style files for the navigation mode in `data/styles/vehicle/`.

Icons are stored in [`data/styles/clear/style-clear/symbols/`](../data/styles/clear/style-clear/symbols/) and their dark/night counterparts are in [`data/styles/clear/style-night/symbols/`](../data/styles/clear/style-night/symbols/).
Icons are stored in [`data/styles/default/light/symbols/`](../data/styles/default/light/symbols/) and their dark/night counterparts are in [`data/styles/default/dark/symbols/`](../data/styles/default/dark/symbols/).

## How to add a new icon

1. Add an svg icon to `data/styles/clear/style-clear/symbols/` (and to `style-night` too)
1. Add an svg icon to `data/styles/default/light/symbols/` (and to `dark` too)
preferably look for icons in [collections OM uses already](../data/copyright.html#icons)
2. Add icon rendering/visibility rules into `data/styles/clear/include/Icons.mapcss` and to "navigation style" `data/styles/vehicle/include/Icons.mapcss`
2. Add icon rendering/visibility rules into `data/styles/default/include/Icons.mapcss` and to "navigation style" `data/styles/vehicle/include/Icons.mapcss`
3. Run `tools/unix/generate_symbols.sh` to add new icons into skin files
4. Run `tools/unix/generate_drules.sh` to generate drawing rules for the new icons
5. [Test](#testing-your-changes) your changes
Expand All @@ -66,7 +66,7 @@ preferably look for icons in [collections OM uses already](../data/copyright.htm

1. Add it into `data/mapcss-mapping.csv` (or better replace existing `deprecated` line) to make OM import it from OSM
2. If necessary merge similar tags in via `data/replaced_tags.txt`
3. Define a priority for the new feature type in e.g. [`priorities_4_overlays.prio.txt`](../data/styles/clear/include/priorities_4_overlays.prio.txt) and/or other priorities files
3. Define a priority for the new feature type in e.g. [`priorities_4_overlays.prio.txt`](../data/styles/default/include/priorities_4_overlays.prio.txt) and/or other priorities files
4. Add a new icon (see [above](#how-to-add-a-new-icon)) and/or other styling (area, line..)
5. If a new POI should be OSM-addable/editable then add it to `data/editor.config`
6. Add new type translation into `data/strings/types_strings.txt`
Expand All @@ -83,7 +83,7 @@ The most convenient way is using [the desktop app](INSTALL.md#desktop-app).
by rebuilding styles and symbols quickly, but it's broken as of now, please help fix it!)

To test on Android or iOS device either re-build the app or put
the compiled style files (e.g. `drules_proto_clear.bin`) into
the compiled style files (e.g. `drules_proto_default_light.bin`) into
a `styles/` subfolder of maps directory on the device
(e.g. `Android/data/app.organicmaps/files/styles/`).

Expand Down
5 changes: 3 additions & 2 deletions drape/drape_tests/static_texture_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
UNIT_TEST(CheckTrafficArrowTextures)
{
static std::vector<std::string> skinPaths = {"6plus", "mdpi", "hdpi", "xhdpi", "xxhdpi", "xxxhdpi"};
static std::vector<MapStyle> styles = {MapStyle::MapStyleClear, MapStyle::MapStyleDark,
MapStyle::MapStyleVehicleClear,
static std::vector<MapStyle> styles = {MapStyle::MapStyleDefaultLight,
MapStyle::MapStyleDefaultDark,
MapStyle::MapStyleVehicleLight,
MapStyle::MapStyleVehicleDark};

TestingGraphicsContext context;
Expand Down
2 changes: 1 addition & 1 deletion drape_frontend/color_constants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class TransitColorsHolder
dp::Color GetColor(std::string const & name) const
{
auto const style = GetStyleReader().GetCurrentStyle();
auto const isDarkStyle = style == MapStyle::MapStyleDark || style == MapStyle::MapStyleVehicleDark;
auto const isDarkStyle = style == MapStyle::MapStyleDefaultDark || style == MapStyle::MapStyleVehicleDark;
auto const & colors = isDarkStyle ? m_nightColors : m_clearColors;
auto const it = colors.find(name);
if (it == colors.cend())
Expand Down
2 changes: 1 addition & 1 deletion drape_frontend/gps_track_renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ dp::Color GpsTrackRenderer::CalculatePointColor(size_t pointIndex, m2::PointD co
double startAlpha = kMinDayAlpha;
double endAlpha = kMaxDayAlpha;
auto const style = GetStyleReader().GetCurrentStyle();
if (style == MapStyle::MapStyleDark)
if (style == MapStyle::MapStyleDefaultDark)
{
startAlpha = kMinNightAlpha;
endAlpha = kMaxNightAlpha;
Expand Down
34 changes: 17 additions & 17 deletions indexer/map_style.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

#include "base/assert.hpp"

MapStyle const kDefaultMapStyle = MapStyleClear;
MapStyle const kDefaultMapStyle = MapStyleDefaultLight;

MapStyle MapStyleFromSettings(std::string const & str)
{
// MapStyleMerged is service style. It's unavailable for users.
if (str == "MapStyleClear")
return MapStyleClear;
else if (str == "MapStyleDark")
return MapStyleDark;
else if (str == "MapStyleVehicleClear")
return MapStyleVehicleClear;
if (str == "MapStyleDefaultLight")
return MapStyleDefaultLight;
else if (str == "MapStyleDefaultDark")
return MapStyleDefaultDark;
else if (str == "MapStyleVehicleLight")
return MapStyleVehicleLight;
else if (str == "MapStyleVehicleDark")
return MapStyleVehicleDark;
else if (str == "MapStyleOutdoorsClear")
return MapStyleOutdoorsClear;
else if (str == "MapStyleOutdoorsLight")
return MapStyleOutdoorsLight;
else if (str == "MapStyleOutdoorsDark")
return MapStyleOutdoorsDark;

Expand All @@ -27,20 +27,20 @@ std::string MapStyleToString(MapStyle mapStyle)
{
switch (mapStyle)
{
case MapStyleDark:
return "MapStyleDark";
case MapStyleClear:
return "MapStyleClear";
case MapStyleDefaultDark:
return "MapStyleDefaultDark";
case MapStyleDefaultLight:
return "MapStyleDefaultLight";
case MapStyleMerged:
return "MapStyleMerged";
case MapStyleVehicleDark:
return "MapStyleVehicleDark";
case MapStyleVehicleClear:
return "MapStyleVehicleClear";
case MapStyleVehicleLight:
return "MapStyleVehicleLight";
case MapStyleOutdoorsDark:
return "MapStyleOutdoorsDark";
case MapStyleOutdoorsClear:
return "MapStyleOutdoorsClear";
case MapStyleOutdoorsLight:
return "MapStyleOutdoorsLight";

case MapStyleCount:
break;
Expand Down
8 changes: 4 additions & 4 deletions indexer/map_style.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

enum MapStyle
{
MapStyleClear = 0,
MapStyleDark = 1,
MapStyleDefaultLight = 0,
MapStyleDefaultDark = 1,
MapStyleMerged = 2,
MapStyleVehicleClear = 3,
MapStyleVehicleLight = 3,
MapStyleVehicleDark = 4,
MapStyleOutdoorsClear = 5,
MapStyleOutdoorsLight = 5,
MapStyleOutdoorsDark = 6,
// Add new map style here

Expand Down
Loading

0 comments on commit 1276dc7

Please sign in to comment.