Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[styles] Rename styles to default/vehicle/outdoors + light/dark #7264

Merged
merged 2 commits into from
May 23, 2024

Conversation

dvdmrtnz
Copy link
Contributor

@dvdmrtnz dvdmrtnz commented Jan 28, 2024

The current styles naming scheme is inconsistent:

  • In the data/styles folder there is a clear style at the same level of the vehicle and outdoors styles, but then each of these styles is divided into clear/night, which is confusing as the same word clear is used on two different levels.
clear
├─ clear
├─ night
vehicle
├─ clear
├─ night
outdoors
├─ clear
├─ night
  • In the code the higher level clear style gets no name and the lower levels use clear/dark.
-
├─ clear
├─ dark
vehicle
├─ clear
├─ dark
outdoors
├─ clear
├─ dark
  • And then the debug commands use ?light/?dark.

--

I propose changing the naming scheme to this:

default
├─ light
├─ dark
vehicle
├─ light
├─ dark
outdoors
├─ light
├─ dark

Light/Dark is the naming convention used by both iOS (https://developer.apple.com/design/human-interface-guidelines/dark-mode) and Android (https://developer.android.com/develop/ui/views/theming/darktheme?hl=en#change-themes) in their guidelines.

@dvdmrtnz dvdmrtnz requested a review from a team as a code owner January 28, 2024 19:49
@dvdmrtnz
Copy link
Contributor Author

@euf PTAL

@euf
Copy link
Contributor

euf commented Jan 28, 2024

This is great! New naming makes a lot more sense. Thank you so much for this job, I believe it would reduce confusion for future designers a lot.

Could you please also tag me once again after this PR is merged? I would have to update a couple of issues and wiki pages which have direct links to master branch icons.

@Jean-BaptisteC
Copy link
Member

Can you add git blame?

@biodranik
Copy link
Member

Thanks!

  1. How does this scheme fit adding the planned variation of the more contrast dark style that is suitable for daylight use (not only for the use at night/dark environment, as the current low-contrast style)?
  2. Would it be possible to make a setting "use a more contrast style" to switch it (maybe also for a light theme)?
  3. Are there any benefits of using a different structure, e.g.
light
light/default
light/outdoor
light/vehicle
dark
dark/default
dark/outdoor
dark/vehicle

?
4. Would it be possible to add a new style that is light-only or dark-only?

@dvdmrtnz dvdmrtnz force-pushed the styles branch 2 times, most recently from 41adfa7 to 5ed8714 Compare January 28, 2024 20:52
@dvdmrtnz
Copy link
Contributor Author

dvdmrtnz commented Jan 28, 2024

Can you add git blame?

What do you want exactly? I don't understand

@Jean-BaptisteC
Copy link
Member

Add your commit in .git blame ignore revs like explained here https://github.blog/changelog/2022-03-24-ignore-commits-in-the-blame-view-beta/

@dvdmrtnz
Copy link
Contributor Author

dvdmrtnz commented Jan 28, 2024

Thanks!

  1. How does this scheme fit adding the planned variation of the more contrast dark style that is suitable for daylight use (not only for the use at night/dark environment, as the current low-contrast style)?

  2. Would it be possible to make a setting "use a more contrast style" to switch it (maybe also for a light theme)?

  3. Are there any benefits of using a different structure, e.g.

light
light/default
light/outdoor
light/vehicle
dark
dark/default
dark/outdoor
dark/vehicle

? 4. Would it be possible to add a new style that is light-only or dark-only?

In that case, I guess a new contrast style could be added for example:

default
├─ light
├─ dark
vehicle
├─ light
├─ dark
outdoors
├─ light
├─ dark
contrast
├─ dark

If the new style for example only has dark style, a fallback in map_style_reader.cpp could be set to use the light style from the default style.

@dvdmrtnz dvdmrtnz force-pushed the styles branch 4 times, most recently from 6dba90a to 9e10065 Compare February 3, 2024 08:54
@dvdmrtnz
Copy link
Contributor Author

dvdmrtnz commented Feb 3, 2024

Rebased

@pastk
Copy link
Contributor

pastk commented Feb 5, 2024

3. Are there any benefits of using a different structure, e.g.

The light/dark styles differ in colors only while sharing all other mapcss files. So it makes more sense to put a "style name" first and then an optional color palette.

@pastk
Copy link
Contributor

pastk commented Feb 5, 2024

If we go a way of different color palettes for a "night" (low-contrast) theme and a "dark" (daylight suitable) theme, then we'll be able to add a "night" subfolder, e.g.

default
├─ light
├─ dark
├─ night

But this actually means that atm we have a "light" and "night" palettes and no "dark" one.

@pastk
Copy link
Contributor

pastk commented Feb 5, 2024

A different thing is the current "vehicle" style.
Its used for the car navigation mode only. And we're likely to add a "car/driving" style later.

If we'd call it "driving" indeed then its OK to leave "vehicle" as is? Or maybe better to rename to e.g. "driving-navigation" as its much more clear?

@dvdmrtnz dvdmrtnz force-pushed the styles branch 2 times, most recently from a1c9b8b to 2de3e85 Compare February 17, 2024 14:45
@pastk
Copy link
Contributor

pastk commented Feb 18, 2024

Re icons folders rename.

I don't think we'd ever use different icon sets for different styles (but different colors will stay for now).
So IMO it makes sense to move them outside of the current styles/clear/style-clear/ folder.
Also its better to make separate folders for the source svg icons and many auto-generated png versions.

@dvdmrtnz
Copy link
Contributor Author

dvdmrtnz commented Mar 4, 2024

Also its better to make separate folders for the source svg icons and many auto-generated png versions.

They already are in different folders. Source svg icons are in data/styles/default/light/symbols and auto-generated png versions are in data/resources-mdpi_light, resources-hdpi_light... folders.

@dvdmrtnz dvdmrtnz force-pushed the styles branch 2 times, most recently from d3859e3 to 56a6a9e Compare March 5, 2024 18:44
@Jean-BaptisteC
Copy link
Member

Ready to merge?

@dvdmrtnz
Copy link
Contributor Author

dvdmrtnz commented Mar 10, 2024

Rebased and ready to be merged

drules_proto_vehicle_clear.bin
drules_proto_default_light.bin
drules_proto_default_dark.bin
drules_proto_vehicle_light.bin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm why there is no outdoors style here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would guess because the desktop application has no outdoors style?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually it has, but there is no UI for switching;
one has to type ?olight in the search - it works well

"drules_proto_default_dark.bin",
"drules_proto_default_dark.txt",
"drules_proto_vehicle_light.bin",
"drules_proto_vehicle_light.txt",
"drules_proto_vehicle_dark.bin",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also no outdoors style here
(what does this script do?)

paths = ['clear/style-clear', 'clear/style-night', 'vehicle/style-clear', 'vehicle/style-night']
suffixes = ['_clear', '_dark', '_vehicle_clear', '_vehicle_dark']
paths = ['default/light', 'default/dark', 'vehicle/light', 'vehicle/dark']
suffixes = ['_default_light', '_default_dark', '_vehicle_light', '_vehicle_dark']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really know what these python tools do. I just changed the styles names. I don't know why there's no outdoors styles in there

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pastk it's the question to you )

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script is used for designer tool. Since the designer is broken, we can ignore any inconsistency here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great to revive designer back.

docs/STYLES.md Outdated Show resolved Hide resolved
MapStyle::MapStyleVehicleClear,
static std::vector<MapStyle> styles = {MapStyle::MapStyleDefaultLight,
MapStyle::MapStyleDefaultDark,
MapStyle::MapStyleVehicleLight,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vng do we need the outdoors style here too?

@@ -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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

outdoors?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MapStyleOutdoorsDark?

@pastk
Copy link
Contributor

pastk commented Mar 11, 2024

Also its better to make separate folders for the source svg icons and many auto-generated png versions.

They already are in different folders. Source svg icons are in data/styles/default/light/symbols and auto-generated png versions are in data/resources-mdpi_light, resources-hdpi_light... folders.

Right, I've confused auto-generated skins with e.g. data/styles/default/light/xhdpi with manually created versions of bookmarks and search results icons..

Still, it'd be better to move data/styles/default/light/symbols/ into e.g. data/map-icons/light/svg and data/styles/default/light/xhdpi into e.g. data/map-icons/light/png/xhdpi and data/resources-mdpi_light into e.g. data/map-icons/light/skins/mdpi. As the current structure is messy and is not logical.
We can do it in a separate PR though and discuss the best (and future-proof) structure beforehand.

@pastk pastk requested review from vng and biodranik March 13, 2024 11:22
@dvdmrtnz dvdmrtnz force-pushed the styles branch 3 times, most recently from a419cba to 32ad4e5 Compare March 17, 2024 09:29
@dvdmrtnz
Copy link
Contributor Author

Still, it'd be better to move data/styles/default/light/symbols/ into e.g. data/map-icons/light/svg and data/styles/default/light/xhdpi into e.g. data/map-icons/light/png/xhdpi and data/resources-mdpi_light into e.g. data/map-icons/light/skins/mdpi. As the current structure is messy and is not logical. We can do it in a separate PR though and discuss the best (and future-proof) structure beforehand.

I think that's a good idea. Can be done in a separate PR

@pastk
Copy link
Contributor

pastk commented Apr 10, 2024

@vng @biodranik could you review please?

Copy link
Member

@biodranik biodranik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better to squash the first 4 commits into one, and remove the last one to add it after the merge.

LGTM otherwise. @vng WDYT?

@@ -1,3 +1,5 @@
6aa73face8b5eb8e026cfafa40d1983d4a0502c0
480fa6c2fcf53be296504ac6ba8e6b3d70f92b42
a6ede2b1466f0c9d8a443600ef337ba6b5832e58
# [styles] Move all icons to renamed styles folders
4b39ab2413a461376b04572bc51de18e609a7b19
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hash can change after the rebase, it's safer to add this commit after the merge.

Copy link
Contributor Author

@dvdmrtnz dvdmrtnz Apr 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will remove this commit and make a new PR after the merge

@@ -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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MapStyleOutdoorsDark?

paths = ['clear/style-clear', 'clear/style-night', 'vehicle/style-clear', 'vehicle/style-night']
suffixes = ['_clear', '_dark', '_vehicle_clear', '_vehicle_dark']
paths = ['default/light', 'default/dark', 'vehicle/light', 'vehicle/dark']
suffixes = ['_default_light', '_default_dark', '_vehicle_light', '_vehicle_dark']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pastk it's the question to you )

@dvdmrtnz
Copy link
Contributor Author

Squashed and rebased

@rtsisyk
Copy link
Contributor

rtsisyk commented Apr 26, 2024

pastk: Maybe better to merge it right after the release..

@dvdmrtnz
Copy link
Contributor Author

pastk: Maybe better to merge it right after the release..

Okay. Just let me know when you are ready to merge and I can rebase the branch if necessary

@pastk
Copy link
Contributor

pastk commented May 9, 2024

@dvdmrtnz as we're renaming e.g. drules_proto_vehicle_clear.bin anyway, then maybe let's make them shorter e.g. drules_vehicle_light.bin or put them together into a separate folder data/drules or maybe into respective style folders even (not sure here, probably its better to keep source and generated files separately?)
WDYT?

@pastk
Copy link
Contributor

pastk commented May 9, 2024

@vng please take a look when you have time.
It'd be great to finalize and merge it after the current May release is out.

@rtsisyk
Copy link
Contributor

rtsisyk commented May 16, 2024

@vng please take a look when you have time. It'd be great to finalize and merge it after the current May release is out.

Please rebase and merge

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 <47610359+dvdmrtnz@users.noreply.github.com>
Signed-off-by: David Martinez <47610359+dvdmrtnz@users.noreply.github.com>
@Jean-BaptisteC
Copy link
Member

@rtsisyk ready to merge

@vng vng merged commit f69f5b6 into organicmaps:master May 23, 2024
15 checks passed
@dvdmrtnz dvdmrtnz deleted the styles branch May 23, 2024 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants