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

[data] Refactor resources folder #8123

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AndrewShkrob
Copy link
Member

@AndrewShkrob AndrewShkrob commented May 8, 2024

New folder structure
From

  • resources-mdpi-clear
  • resources-mdpi-dark
  • resources-xhdpi-clear
  • resources-xhdpi-dark

To

symbols
├── 6plus
│   ├── clear
│   │   ├── symbols.png
│   │   └── symbols.sdf
│   ├── dark
│   │   ├── symbols.png
│   │   └── symbols.sdf
│   └── design
│       ├── symbols.png
│       └── symbols.sdf
├── hdpi
│   ├── clear
│   │   ├── symbols.png
│   │   └── symbols.sdf
│   ├── dark
│   │   ├── symbols.png
│   │   └── symbols.sdf
│   └── design
│       ├── symbols.png
│       ├── symbols.sdf

Moved area-hatching.png and traffic-arrow.png from {dpi}/{clear|dark} to symbols/default folder as all these files are the same and not regenerated.

Unfortunately, Xcode doesn't allow a resources folder in the root directory. I had to rename the folder from resources to symbols.
More info: https://stackoverflow.com/questions/33993741/codesign-failed-with-exit-code-1-failing-to-build-copy-resources/40167588#40167588

I cannot place resources-svg in symbols/svg due to another Xcode problem. It doesn't allow to have a reference folder and exclude one of the subfolders from the project.

@AndrewShkrob AndrewShkrob requested review from biodranik and vng May 8, 2024 18:46
@AndrewShkrob AndrewShkrob requested a review from a team as a code owner May 8, 2024 18:46
@AndrewShkrob AndrewShkrob force-pushed the data/resources-refactoring branch 3 times, most recently from 2c294de to a1a5440 Compare May 8, 2024 20:10
Signed-off-by: Andrew Shkrob <andrew.shkrob.social@yandex.by>
@biodranik
Copy link
Member

@AndrewShkrob did you see this one? WDYT? #7264

@AndrewShkrob
Copy link
Member Author

@AndrewShkrob did you see this one? WDYT? #7264

light/dark is much better than clear/dark
We can postpone this PR until the #7264 is merged. I'll rebase it later.

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually its different:
128x32 for mdpi
512x128 for xxxhdpi

Copy link
Contributor

Choose a reason for hiding this comment

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

Stuff in resources-svg is very different from "symbols.png".

Icons from resources-svg are used in apps' UI and AFAIK not directly, e.g. for android they have to be converted into vector drawable.

"symbols.png" are map icons (and other symbols) consumed by core and automatically generated via generate_symbols.sh.

So I think it makes sense to keep their names different to avoid confusion.
Maybe just leave "resources-svg" as is or rename to e.g. "UI-icons-svg"...

@pastk
Copy link
Contributor

pastk commented May 9, 2024

Moved area-hatching.png and traffic-arrow.png from {dpi}/{clear|dark} to symbols/default folder as all these files are the same and not regenerated.

So traffic arrows are different (compare mdpi to xxxhdpi).

area-hatching.png is the same for all dpis indeed.
But its very likely we'll expand handling of it to support other more complex textures like forest, shrub, hospital, etc. and they're likely to be dpi-dependent.. @vng WDYT?

@pastk
Copy link
Contributor

pastk commented May 9, 2024

Thanks for this PR, its a great companion to #7264!

Please check #7264 (comment)
i.e. there are dpi-specific folders in data/styles/clear/style-clear/ which would be great to move too!

@pastk
Copy link
Contributor

pastk commented May 9, 2024

Please check #7264 (comment) i.e. there are dpi-specific folders in data/styles/clear/style-clear/ which would be great to move too!

Though I'm not sure it'll be a good idea to put them into symbols/hdpi/... you've created.
Probably makes sense to keep "resource files" (included directly into apps) and "source files" separately, esp. given the Xcode restriction you've mentioned. Sometimes "sources" are identical to "resources" (there is no processing before app inclusion). In that case they should reside in "resources" directly or could be symlinked there (better for logical organisation of files and more future proof).

@@ -15,7 +15,7 @@ stxxl.log
screenlog.0
Copy link
Contributor

Choose a reason for hiding this comment

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

What problem does this PR solve?

Copy link
Member Author

Choose a reason for hiding this comment

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

mess in the data folder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants