refactor(ui): update general settings layout, add tooltip delay setting#1235
Conversation
WalkthroughThe changes introduce a new configurable setting for tooltip hover delay, integrate it into the theme system, and expose it in the UI. The general settings interface is refactored from a collapsing header with tables to a tabbed layout, reorganizing shader, keybinding, and interface options. Tooltip hover logic is updated to use delayed hover detection. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Menu
participant ImGui
User->>Menu: Open Settings Menu
Menu->>ImGui: Create Tab Bar ("Shaders", "Keybindings", "Interface")
User->>Menu: Select "Interface" Tab
Menu->>ImGui: Show nested tabs ("UI Options", "Sizes", "Colors")
User->>Menu: Adjust "Tooltip Hover Delay" slider
Menu->>ImGui: Update TooltipHoverDelay in ThemeSettings
Menu->>ImGui: Set ImGui style HoverDelayNormal
User->>ImGui: Hover over UI element
ImGui->>User: Show tooltip after configured delay
Suggested reviewers
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Automated formatting by clang-format, prettier, and other hooks. See https://pre-commit.ci for details.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/Menu.cpp (1)
1240-1263: Consider adding validation for extreme valuesWhile the slider is clamped to 0.0-2.0 seconds, consider adding a note in the tooltip about recommended values. Very low values (near 0) might make tooltips too eager, while very high values might make them feel unresponsive.
if (auto _tt = Util::HoverTooltipWrapper()) { - ImGui::TextUnformatted("Time in seconds to wait before a tooltip appears when hovering over an item."); + ImGui::TextUnformatted("Time in seconds to wait before a tooltip appears when hovering over an item.\nRecommended range: 0.3-1.0 seconds."); }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/Menu.cpp(4 hunks)src/Menu.h(1 hunks)src/Utils/UI.cpp(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: alandtse
PR: doodlum/skyrim-community-shaders#0
File: :0-0
Timestamp: 2025-06-24T07:17:36.604Z
Learning: When reviewing PRs, always clarify the scope if there are multiple related features or dependencies. WeatherPicker was a separate PR that was already merged, while this PR focuses specifically on WetnessEffects climate preset system enhancements.
🧬 Code Graph Analysis (1)
src/Utils/UI.cpp (1)
src/Utils/UI.h (1)
hovered(33-33)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Build plugin and addons
🔇 Additional comments (8)
src/Menu.h (1)
84-84: LGTM: Clean addition of tooltip delay configuration.The new
TooltipHoverDelaymember is well-implemented with a reasonable default value and clear documentation. The 0.5-second default provides a good balance between responsiveness and preventing accidental tooltip triggers.src/Utils/UI.cpp (1)
25-25: Confirmed: Tooltip delay setting is correctly appliedThe
TooltipHoverDelayvalue fromthemeSettingsis assigned tostyle.HoverDelayNormalinsrc/Menu.cpp, so usingImGuiHoveredFlags_DelayNormalwill respect the custom delay. No further changes needed.src/Menu.cpp (6)
115-115: LGTM: Proper serialization integrationThe
TooltipHoverDelayfield is correctly added to the JSON serialization macro, ensuring the setting persists between sessions.
145-145: LGTM: Correct style applicationThe tooltip delay setting is properly applied to ImGui's
HoverDelayNormalstyle property, which will control the delay for all tooltips using delayed hover detection.
1160-1187: LGTM: Clean shader settings tab implementationThe "Shaders" tab properly encapsulates all shader-related toggles with appropriate tooltips. The structure is clean and maintains the original functionality.
1188-1235: LGTM: Well-organized keybindings tabThe keybindings tab effectively groups all hotkey configuration in one place. The conditional logic for key setting mode is handled correctly, and the UI provides clear feedback to users.
1257-1260: LGTM: Excellent tooltip delay implementationThe tooltip hover delay slider is well-implemented with:
- Reasonable range (0.0-2.0 seconds) with proper clamping
- Clear formatting showing seconds
- Helpful tooltip explaining the functionality
- Proper integration with the theme settings system
1160-1364: Excellent UI refactoring with improved organizationThe transition from collapsing headers to a tabbed interface significantly improves the settings organization:
- Logical grouping: Shaders, Keybindings, and Interface tabs provide clear categories
- Nested structure: The Interface tab's sub-tabs (UI Options, Sizes, Colors) create better hierarchy
- Maintained functionality: All original settings are preserved and accessible
- Consistent patterns: The code follows established ImGui and project conventions
This refactor enhances user experience by making settings easier to find and navigate.
|
✅ A pre-release build is available for this PR: |
| ImGui::SameLine(); | ||
| if (ImGui::RadioButton("Full Palette", !themeSettings.UseSimplePalette)) | ||
| themeSettings.UseSimplePalette = false; | ||
|
|
There was a problem hiding this comment.
a little nit-picky (I know i can be guilty of this too). but just be careful of mass line changes where nothings actually different like here. just bloats out the pr. AI can often do this rather annoyingly.
There was a problem hiding this comment.
There was a tab added before.
|
approved, pr doesn't have anything bad that jumps out at me. Little bloated with unrelated line changes though/ bad formatting. |
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Quality of life updates to a couple parts of the menu UI/UX.
Summary by CodeRabbit
New Features
Refactor
Style