Skip to content

customizable toolbars#3259

Merged
clsid2 merged 84 commits intoclsid2:developfrom
adipose:patch510
Aug 15, 2025
Merged

customizable toolbars#3259
clsid2 merged 84 commits intoclsid2:developfrom
adipose:patch510

Conversation

@adipose
Copy link

@adipose adipose commented Feb 1, 2025

This implements toolbars that can have dynamic elements between the first three "static" toolbar elements, and the volume button at the end.

The SVG is based off my old idea of 4 rows active/inactive/active dark/inactive dark (I forget the exact order). However, the svg is designed to support up to 32 buttons eventually, and is sized accordingly.

The customization works by using the CToolbar drag and drop. It's pretty basic, but you can drag a button off the toolbar to delete it, and drag it left and right to drop it elsewhere. I need to see about the newer (mfc) toolbar capabilities, but given that it always used CToolbar, I thought this would be simplest.

The save and load of the toolbar sequence is implemented.

Adding buttons back to the toolbar can currently only be done through the double click customize dialog. That dialog is not themed and also allows adding separators back (we don't want this). If that can't be fixed we can have an simple dialog to adjust the toolbar.

See what you think. This does not merge due to being designed prior to recent toolbar changes.

@clsid2
Copy link
Owner

clsid2 commented Feb 1, 2025

Can you make a test build?

Since the reserved buttons are in the middle of the image, we can't use the image width as an indicator of how many buttons are valid. But perhaps that info could be passed through filename/foldername of an external toolbar. Like "button_bc15.svg" where bc15 means button count 15.
But I think it is better to just avoid all that extra complexity by having designers make a large list of buttons, even ones that we might not actually use yet in short term, but might possibly in more distant future.
For exotic actions users will need to use the generic buttons anyway, and new buttons for common stuff can be determined beforehand.

@adipose
Copy link
Author

adipose commented Feb 3, 2025

Test build:
https://mega.nz/file/MNB3GJTS#tGiMS9LoM8HeaBqrXgEHZm9xgPFkJyr_0-VgJCdKAYI

For valid buttons, my plan was to check for any button data. The region should be left transparent if nothing is designed for that button.

@adipose
Copy link
Author

adipose commented Feb 13, 2025

@clsid2
Copy link
Owner

clsid2 commented Feb 13, 2025

In light theme, the active buttons are light gray and disabled buttons dark. Should be swapped.

The customize toolbar dialog could probably be moved to a new settings page. Where top half of page is used for the button selection/order. And bottom half for button specific options such as assigning commands to future generic buttons.

Current toolbar buttons as the left list and available as right side list? I think that would look a bit more intuitive.

Maybe hide the buttons in the list that have a fixed position? (play/pause/stop/mute/separator)

Reset button does not work properly yet? As a test I moved the next button to after previous.

@adipose
Copy link
Author

adipose commented Feb 13, 2025

In light theme, the active buttons are light gray and disabled buttons dark. Should be swapped.

Fixed. It currently uses the same for light and classic, but we could add a third row.

@adipose
Copy link
Author

adipose commented Feb 13, 2025

The customize toolbar dialog could probably be moved to a new settings page. Where top half of page is used for the button selection/order. And bottom half for button specific options such as assigning commands to future generic buttons.

The dialog it pops up is actually a classic win32 toolbar customization dialog. It probably wouldn't be too hard to reproduce the behavior of it. It shares some behavior with the drag and drop.

Maybe hide the buttons in the list that have a fixed position? (play/pause/stop/mute/separator)

Yes that would be helpful. Have to design the whole thing from scratch to do it.

Reset button does not work properly yet? As a test I moved the next button to after previous.

It doesn't appear to work, no.

@adipose
Copy link
Author

adipose commented Mar 9, 2025

This has an options page now that allows customizing of the toolbar. It's working pretty well. I did notice one quirk where deleting all buttons will require a reset to add back. I'll fix it soon.

@adipose
Copy link
Author

adipose commented Mar 9, 2025

@adipose
Copy link
Author

adipose commented Mar 11, 2025

@clsid2
Copy link
Owner

clsid2 commented Mar 11, 2025

I will check it out very soon

@clsid2
Copy link
Owner

clsid2 commented Aug 14, 2025

With v17 the minimum width is still too large. It needs count - 2 for size of left side buttons because mute button is on right side?

@clsid2
Copy link
Owner

clsid2 commented Aug 14, 2025

If you open audio menu, then move mouse to subtitle button while menu is open, clicking on sub button only closes the menu. I know this is standard Windows behavior. First click only closes any menu.
But perhaps this could be bypassed in this case without to much nasty workarounds? Because I think this is a situation that many people might perform.

@adipose
Copy link
Author

adipose commented Aug 14, 2025

Repeat and Suffle buttons don't show current state after adding. For example this is my settings. Both are disabled.

Note: Even though it shows wrong icon, but it doesn't highlight the buttons which is correct behavior. Clicking on the buttons or restarting the app fixes the issue.

Fixed.

@adipose
Copy link
Author

adipose commented Aug 14, 2025

With v17 the minimum width is still too large. It needs count - 2 for size of left side buttons because mute button is on right side?

-2 is correct because the dynamic spacer is counted as a button. Fixed.

@adipose
Copy link
Author

adipose commented Aug 14, 2025

If you open audio menu, then move mouse to subtitle button while menu is open, clicking on sub button only closes the menu. I know this is standard Windows behavior. First click only closes any menu. But perhaps this could be bypassed in this case without to much nasty workarounds? Because I think this is a situation that many people might perform.

I implemented it. It's not super complicated, but it takes about 10 lines of code to create the mouse click.

@clsid2
Copy link
Owner

clsid2 commented Aug 14, 2025

Does it need a check for being a click on a different button? To prevent closing and directly reopening menu again if clicked twice on same button.

@adipose
Copy link
Author

adipose commented Aug 14, 2025

After changing the active style in the toolbar style settings, the button images in the toolbar layout won't update until I restart the program. Is this a bug or intended behavior? In the Toolbar Layout dialog, does it need to reflect changes immediately, like the toolbar does?

Fixed bug now.

@adipose
Copy link
Author

adipose commented Aug 14, 2025

Does it need a check for being a click on a different button? To prevent closing and directly reopening menu again if clicked twice on same button.

Yes, done.

@adipose
Copy link
Author

adipose commented Aug 14, 2025

https://mega.nz/file/pFQRUCqR#NyPIMiDgZqDII5NyOV9eRPHvfsDA90JgJGGQWPzlCps

@adipose
Copy link
Author

adipose commented Aug 15, 2025

2.5.1.78

Audio and Subtitle Track toolbars are seems like disabled at first while DVD playback. Right click to video area also fixes it.

On my end it is still reproducible.

2.5.1.78

Audio and Subtitle Track toolbars are seems like disabled at first while DVD playback. Right click to video area also fixes it.

On my end it is still reproducible.

Can you supply the DVD and the steps to reproduce it? For me it is working. What I did was reload those menus on title change, because currently they are not reloaded for DVDs except as right click is opened. Perhaps in your case title change never occurs?

@xLn2
Copy link

xLn2 commented Aug 15, 2025

Sent via e-mail. I tried directly open video_ts.ifo and also open dvd/bd folder but both are same.

@tsubasanouta
Copy link

The external toolbar turns on when the scale is 18.

@clsid2 clsid2 merged commit 0ea19f2 into clsid2:develop Aug 15, 2025
@clsid2
Copy link
Owner

clsid2 commented Aug 15, 2025

Good work, thanks!

I propose a new PR for dealing with minor bugs that are yet unresolved.

I will release a dev build later today so general public can test it.

@clsid2
Copy link
Owner

clsid2 commented Aug 15, 2025

Right-click on audio/sub buttons could be set to toggle next track.

@adipose
Copy link
Author

adipose commented Aug 15, 2025

The external toolbar turns on when the scale is 18.

That's by design. If the total scale factors (tb scale * dpi) is less than 24, it will go back to the default toolbar. Unless of course your toolbar has a 16 pixel version.

@adipose adipose deleted the patch510 branch August 23, 2025 22:51
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.

6 participants