Repository navigation
Fix some smaller broadcast bugs #15993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
49f967a
53a6e73
07342f5
2d8aa85
e66f904
8cdd3f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,12 @@ import "ControlCore.idl"; | |
| namespace Microsoft.Terminal.Control | ||
| { | ||
|
|
||
| enum CursorDisplayState | ||
| { | ||
| Default, | ||
| Shown | ||
| }; | ||
|
Comment on lines
+15
to
+19
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will there be more states or will this remain a boolean? In case of the latter, I think some code can be expressed more elegantly with a boolean like control.CursorVisibility(
activated
? Microsoft::Terminal::Control::CursorDisplayState::Shown
: Microsoft::Terminal::Control::CursorDisplayState::Default
);vs. control.HideCursorOnBlur(!activated);There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (a half real suggestion that is somewhat relevant) you could also use the Visibility from XAML, if you want. EDIT: personally I think an enum is easier to read. I think the double negative in
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah I see... It's because I read it as "Hide Cursor On Blur if not activated".
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea, When we "specced" this in Teams chat, we also left in a I've kinda weirdly gotten attached to binary enums as bool values, just cause then the arg literally says what the value means, rather than having to look up what
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But would it make sense to still rename it a bit to make it more obvious what it means? We have more cursor visibility states than this one after all (like blinking visibility, IME visibility, VT visibility, etc.) and the naming clashes with those IMO. I'll approve it in the meantime, but maybe this is something to still noodle about. ^^ |
||
|
|
||
| [default_interface] runtimeclass TermControl : Windows.UI.Xaml.Controls.UserControl, | ||
| IDirectKeyListener, | ||
| IMouseWheelListener, | ||
|
|
@@ -121,7 +127,7 @@ namespace Microsoft.Terminal.Control | |
| // opacity set by the settings should call this instead. | ||
| Double BackgroundOpacity { get; }; | ||
|
|
||
| Boolean DisplayCursorWhileBlurred; | ||
| CursorDisplayState CursorVisibility; | ||
|
|
||
| Windows.UI.Xaml.Media.Brush BackgroundBrush { get; }; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any value to keeping around
_displayCursorWhileBlurred? We could replace any call with this check tbh.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally think the function name is more descriptive than either of the two parts. "cursor visibility" for instance initially confused me because I though it controls the general visibility of the cursor but actually it controls whether it gets hidden on blur. The enum itself is also longer than the function name.