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

Skins: add skins: path alias #12463

Merged
merged 3 commits into from
Dec 27, 2023
Merged

Conversation

ronso0
Copy link
Member

@ronso0 ronso0 commented Dec 23, 2023

This fixes an inconvenience noticed by @mxmilkiib in #10123 (comment)

If you want to mod a skin that uses template urls like skin:../Deere/some_template.xml by copying it to the user skins directory and rename it so it's easy to identify in the skins combobox, this would break the template url scheme (requiring to alter all template urls to fix).

This PR adds the system skins directory as skins to the QDir searchpaths for all src attributes. For the plain LaunchImageStyle string skins:[skin name] is resolved to the actual path.
Now it's possible to locate templates via src="skins:Deere/some_template.xml, which in turn simplifies the process of creating simple skin mods:

  • create user skin directory LateNight (bright waveforms)
  • copy/paste only skin.xml and adjust the waveform color variables for example
  • (loads all templates and stylesheets from original LateNight)
  • (benefit from all LateNight updates, except those in skin.xml)

The other commits adjust Deere, LateNight and Tango to use skins:, and simplifies the 64-sampler templates a bit.

// would have already triggered an error message.
// Note: we may also add the user skins path, in case there are custom skins
// that use the same template inheritance scheme like official skins, but we
// don't because unfirtunatey there is no reliable way to apply equivalent
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// don't because unfirtunatey there is no reliable way to apply equivalent
// don't because unfortunately there is no reliable way to apply equivalent

Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

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

Just a typo, the rest LGTM Thank you.

@JoergAtGithub
Copy link
Member

LGTM and works on my Windows11 system as before! Thank you!

@JoergAtGithub JoergAtGithub merged commit faa0a3a into mixxxdj:2.4 Dec 27, 2023
13 checks passed
@ronso0
Copy link
Member Author

ronso0 commented Dec 27, 2023

Thanks for testing this!

@ronso0 ronso0 deleted the skins-path-alias branch December 27, 2023 00:15
@Russe
Copy link
Contributor

Russe commented Dec 28, 2023

I don't get this to run with a modded skin. Is there any further description how to use this feature?
What do I need to do when I want to change LateNight toolbar.xml only?

These are my steps trying to get a modded skin to run:

  • create user skin folder "LateNight (Test)" at .mixxx/skins/
  • copy toolbar.xml from /usr/share/mixxx/skins/LateNight to .mixxx/skins/LateNight (Test)/
  • change some content of this copied toolbar.xml
  • restart Mixxx and choose skin "LateNight (Test)"

Now the "original" skin will be loaded instead my adapted toolbar.xml
When also copying skin.xml and adapt the path to my modded toolbar.xml the toolbar will not be displayed anymore.

@ronso0
Copy link
Member Author

ronso0 commented Dec 28, 2023

If you want a skin mod you need to copy only skin.xml and the (top-level) files the files to be modded.
For templates in subdirectories you'd need that subdirectory and mod the respective skins.

So, in your case

  • copy skin.xml and toolbar.xml
  • change <Template src="skins:LateNight/toolbar.xml"/> to
    <Template src="skin:toolbar.xml"/> so Mixxx looks for it in the parent skin directory
  • change toolbar.xml to your liking
  • load "LateNight (Test)"

I agree, all in all this is still no optimal solution but IMO it's better than before.

@Russe
Copy link
Contributor

Russe commented Dec 30, 2023

This is what I did.
Today, I did an update of Mixxx to most recent version 2.4-beta-314-g71dceb27ba
Again, with the same steps of your description the toolbar will not be displayed any more.
Am I using the wrong version of Mixxx?

My System: Ubuntu 22.04.3 LTS

@ronso0
Copy link
Member Author

ronso0 commented Dec 30, 2023

Hmm, works nicely for me.
Note the difference skin: vs. skins: (plural).
I created LateNight---toolbar in the user skins dir, with just skin.xml and toolbar.xml, and in skin.xml I'm using
<Template src="skin:toolbar.xml"/> (which loads LateNight---toolbar/toolbar.xml) and I see the changes I made.

However, there seems to be a double / when adding the system skin path, I'll push a fix.

@ronso0
Copy link
Member Author

ronso0 commented Dec 30, 2023

With more debug output I now see the QDir searchPaths persist, i.e. skins is added repeatedly when reloading a skin.
I'll fix that, too.

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

Successfully merging this pull request may close these issues.

None yet

4 participants