Repository navigation
Classic menu: a Pinned programs item, with rows per column - #2586
Open
emilioheredia-source wants to merge 6 commits into
Open
emilioheredia-source wants to merge 6 commits into
emilioheredia-source wants to merge 6 commits into
Conversation
Every column break now starts a column. The last one still starts the second pane, and earlier ones add columns to the first pane, so a menu with one break looks exactly as before. The Windows 7 style keeps using only its first break. A new setting on the Menu Look tab, Second pane look, picks which column gets the skin's second-pane look: the last column (the default, as before), none (all columns alike), or the first column, drawn on the left. For the first column the background is drawn as usual and then mirrored, so the skin's outer borders stay on the outside; emblems, the user picture and the user name are placed in their pane afterwards. What had to change for that, since the layout assumed column 0 and column 1 in many places: each pane's width is the sum of its columns, items are offset from their own pane's content rectangle, every column is aligned to the bottom on its own (COLUMN_PADDING), and the columns inside a pane get the skin's vertical separators like sub-menu columns do. The icon size of an item, which AddStandardItems picks before the layout, follows the same panes: until now every item after the first column break got the second pane's icon size, so a middle column lost its icons with skins that hide them in the second pane. The pager scrolls the first column, where the pinned programs are, and until now it used the whole first pane for that, which was the same thing. With more columns it is not: the arrows were drawn in the middle of the pane, and hovering or clicking at the top or bottom of any column of the pane hit the pager. GetScrollRect gives the pager its own column. With Second pane look = First that column is in the second pane, whose items can draw composited text (their own opacity setting). Composited text ignores the clip rectangle, so the pager also checks those items before it draws its background again over the spilled text.
The scroll range for touch, hover, keyboard and wheel scrolling was still measured from the top of the first pane (m_rContent). With Second pane look = First column the pinned programs are in the second pane, whose top can be at another height, depending on the skin's padding, so the last pinned program could be cut off or followed by a gap. It now comes from GetScrollRect, like the rest of the pager. With Immersive both panes start at the same height, so the screenshots in this PR don't change.
A drop on empty space adds the program to the pinned programs. It was measured against the first pane (m_rContent), which until now was the same as their column. With more columns, a drop on empty space in another column of the first pane pinned the program too, and with Second pane look = First column a drop in the pinned programs' own column did nothing. It now uses GetScrollRect, like the pager. The pager's scroll range was the same expression in six places; GetScrollRange now gives it once.
This was referenced Nov 15, 2026
…elpers Behavior is unchanged. InitWindowInternal and HitTest are long upstream functions, so the new code they needed now lives in two helpers instead of growing them: GetColumnBottomShifts works out how far each column's bottom-aligned items move, and IsInScrollColumn tells whether a point is in the column the pager scrolls.
…r column Until now the pinned programs always lead the first column of the main menu. A new item, Pinned programs (pinned_programs, Classic two-column style only), puts them where it is in the menu: after a column break it gives them a column of their own, next to the places, for example. The pinned programs stay at the start of the item list (0..m_ScrollCount) because the pager, painting, keyboard and drag and drop rely on that. Only the layout order changes: GetLayoutOrder lays out the items configured before the Pinned programs item first, then the pinned programs and their separator, then the rest. MovePinnedPadding keeps a leading COLUMN_PADDING with the items it belongs to. The item has a Rows per column setting in the item editor (Item.Rows, 0 = no limit). After that many rows the list continues in the next column, aligned under its first row: SetOverflowBreaks marks those breaks as overflow breaks, which start a column in the same pane and never move the boundary between the panes. One list and one order, so drag and drop works as before. The pager follows the pinned programs to their column (GetScrollColumn), including its pane and its skin settings. Restore Defaults in the item editor also clears the rows.
emilioheredia-source
force-pushed
the
pinned-programs
branch
from
November 15, 2026 18:44
02ec52d to
651880a
Compare
emilioheredia-source
added a commit
to emilioheredia-source/Open-Shell-Menu
that referenced
this pull request
Nov 15, 2026
A drop on empty space pins the program only in the column of the pinned programs (Open-Shell#2580), and a drop on the padding below them is measured against that column too, not column 0 (Open-Shell#2586).
AddStandardItems puts a separator between the pinned programs and the items that follow them, because in the default menu they share a column. With a Pinned Programs item the user places the pinned programs and everything around them, so that separator is no longer needed, and when a list follows in the same column it pushes the rows below it out of line with the column next to it. The separator now gets no height when a Pinned Programs item places the pinned programs. The item stays, so the bottom alignment it carries for COLUMN_PADDING and the pager's use of it are unchanged. A SEPARATOR item after the Pinned Programs item still draws a line. Menus without a Pinned Programs item are unchanged.
This branch has not been deployed
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.
This is 2 of 5 of the column work from #2544:
This PR builds on #2580, which isn't merged yet, so GitHub also lists #2580's commits here. This PR's own changes are the last two commits, Let the Classic two-column menu place its pinned programs, in rows per column and Pinned Programs item: no automatic separator after the pinned programs. Once #2580 is in, I'll rebase this so only those two remain.
Where this is going. Not this PR: this needs all five. This PR puts the pinned programs in a place of their own and lets them continue in the next column; the recent list in its own column, the headings and the column lines come with PRs 3 to 5 (example programs, pinned and recent):
What this PR does on its own
Today the pinned programs always lead the first column of the Classic two-column menu. A new item, Pinned programs, puts them where it is in the menu, for example in a column of their own after a column break. Without the item nothing changes.
The item has a Rows per column setting in its editor (
PinnedProgramsItem.Rows, empty or 0 for no limit). After that many rows the list continues in the next column, lined up under its first row. It is still one list in one order, so pinning, unpinning and reordering by drag and drop work as before, also across its columns.With the item, the separator that the menu adds after the pinned programs is not drawn. In the default arrangement it divides them from the items below; with the item the user places everything, and that separator pushed whatever follows in the same column out of line with the column next to it. A Separator item after the Pinned programs item still draws a line where one is wanted.
The same 18 pinned programs, before and after: on the left Open-Shell's default arrangement, then the places in the first column and the Pinned programs item after a column break, with 9 rows per column. The middle one also uses Second pane look = First column from #2580.
How it works: the pinned programs stay at the start of the item list, because the pager, painting, keyboard and drag and drop rely on that, and only the layout order changes (
GetLayoutOrder). The breaks that Rows per column adds are marked as overflow breaks: they start a column in the same pane and never move the boundary between the panes. The pager follows the pinned programs to their column, including its pane and its skin settings, and so does a drop on the empty space below them.One thing to know: when the pinned programs are to the right of Programs, its sub-menu opens over them, so dragging a program from it into the pinned list is awkward. Pin to Start menu (Open-Shell) on the right-click menu, or dragging from the desktop or a folder, works as usual.
Trying it
The zip has the three settings files used for the screenshots: Settings, Backup → Load from XML file. Loading one replaces all your settings, so save yours first with Backup → Save to XML file. They use the default menu's items, the Immersive skin with icons in the second pane, and recent programs off; the pinned programs are your own.
pinned-before.xmlis the default arrangement,pinned-after.xmlandpinned-after-last.xmlhave the Pinned programs item with 9 rows per column.settings-examples.zip
Tested
On Windows 11 26H2 (26300), x64, with the Immersive skin:
The screenshots were taken with #2575 applied too, so the pinned Store apps show their icons.