Repository navigation
topbar: allow pinning the Start button to the far left corner - #181
Open
cute-johnny wants to merge 1 commit into
Open
cute-johnny wants to merge 1 commit into
cute-johnny wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a "Start button on the left" (
start_left) toggle totopbarso the Windows / Start button can sit maximally to the left (flush against the bottom-left screen corner), while moving the Bar settings gear icon immediately to its right and opening the Start menu flyout on the left side.Motivation
⚙️) occupies the far-left corner of the bar, and the Windows / Start button sits to the right of Search and Task View (either centered, or after Gear + Search + Task View when "Buttons on the left, like Windows 10" is enabled).Kind::Start) always opened centered at(sw - w) / 2even when Start or the buttons were on the left.Changes
1. Persistent setting (
common/src/style.rs)start_left()andset_start_left(bool)backed by%ProgramData%\WinRust\start-left.txt(same caching and 1-second refresh pattern asalign_left()).start_lefttofalseinreset_all().2. Bar settings UI (
plugins/topbar/src/settings.rs)relook(...)condition accordingly.3. Layout, hit-testing, painting & anchors (
plugins/topbar/src/main.rs)Layoutwithgear_x,start_x, and a sharedLayout::btn_pos(i)helper used acrosspaint(),paint_vert(),min_rect(), andtip_cx().start_left()is off (default): behavior and pixel coordinates are completely unchanged.start_left()is on:BTNS[0]) is placed at the far left (sc(GEAR_X.0)), and hit-testing coversx < l.start_x + l.bwso clicking the extreme corner pixel (x = 0) triggers Start.⚙️) shifts immediately to the right of Start (start_x + bw + gap).left_min = gear_x + sc(GEAR_X.1 + 6)) and stays centered by default (or follows immediately after Gear whenalign_left()is also enabled).paint_vert), tooltips, right-click /Win+Xmenu anchoring (tip_cx), and window minimize animations (min_rect).4. Start menu flyout position (
plugins/topbar/src/fly.rs)Kind::Starthorizontal positioning from(sw - w) / 2tosc(8)(matching the standard 8px screen margin) wheneverstart_left()oralign_left()is enabled, so the Start menu opens directly above the left-side Start button instead of the center of the screen.Verification
cargo test -p winrust-common— 23 passed, 0 failedcargo test -p topbar— 14 passed, 0 failedcargo build -p topbar --release— compiled cleanly with zero warnings