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

refactor: modern-image layout title width and elements visibility #169

Merged
merged 5 commits into from
Nov 4, 2024

Conversation

Samillion
Copy link
Owner

@Samillion Samillion commented Nov 3, 2024

Pinging: @Commander07 @Keith94 @Xurdejl

Ok, so I merged the main layouts, now focusing on improving the looks of things.

Changes:

  • Title width should now be handled and displayed better with extremely long filenames
  • Playlist button and skip buttons should have better visibility now

To do:

  • Anything else?

Test script: /dev_modernimage_refactor/modernz.lua

image

@Xurdejl
Copy link
Contributor

Xurdejl commented Nov 3, 2024

The only thing I could say is that the title sometimes squeezes when it's too long.


To do:

  • Anything else?

Not about the image layout, but I guess something similar could be done for GIFs. Since they don't have sound, all the left buttons except the playlist aren’t needed.

@Keith94
Copy link
Contributor

Keith94 commented Nov 3, 2024

What about having the next and previous buttons be aligned to the right side along with the other buttons?

@Samillion
Copy link
Owner Author

Samillion commented Nov 3, 2024

The only thing I could say is that the title sometimes stretches when it's too long.

Terribly sorry for the bother, could you give me an example of a filename? or a character count?

What about having the next and previous buttons be aligned to the right side along with the other buttons?

Excuse my French, but that is a fuckin great idea! It will make dealing with the title so much easier lol

@Keith94
Copy link
Contributor

Keith94 commented Nov 3, 2024

Haha glad you agree. They honestly looked a little lonely floating by themselves.

@Xurdejl
Copy link
Contributor

Xurdejl commented Nov 3, 2024

Terribly sorry for the bother, could you give me an example of a filename? or a character count?

Sorry, I meant squeeze. I think there was an issue about that because it also happened in the video layout but can't seem to find it.

image

@Samillion
Copy link
Owner Author

Oh, that's intentional. It clips the area. In essence, it's like a counterpart to maxchars.

The title has a specific width, once it goes beyond that, we use ass tags to \\clip

lo.style = string.format("%s{\\clip(0,%f,%f,%f)}", osc_styles.title, geo.y - geo.h, geo.x + geo.w, geo.y + geo.h)

It has a side effect that it will change font type, because mpv font is limited, so it picks whatever your OS can cover with. (Arial, Sans Serif...etc)

@Samillion
Copy link
Owner Author

Forgot to note, the clipping should look much better once I apply Keith's idea.

@Xurdejl
Copy link
Contributor

Xurdejl commented Nov 4, 2024

Oh, then everything else looks perfect. The only idea I can think of is having zoom in/out on scroll wheel in the image mode.

@Keith94
Copy link
Contributor

Keith94 commented Nov 4, 2024

zoom in/out on scroll wheel in the image mode.

There may be some scripts out in the wild that can achieve similar things like that? I didn't test but came across this report earlier.

https://github.com/occivink/mpv-image-viewer?tab=readme-ov-file#scripts

@Samillion
Copy link
Owner Author

Samillion commented Nov 4, 2024

Should be easily implemented within ModernZ without external scripts. I think. I hope lol.

Since technically we can just add zoom in/out buttons and have them apply the effect on click/scroll

@Xurdejl
Copy link
Contributor

Xurdejl commented Nov 4, 2024

Yes, by default the keybinds are "alt +" and "alt -" for zooming in and out.

@Samillion
Copy link
Owner Author

image

@Samillion
Copy link
Owner Author

Samillion commented Nov 4, 2024

This is the auto-profile I'll be using for image viewer mode: (personal use)

[Image-View]
    profile-cond=p['current-tracks/video'] and p['current-tracks/video'].image and not p['current-tracks/video'].albumart
    osd-playing-msg=${media-title} [${?width:${width}x${height}}]
    reset-on-next-file=video-zoom,panscan,video-unscaled
    prefetch-playlist=yes
    script-opts-append=modernz-title=${media-title} [${?width:${width}x${height}}]
    script-opts-append=modernz-titlefontsize=24
    script-opts-append=modernz-showwindowtitle=no
    script-opts-append=modernz-showplaylist=yes
    script-opts-append=modernz-downloadbutton=yes
    script-opts-append=modernz-fade_alpha=100
    script-opts-append=modernz-tick_delay=0.03

I'll include it in the docs later as an example, so that users know how to adjust both general mpv options and ModernZ specific options.

How should I add the zoom in/out button?

  • Two buttons, one for in one for out?
  • One button with multi-function?

@Samillion
Copy link
Owner Author

I'll merge, then I'll open an issue to discuss further elements for image viewer mode. To keep things organized between PRs.

@Samillion Samillion merged commit e06ecc7 into main Nov 4, 2024
@Samillion Samillion deleted the dev_modernimage_refactor branch November 4, 2024 06:09
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.

3 participants