Skip to content

Enhance patch UI with buttons for better interaction #279

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

Merged
merged 22 commits into from
Apr 14, 2025

Conversation

lilyremigia
Copy link
Contributor

Added buttons for moving patches between lists, reordering selected patches, and improving patch selection clarity in the UI. Updated methods to handle button actions and ensure smoother interaction logic.

Fixes #274 .

Added buttons for moving patches between lists, reordering selected patches, and improving patch selection clarity in the UI. Updated methods to handle button actions and ensure smoother interaction logic.
@lilyremigia
Copy link
Contributor Author

Perhaps, we could also remove the other buttons for a cleaner UI?

@lilyremigia
Copy link
Contributor Author

Also, I just realised, I forgot to hide buttons when not hovering over them.

Introduced a reusable style `HoverVisibleButtonStyle` to manage button visibility on hover. Replaced `StackPanel` with `Grid` for better layout management and for putting buttons on top of the text. Improved user interactivity by ensuring buttons only appear when hovered over related elements.
@brliron
Copy link
Member

brliron commented Mar 11, 2025

After a bit of testing:

  • I don't like how it looks. I think that big gray box clashes too much with the white background. Maybe things like some transparency, round corners, a light blue border to ease the transition, or just a lighter background on the buttons would help? Or maybe it's just me?
  • I don't like the buttons being aligned on the left, because they're over the name of the patch. I think that one is less subjective, that it would be a problem for many people. I think aligning them to the right would be better.
  • I feel some discomfort while using these buttons, but I think that's mostly because of the previous point, outside of that I think these buttons could feel nice to use.
  • I did have a hard time following the item while trying to use the up/down arrows. Maybe we need to make something to help with that, like selecting the item after it moved? Or maybe this was a problem only because of the previous issue with the buttons being over the text? I'll have to try it out after we fix that, maybe we don't need to change anything (btw, I was testing with 2 items in the list, which is probably the worst case because every item in the list moves).

Otherwise, the code looks fine. And yeah, I don't think we need to keep the old arrows if we add these ones.

Removed unused navigation buttons and adjusted margins for consistency. Moved the help button next to the filter box for better user guidance.
Removed image resources and replaced arrow buttons' images with Unicode emoji. Updated button styles and templates for consistent appearance and simplified resource management.
Improved grid structure by adjusting margins, row definitions, and text wrapping for better readability. Simplified bindings and rearranged buttons to ensure consistent alignment and user experience.
Reorganized grid columns to improve logical layout and added a border to distinguish the source patch title. Updated text and button alignment.
…ange styling of the treeview elements.

Added a shared style (TextBlockCommonStyle) to simplify and standardize TextBlock properties across the UI. This reduces code duplication and ensures consistent alignment, wrapping, and trimming behavior. Updated existing TextBlock elements to use the new style where applicable.
Removed unnecessary margin from Grid background. Adjusted padding and added MaxHeight to text elements for better alignment and visual consistency.
Introduced a new header text style for improved UI consistency and applied it to section headers. Updated grid layout to better organize elements and added explanatory text for patch application order.
@lilyremigia
Copy link
Contributor Author

This is probably as good as it gets, unless we want to add some kind of animation or "moved here" style. Alternativly, I guess we could do drag & drop for reordering.

The description of what patches do were moved to the Page's description. While the order is available under the Selected Patches header.
@brliron
Copy link
Member

brliron commented Mar 12, 2025

That wasn't what I was thinking about, but it does feel quite good to use, I like it. I'm frustrated that the patch ids have an ellipsis at the end and that I can't read them entirely. Maybe that one can be solved with a tooltip? But outside of this problem, I like it.

Some other remarks:

  • The up / down arrows should be grayed out when they don't do anything (the up arrow on the 1st element and the down arrow on the last element).
  • On the left column (the one with the repo and patch id) of the selected patches, it's hard to see the difference between the lines. Like, in the screenshot below, it's hard to understand that "thpatch" and "lang_fr" are together, describing the same patch, and that "Arandui" and "th07_ut_..." are together describing another patch. Maybe you could split them with a thin horizontal gray line?
  • There is a new bug: the search doesn't hide empty repos.
  • There's also a change in behavior: the repos are now collapsed at the beginning. I'm not sure if this is intentional, I think I prefer when they're all expanded by default, but both options have their pros and cons.
  • In the available patches, if you single-click on an item, it becomes blue and the arrow's background stays white (not a problem), but there's a one pixel column of blue on the left of the arrow's background.
  • In the selected patches, you can remove an item by double-clicking on it, but it doesn't become blue when you single click on it.
    image

@32th-System
Copy link
Member

2025-03-13.22-41-02.mp4

Tested out touch behavior. If your finger happens to touch the spot where the arrow is when you hover with the mouse, that arrow's action is performed automatically. If you just select an item with the touch screen though, the arrows show up where they should.

@lilyremigia
Copy link
Contributor Author

If I'm correct all of those points should have been addressed in some capacity in the above changes.

@brliron
Copy link
Member

brliron commented Mar 19, 2025

Looks good.
@32th-System Can you test if your issue with touchscreens have been resolved?

@32th-System
Copy link
Member

32th-System commented Mar 20, 2025

I'll do a more proper test when I'm home, but I can test on Linux with touchscreen right now.

EDIT: Wine itself doesn't seem to support touchscreen at all. I'll do my testing on Windows when I get home, but testing touchscreen stuff in Wine, for now, seems completely pointless

@32th-System
Copy link
Member

For future reference: cccab28

Some platforms we support don't show emojis correctly

@brliron
Copy link
Member

brliron commented Mar 24, 2025

Quick comment about your latest commit, I don't see Page2_advanced.PropertyChanged being used anywhere, and because of that, I don't think the inheritance on INotifyPropertyChanged is useful. Does PropertyChanged do something just by existing, or is that something from a previous test that your forgot to remove?

@lilyremigia
Copy link
Contributor Author

Pretty sure Bindings don't work without it, even if they're get only.

@lilyremigia
Copy link
Contributor Author

I tested it in Windows 7 and works, but for whatever reason the Wingdings arrows are misaligned. If anyone has any idea, they're free to contribute, but otherwise, if this also works on XP I would merge this and worry about touch support in a different, perhaps more comprehensive issue.

@brliron
Copy link
Member

brliron commented Mar 24, 2025

Pretty sure Bindings don't work without it, even if they're get only.

Well, I'm using a lot of bindings in https://github.com/thpatch/thcrap/blob/patch_editor/thcrap_configure_v3/Page2_PatchEditor.xaml , and no class in https://github.com/thpatch/thcrap/blob/patch_editor/thcrap_configure_v3/Page2_PatchEditor.xaml.cs inherits from INotifyPropertyChanged or declares a PropertyChanged member.

And I just tested on your latest changes quickly on Windows 10, it seems to work properly without them.

@brliron
Copy link
Member

brliron commented Mar 24, 2025

if this also works on XP

thcrap_configure_v3 uses .NET Framework 4.8 which isn't compatible with Windows XP, so there's nothing to test there.

@lilyremigia
Copy link
Contributor Author

Pretty sure Bindings don't work without it, even if they're get only.

Well, I'm using a lot of bindings in https://github.com/thpatch/thcrap/blob/patch_editor/thcrap_configure_v3/Page2_PatchEditor.xaml , and no class in https://github.com/thpatch/thcrap/blob/patch_editor/thcrap_configure_v3/Page2_PatchEditor.xaml.cs inherits from INotifyPropertyChanged or declares a PropertyChanged member.

And I just tested on your latest changes quickly on Windows 10, it seems to work properly without them.

Test it in Win7 without, it's the font binding that will won't work, if I remember correctly.

@lilyremigia
Copy link
Contributor Author

lilyremigia commented Mar 25, 2025

if this also works on XP

thcrap_configure_v3 uses .NET Framework 4.8 which isn't compatible with Windows XP, so there's nothing to test there.

If Vista is supported, then perhaps we could check if it also supports Segoe UI Symbol. That font might be less cursed making the arrows line-up naturally.

Never mind, after a little bit of searching, 4.8 doesn't support Vista either.

@brliron
Copy link
Member

brliron commented Mar 26, 2025

Pretty sure Bindings don't work without it, even if they're get only.

Well, I'm using a lot of bindings in https://github.com/thpatch/thcrap/blob/patch_editor/thcrap_configure_v3/Page2_PatchEditor.xaml , and no class in https://github.com/thpatch/thcrap/blob/patch_editor/thcrap_configure_v3/Page2_PatchEditor.xaml.cs inherits from INotifyPropertyChanged or declares a PropertyChanged member.
And I just tested on your latest changes quickly on Windows 10, it seems to work properly without them.

Test it in Win7 without, it's the font binding that will won't work, if I remember correctly.

I just tried on a Windows 7 VM (installing .NET Framework 4.8 was surprisingly hard because it depends on a few Windows updates and Windows Update seems dead), and it seems to work fine for me.
image

@brliron brliron merged commit 4ee885f into thpatch:master Apr 14, 2025
1 check passed
@lilyremigia lilyremigia deleted the better-advanced-patch-selection branch April 21, 2025 12:35
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.

configure_v3 : select entries in advanced mode with a single click
3 participants