New mod: OmniButton Customizer v1.0#3859
Conversation
|
This version should be much more agreeable. |
|
I see that the code is similar to #3932 which I reviewed. Please apply my comments here too, let me know when it's ready for review. |
|
Updated to v1.4 with the review comments applied (same changes as #3932):
Also included since the last review:
|
| // Use default offset. | ||
| #else | ||
| #error "Unsupported architecture" | ||
| #endif |
There was a problem hiding this comment.
Please use the same code as can be found here:
https://github.com/m417z/my-windhawk-mods/blob/e1261d85c2f42006b0dc355fbbc3a8d71a078585/mods/taskbar-multirow.wh.cpp#L261-L291
In this mod and your other mod.
| if (WaitForSingleObject(stopEvent, 2000) != WAIT_TIMEOUT) break; | ||
| if (g_omniStackPanel || g_unloading) break; | ||
| Wh_Log(L"[AfterInit] Retry %d — XAML not yet applied", i + 1); | ||
| ApplyAllSettingsOnWindowThread(); |
There was a problem hiding this comment.
The mod already hooks IconView::IconView, so why is this thread needed?
|
|
||
| static void FlipBatteryLayout(FrameworkElement const& batteryCP) { | ||
| if (!WalkBatteryTree(batteryCP, 0)) | ||
| Wh_Log(L"[Battery4] No inner StackPanel found (% may not be in tree yet)"); |
| with the Windows 11 Taskbar Styler out of the box — no special settings required. | ||
|
|
||
| For basic vertical stacking without battery percentage, paste [style.yaml](https://github.com/sb4ssman/Windhawk-Vertical-OmniButton/blob/main/style.yaml) | ||
| into Windows 11 Taskbar Styler → Settings → Advanced. |
There was a problem hiding this comment.
| into Windows 11 Taskbar Styler → Settings → Advanced. | |
| into Windows 11 Taskbar Styler → Settings → Textual mode. |
|
|
||
| iconView.Loaded([](IInspectable const&, RoutedEventArgs const&) { | ||
| if (!g_unloading && !g_omniStackPanel) | ||
| ApplyAllSettings(); |
There was a problem hiding this comment.
Unsubscribe after handling, otherwise the callback might be called again when the mod is unloaded, causing a crash. There's an example below, but if you prefer something simpler, allocate memory for the revoke token, assign it from iconView.Loaded, pass the pointer to the lambda, and unsubscribe when it's called.
windhawk-mods/mods/taskbar-tray-system-icon-tweaks.wh.cpp
Lines 1321 to 1331 in a5fb564
|
@m417z Vertical-omnibutton was the first pass at this; in the interim I built a more comprehensive replacement (omnibutton-customizer) that covers vertical as one configuration of a full grid layout, adds per-element nudging, item reordering, and fill-order control among other details. I'd like to close this PR and submit omnibutton-customizer instead as the single OmniButton mod. Do you have any concerns with that, may I just close it and submit? |
|
No concerns, go ahead. Alternatively, you can update this PR, whatever you prefer. |
c07e595 to
b523971
Compare
b523971 to
b7beff8
Compare
|
Closing in favor of #4855, which submits OmniButton Customizer v1.0 on a correctly named branch with a clean thread. Same code, same file ( |
Adds OmniButton Customizer (v1.0): gives independent layout and appearance control over every native Windows 11 OmniButton item — wifi, volume, battery, and battery percentage — for both standard and multi-row taskbars.
This supersedes the narrower Vertical OmniButton implementation previously proposed in this PR. Vertical layout remains available as one configuration of the full customizer.
Highlights:
itemOrderlist or omit tokens to hide individual items. Items unavailable on the current system are skipped.ControlCenterButton, Quick Settings behavior, and tray ordering. Exact original XAML dependency-property values are restored on settings changes and unload.Screenshots (also embedded in the mod readme):
Tested live on Windows 11: default compact 2×2, reordered single-row and tall vertical layouts, independent and coupled battery/percentage, per-item optical nudges, a busy multi-row tray alongside other mods, settings reload, Explorer restart, Quick Settings interaction, and disable/native restoration/re-enable.
Changelog
If this pull request updates an existing mod, describe the changes below:
Mod authorship
If this pull request introduces a new mod, please complete the section below.
This mod was created by:
Please select the options that best apply. Your selection does not affect the acceptance criteria, but it helps reviewers understand the context of the code and provide relevant feedback.