Skip to content

Add auto-hide option to toolbars#315

Merged
RyeMutt merged 1 commit into
AlchemyViewer:developfrom
gwigz:gwigz/toolbar-auto-hide
Jun 15, 2026
Merged

Add auto-hide option to toolbars#315
RyeMutt merged 1 commit into
AlchemyViewer:developfrom
gwigz:gwigz/toolbar-auto-hide

Conversation

@gwigz

@gwigz gwigz commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Toggled per edge (left/right/bottom/top) via the toolbar context menu, backed by the AlchemyToolbarAutoHide{Left,Right,Bottom,Top} settings (default off).

Skips rendering while completely hidden.

CleanShot.2026-06-14.at.9.00.47.mp4

Port the auto-hide toolbar feature: each toolbar edge can slide out of
view, leaving a small hover hot zone that reveals it again. Toggled per
edge (left/right/bottom/top) via the toolbar context menu, backed by the
AlchemyToolbarAutoHide{Left,Right,Bottom,Top} settings (default off).

Adapted for Alchemy: covers the extra top toolbar, and reuses the
existing LLCenterLayoutPanel reshape -> setToolbarRect snap-rect path
(keeping the parent panel full-sized so floaters don't jump as the bar
slides) instead of porting the upstream reportReservedToolbarRect.

Toolbars stay fully revealed while the toybox (toolbar buttons) floater
is open or a button is being dragged, and a fully hidden toolbar stops
drawing its buttons.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Four persisted boolean settings (AlchemyToolbarAutoHideLeft/Right/Bottom/Top) are added to settings_alchemy.xml. lltoolbarview.h gains an AutoHideEdge struct and private helper declarations. lltoolbarview.cpp adds anonymous-namespace helpers, extends postBuild and draw(), and implements the slide animation using frame-timer interpolation and per-side hot-zone detection. The toolbar context menu exposes the four options as checkable items.

Changes

Toolbar Auto-Hide Slide Animation

Layer / File(s) Summary
Settings definitions and context menu UI
indra/newview/app_settings/settings_alchemy.xml, indra/newview/skins/default/xui/en/menu_toolbars.xml
Four persisted boolean settings (default 0) are added; four checkable "Auto-hide" menu items are inserted into the Toolbars Popup, each using ToggleControl/CheckControl wired to the matching setting.
AutoHideEdge struct and class declarations
indra/newview/lltoolbarview.h
Forward-declares LLLayoutPanel, introduces the AutoHideEdge state struct (panel pointer, full/visible dimensions, offset, last hover time), declares five new private helper methods, and adds the mAutoHideEdges array member.
Anonymous-namespace helpers and postBuild initialization
indra/newview/lltoolbarview.cpp
Adds llcriticaldamp.h include, defines constants and helper functions mapping toolbar locations to settings keys, computing slide-axis dimensions, and detecting forced-visibility conditions. Extends postBuild to assign mAutoHideEdges[*].panel for all four sides and seed full_dim/visible_dim.
draw() integration and core auto-hide logic
indra/newview/lltoolbarview.cpp
draw() now calls updateAutoHide() each frame, clears prior offsets, applies new offsets, and toggles parent panel and toolbar visibility via base_visible/fully_hidden. Implements getAutoHideEnabled, isMouseInRevealZone (per-side hot-zone geometry), updateAutoHide (frame-timer interpolation with linger), clearAutoHideOffset, and applyAutoHideOffset.

Sequence Diagram

sequenceDiagram
  participant User
  participant ContextMenu as Toolbars Popup Menu
  participant Settings as AlchemyToolbarAutoHide*
  participant draw as LLToolBarView::draw()
  participant updateAutoHide as updateAutoHide()
  participant LLLayoutPanel

  User->>ContextMenu: click "Auto-hide Left"
  ContextMenu->>Settings: ToggleControl AlchemyToolbarAutoHideLeft
  draw->>updateAutoHide: called each frame
  updateAutoHide->>Settings: getAutoHideEnabled(TOOLBAR_LEFT)
  Settings-->>updateAutoHide: true
  updateAutoHide->>updateAutoHide: isMouseInRevealZone check
  updateAutoHide->>updateAutoHide: interpolate visible_dim toward 0 (hidden)
  draw->>draw: applyAutoHideOffset(TOOLBAR_LEFT)
  draw->>LLLayoutPanel: setVisible(false) when fully_hidden
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 Hop along, the bars shall hide,
Tucked away until you glide,
A whisker's width from screen's near edge,
They spring back out upon the ledge!
Settings saved, the menu blessed—
Auto-hide puts toolbars to rest. ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The PR description is minimal and lacks the structured format specified in the template, missing key sections like detailed description, related issues link, and checklist completion. Add a structured description following the template format, including: (1) a detailed explanation of changes in the Description section, (2) the GitHub issue link in Related Issues, (3) completion of the checklist items with confirmation marks, and (4) any relevant screenshots/videos and additional notes.
✅ Passed checks (3 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly and concisely summarizes the main feature being added: an auto-hide option for toolbars.

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


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.

@gwigz gwigz changed the title Add auto-hide for toolbars Add auto-hide option to toolbars Jun 14, 2026
@RyeMutt RyeMutt added this to the NEXT milestone Jun 15, 2026
@RyeMutt RyeMutt merged commit 537160a into AlchemyViewer:develop Jun 15, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants