[PR #12092] [MERGED] Add adjustOpacity action #28835

Open
opened 2026-01-31 09:31:05 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/12092
Author: @zadjii-msft
Created: 1/5/2022
Status: ✅ Merged
Merged: 1/12/2022
Merged by: @undefined

Base: main ← Head: dev/migrie/f/11205-adjustOpacity


📝 Commits (10+)

  • 43ec102 blindly make control settings read-only, there's only 2 build breaks?
  • dad065e make this a macro in case we want to reuse this
  • 981d8cc This is a crazy idea but if it works, it'll be a game changer
  • d6989ec this is wild
  • 4b18bb4 missed one
  • 7fc2f10 move to a common header
  • c7536ed This says there's only one build error in Terminal.Control.Lib but that can't be right
  • c26dd6b This works better than it has any business doing. Plemty of bugs, but a good enough start
  • 4a1baf0 I think I needed this to get it to build. Or I started breaknig something. Idk, I wrote this a few days ago, I just need this clone for testing so git commit
  • fbba74e I think we're going to have to cut this

📊 Changes

18 files changed (+224 additions, -16 deletions)

View changed files

📝 doc/cascadia/profiles.schema.json (+32 -0)
📝 src/cascadia/LocalTests_TerminalApp/TabTests.cpp (+3 -3)
📝 src/cascadia/TerminalApp/ActionPreviewHandlers.cpp (+31 -5)
📝 src/cascadia/TerminalApp/AppActionHandlers.cpp (+15 -0)
📝 src/cascadia/TerminalApp/TerminalPage.h (+2 -1)
📝 src/cascadia/TerminalControl/ControlCore.cpp (+27 -4)
📝 src/cascadia/TerminalControl/ControlCore.h (+3 -0)
📝 src/cascadia/TerminalControl/ControlCore.idl (+2 -0)
📝 src/cascadia/TerminalControl/TermControl.cpp (+14 -1)
📝 src/cascadia/TerminalControl/TermControl.h (+5 -0)
📝 src/cascadia/TerminalControl/TermControl.idl (+9 -0)
📝 src/cascadia/TerminalSettingsModel/ActionAndArgs.cpp (+2 -0)
📝 src/cascadia/TerminalSettingsModel/ActionArgs.cpp (+32 -0)
📝 src/cascadia/TerminalSettingsModel/ActionArgs.h (+10 -0)
📝 src/cascadia/TerminalSettingsModel/ActionArgs.idl (+7 -0)
📝 src/cascadia/TerminalSettingsModel/AllShortcutActions.h (+3 -1)
📝 src/cascadia/TerminalSettingsModel/Resources/en-US/Resources.resw (+15 -0)
📝 src/cascadia/TerminalSettingsModel/defaults.json (+12 -1)

📄 Description

Adds an action which can be used to change the opacity at runtime. This is a follow up to some of the other work I had been doing around opacity and settings previewing at the end of the year.

edit: pseudo-spec

  • adjustOpacity:
    • "opacity": (required) an integer number to set the opacity to.
    • "relative": (defaults to true)
      • If false, set the opacity to the given value, which should be between [0, 100].
      • If true, then use opacity as a relative adjustment to the current opacity. So the implementation would get the current opacity for this pane, then add this action's opacity to that value. Should be between [-100, 100]

This would allow both setting exactly 25% opacity with an action, and binding an action that increases/decreases the opacity one {amount}

It's preview-able too, which is neat.

adjust-opacity-preview-001


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/12092 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 1/5/2022 **Status:** ✅ Merged **Merged:** 1/12/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/migrie/f/11205-adjustOpacity` --- ### 📝 Commits (10+) - [`43ec102`](https://github.com/microsoft/terminal/commit/43ec102343539314b8be3f073b646a4919fe925e) blindly make control settings read-only, there's only 2 build breaks? - [`dad065e`](https://github.com/microsoft/terminal/commit/dad065e0feb8d91bef1c34cc1dae170af317d89d) make this a macro in case we want to reuse this - [`981d8cc`](https://github.com/microsoft/terminal/commit/981d8cc9c81e877a5010c6516f7aa3f63a00b5f5) This is a crazy idea but if it works, it'll be a game changer - [`d6989ec`](https://github.com/microsoft/terminal/commit/d6989ec9d13e67d4c68dec6d7b3e093680febb8a) this is wild - [`4b18bb4`](https://github.com/microsoft/terminal/commit/4b18bb415e925c3fec7805335ba83232e4c6c3ba) missed one - [`7fc2f10`](https://github.com/microsoft/terminal/commit/7fc2f10bbdc5a42bf174e42aaa892d493fa2968a) move to a common header - [`c7536ed`](https://github.com/microsoft/terminal/commit/c7536edfa8789adaeb2af55d65c045cfbe8a3704) This says there's only one build error in Terminal.Control.Lib but that can't be right - [`c26dd6b`](https://github.com/microsoft/terminal/commit/c26dd6b1db29dbd680b6bf8b343b3f7011f2d06a) This works better than it has any business doing. Plemty of bugs, but a good enough start - [`4a1baf0`](https://github.com/microsoft/terminal/commit/4a1baf000607dde5caf6802e5af7a3296bf9db97) I think I needed this to get it to build. Or I started breaknig something. Idk, I wrote this a few days ago, I just need this clone for testing so `git commit` - [`fbba74e`](https://github.com/microsoft/terminal/commit/fbba74e89b16465a66318b5b4b43545a88d74d45) I think we're going to have to cut this ### 📊 Changes **18 files changed** (+224 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `doc/cascadia/profiles.schema.json` (+32 -0) 📝 `src/cascadia/LocalTests_TerminalApp/TabTests.cpp` (+3 -3) 📝 `src/cascadia/TerminalApp/ActionPreviewHandlers.cpp` (+31 -5) 📝 `src/cascadia/TerminalApp/AppActionHandlers.cpp` (+15 -0) 📝 `src/cascadia/TerminalApp/TerminalPage.h` (+2 -1) 📝 `src/cascadia/TerminalControl/ControlCore.cpp` (+27 -4) 📝 `src/cascadia/TerminalControl/ControlCore.h` (+3 -0) 📝 `src/cascadia/TerminalControl/ControlCore.idl` (+2 -0) 📝 `src/cascadia/TerminalControl/TermControl.cpp` (+14 -1) 📝 `src/cascadia/TerminalControl/TermControl.h` (+5 -0) 📝 `src/cascadia/TerminalControl/TermControl.idl` (+9 -0) 📝 `src/cascadia/TerminalSettingsModel/ActionAndArgs.cpp` (+2 -0) 📝 `src/cascadia/TerminalSettingsModel/ActionArgs.cpp` (+32 -0) 📝 `src/cascadia/TerminalSettingsModel/ActionArgs.h` (+10 -0) 📝 `src/cascadia/TerminalSettingsModel/ActionArgs.idl` (+7 -0) 📝 `src/cascadia/TerminalSettingsModel/AllShortcutActions.h` (+3 -1) 📝 `src/cascadia/TerminalSettingsModel/Resources/en-US/Resources.resw` (+15 -0) 📝 `src/cascadia/TerminalSettingsModel/defaults.json` (+12 -1) </details> ### 📄 Description Adds an action which can be used to change the opacity at runtime. This is a follow up to some of the other work I had been doing around opacity and settings previewing at the end of the year. > edit: pseudo-spec > > * `adjustOpacity`: > * `"opacity"`: (**required**) an integer number to set the opacity to. > * `"relative"`: (defaults to `true`) > * If false, set the opacity to the given value, which should be between [0, 100]. > * If true, then use `opacity` as a relative adjustment to the current opacity. So the implementation would get the current opacity for this pane, then add this action's opacity to that value. Should be between [-100, 100] > > This would allow both setting exactly 25% opacity with an action, and binding an action that increases/decreases the opacity one {amount} It's preview-able too, which is neat. ![adjust-opacity-preview-001](https://user-images.githubusercontent.com/18356694/140785805-5eecf6ec-0933-40e4-bcba-41b88d25b6a8.gif) * [x] Closes #11205 * [x] I work here * [x] Docs updated: https://github.com/MicrosoftDocs/terminal/pull/477 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:31:05 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#28835