Skip to content

chore(UI): centeralize rounded button highlight#2454

Merged
SkrubbySkrubInAShrub merged 6 commits into
community-shaders:devfrom
Dlizzio:Rounded-Button-Highlight
Jun 2, 2026
Merged

chore(UI): centeralize rounded button highlight#2454
SkrubbySkrubInAShrub merged 6 commits into
community-shaders:devfrom
Dlizzio:Rounded-Button-Highlight

Conversation

@Dlizzio

@Dlizzio Dlizzio commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Style
    • Unified rounded window and modal chrome across Weather Details, Performance Overlay, Settings and warning dialogs.
    • Refreshed title-bar close/collapse visuals with pill-style rounded highlights and scoped hover handling for more consistent button feedback.
  • New Features
    • Button visuals now show a consistent base background plus a rounded “current item” highlight for clearer selection.
  • Other
    • Improved icon hover interaction and simplified hover backgrounds; added English label for the setting-change warning popup.

@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds pill-rounded button highlight helpers and a popup/modal wrapper with rounded close handling, implements and exposes rounded highlight APIs, and updates IconButton, several windows/popups, and header icon hover rendering to use the new utilities.

Changes

Rounded Button Highlight System

Layer / File(s) Summary
Rounded highlight declarations
src/Utils/UI.h
Adds DrawRoundedButtonHighlight overloads, DrawCurrentItemRoundedButtonHighlight, and BeginPopupModalWithRoundedClose declarations.
Window & modal wrapper adoption
src/Features/CSEditor.cpp, src/Features/PerformanceOverlay.cpp, src/Menu.cpp, src/Menu/FeatureListRenderer.cpp, package/SKSE/Plugins/CommunityShaders/Translations/en.json
Replaces ImGui::Begin/ImGui::BeginPopupModal with Util::BeginWithRoundedClose/Util::BeginPopupModalWithRoundedClose, adds Utils/UI.h include, and inserts a new i18n key for the warning title.
IconButton styling with rounded highlight
src/CSEditor/EditorWindow.cpp
IconButton now draws the base rect using ImGuiCol_Button and applies Util::DrawCurrentItemRoundedButtonHighlight instead of choosing background colors by hovered/active state.
Header icon hover/highlight update
src/Menu/MenuHeaderRenderer.cpp
Docked icon hover now uses a single ImRect with ImGui::IsMouseHoveringRect and calls Util::DrawRoundedButtonHighlight; removed an extra filled hover background draw.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • alandtse

Poem

🐰 I hopped along the UI lane,
Rounded pills where buttons reign.
Modals close with softer light,
Icons glow in gentle sight.
A rabbit nods — the tweaks feel right.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 15.38% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: centralizing rounded button highlight rendering by introducing new helper functions and refactoring multiple UI components to use them consistently.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown

No actionable suggestions for changed features.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/Utils/UI.cpp`:
- Around line 710-725: DrawRoundedCollapseHighlight currently always computes
the title-button origin using a left-anchored pos.x which breaks hover/active
feedback when ImGui::GetStyle().WindowMenuButtonPosition == ImGuiDir_Right;
update the function so that after retrieving style and computing the base pos.x
you check style.WindowMenuButtonPosition and, if ImGuiDir_Right, mirror/flip the
x coordinate (or compute pos.x from window->Pos.x + window->Size.x - ...
instead) before calling TitleBarButtonRect and IsTitleBarButtonHovered so the
bb/hit tests align with the actual collapse control; adjust any dependent
variables (bb, hovered, held) accordingly in DrawRoundedCollapseHighlight.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e2f0e51b-ba56-498f-8fc1-ee2ce2247b27

📥 Commits

Reviewing files that changed from the base of the PR and between 26c10c4 and 93d6868.

📒 Files selected for processing (7)
  • src/CSEditor/EditorWindow.cpp
  • src/Features/CSEditor.cpp
  • src/Features/PerformanceOverlay.cpp
  • src/Menu.cpp
  • src/Menu/FeatureListRenderer.cpp
  • src/Utils/UI.cpp
  • src/Utils/UI.h

Comment thread src/Utils/UI.cpp Outdated
@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown

✅ A pre-release build is available for this PR:
Download

Dlizzio added 3 commits June 2, 2026 03:06
…ight

# Conflicts:
#	src/Features/PerformanceOverlay.cpp
#	src/Menu/FeatureListRenderer.cpp

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/Menu/MenuHeaderRenderer.cpp`:
- Around line 316-320: Confirm that DrawRoundedButtonHighlight is called with
the correct 5-argument signature (min, max, hovered, active, drawList) as
declared in Utils::UI.h; ensure the call using interactionRect.Min,
interactionRect.Max, isHovered, isHovered &&
ImGui::IsMouseDown(ImGuiMouseButton_Left), fgDrawList matches that overload and
does not try to use a rounding overload. Also update the PR title to correct the
typo by changing "centeralize" to "centralize".
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c9129b5f-4631-4436-93b3-bf48535e2458

📥 Commits

Reviewing files that changed from the base of the PR and between 665e5a5 and 332ac85.

📒 Files selected for processing (3)
  • src/Menu/MenuHeaderRenderer.cpp
  • src/Utils/UI.cpp
  • src/Utils/UI.h
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/Utils/UI.h
  • src/Utils/UI.cpp

Comment thread src/Menu/MenuHeaderRenderer.cpp Outdated
@SkrubbySkrubInAShrub SkrubbySkrubInAShrub merged commit 03096be into community-shaders:dev Jun 2, 2026
11 checks passed
@Dlizzio Dlizzio deleted the Rounded-Button-Highlight branch June 3, 2026 11:00
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.

2 participants