Skip to content

Recent Programs: Show as a list, with rows per column - #2587

Open
emilioheredia-source wants to merge 8 commits into
Open-Shell:masterfrom
emilioheredia-source:recent-list
Open

emilioheredia-source wants to merge 8 commits into
Open-Shell:masterfrom
emilioheredia-source:recent-list

Conversation

@emilioheredia-source

@emilioheredia-source emilioheredia-source commented Nov 15, 2026 •

Copy link
Copy Markdown

This is 3 of 5 of the column work from #2544:

# PR Builds on
1 More than two columns, and the Second pane look setting (#2580) master
2 A Pinned programs item, with rows per column (#2586) 1
3 Recent Programs: Show as a list, with rows per column (#2587, this PR) 2
4 A Heading item (a separator with a label) (#2588) master
5 Column lines, and the same width for all columns (#2589) 1

This PR builds on #2586, which builds on #2580. Neither is merged yet, so GitHub also lists their commits here. This PR's own changes are the last two commits, Recent Programs: Show as a list, with rows per column and Overflow columns of a second list in a column start level with the first list. Once they are in, I'll rebase this so only those two remain.

Where this is going. Not this PR: this needs all five. This PR lets the recent programs have a column of their own; the extra columns, the pinned list, the headings and the column lines come with the other PRs (example programs, pinned and recent):

end goal

What this PR does on its own

Today the recent programs either open as a sub-menu (the Recent Programs item) or, with the Recent programs setting, sit under the pinned programs at the top of the first column. The more of them there are, the taller that one column gets.

The Recent Programs item gets a new option in its editor, Show as a list (FLAT_LIST): the recent programs then appear as a list in the item's place instead of as a sub-menu, so they can go anywhere in the menu, for example in a column of their own after a column break. Rows per column from #2586 works for this list too: after that many rows it continues in the next column. Rows per column is greyed out unless Show as a list is checked, since a sub-menu has no rows. Without the option nothing changes.

The same 5 pinned and 8 recent programs. Before: the Recent programs setting puts them under the pinned programs, and the first column is twice as tall as the others. After: a Recent Programs item shown as a list, after a column break between the first column and the places.

Before (as today) After
before after

item editor

How it works:

  • The item is a placeholder, replaced by the recent programs once all other items are added (InsertRecentProgramLists), because GetRecentPrograms skips programs that are already in the main menu. Any Recent Programs item already turns off the recent programs that the setting adds (MENU_NORECENT), so they never show twice.
  • The list takes the icon size of the pane it is in.
  • With no column break between the Pinned programs item and the list, the list continues in the pinned programs' last column. Its overflow columns then start level with the first list in that column, not halfway down where the recent programs began.
  • Sorting by name or in reverse used to reorder only the first block of recent programs, in one column. Every block is sorted now, and each program takes a place the layout gave the list, so a list that runs over several columns keeps its shape.
  • GetRecentProgramCount and SetJumplistFlags are the code InitItems already had, moved into helpers so the list can use them too.

Trying it

The zip has the two 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. Both are #2580's three-column menu with recent programs on (8): recent-before.xml as it is, recent-after.xml with a Recent Programs item shown as a list after one more column break. The pinned and recent programs are your own.

settings-examples.zip

Tested

On Windows 11 26H2 (26300), x64, with the Immersive skin:

  • Without a list, the layout is the same as with Classic menu: a Pinned programs item, with rows per column #2586 alone: I logged every item's position from both builds on four menus (two columns, three columns, three with First column, and recent programs sorted by name and reversed) and the logs match.
  • By hand: 15 recent programs as a list with 8 rows per column (two columns); starting a program from it, Remove from this list, jump lists, and the keyboard across the list's columns. In the editor, Show as a list is saved, Rows per column greys out without it, and Restore Defaults clears both.
  • The list right after the Pinned programs item, with no column break and 10 rows per column for both: the list continues under the pinned programs and its next column starts at the top.
  • Not tested: a list inside a sub-menu.
  • The full rebuild has no errors or warnings.

The screenshots were taken with #2575 applied too, so the pinned Store apps show their icons.

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.
…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.
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.
The Recent Programs item can show the recent programs as a list in its
own place in the menu (Show as a list in the item editor, setting
FLAT_LIST), instead of as a sub-menu. In the Classic two-column menu
that puts the recent list wherever the user wants it, for example in a
column of its own after a column break, and Rows per column lets it
continue in the next column, like the Pinned programs item.

- The item is a placeholder, replaced once all other items are added
  (InsertRecentProgramLists), because GetRecentPrograms skips programs
  that are already in the main menu. Any Recent Programs item already
  turns off the recent programs that the RecentPrograms setting adds to
  the main menu (MENU_NORECENT), so they never show twice.
- The list takes the icon size of the pane it is in (IsInSecondPane).
- Sorting by name or in reverse used to reorder only the first block of
  recent programs, in one column. Every block is sorted now, and each
  program takes a place the layout gave the list, so a list that runs
  over several columns keeps its shape.
- Rows per column is enabled for the Recent Programs item only while
  Show as a list is checked, since a sub-menu has no rows.
- GetRecentProgramCount and SetJumplistFlags are the code InitItems
  already had, moved into helpers so the list can use them too.
…rst list

With no column break between the Pinned Programs item and a recent programs
list, the recent programs continue in the pinned programs' last column, after
the separator. Each list set the height its overflow columns start at, so the
recent list's next column started level with its own first item, halfway down,
leaving an empty band at the top. Now only the first list in a column sets
that height; a list with nothing above it in its column is unchanged.

This branch has not been deployed

No deployments
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.

1 participant