-
Notifications
You must be signed in to change notification settings - Fork 700
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
TGD: Master Issue tracking TG issues that must be fixed in v2 #3650
Comments
@tznind With this: ANY View is now draggable:
(Obviously if you want tiled, don't set the Overlapped flag) By default But |
WIth #2537 any view will be sizable too. |
My plan with #2537 is to leverage Same for dragging multiple views. |
Since the TGD as access to internal TG objects may be could have some kind of mechanism that allow TGD to enable drag and restore defaults when finish drag. |
There is a LOT of code in TGD to do this drag. Complex bits include:
It's probably a good 10% of the designer codebase. And it's heavily coupled to other bits of code like
Not saying we can't make it part of core, just that it's going to get complex fast 😀 but up for trying. Regarding internal, I think policy is to try and avoid. |
As previously discussed, we want to move away from having TGD have internal access. We should make these mechanisms public. Of course, we CAN do this over time, but I'd like to really try to make it happen before V2 release! |
How willing are you to migrate this code into TG as needed? |
I can try but it is going to be difficult. And not fast because of scale.
Designer basically has a complete parallel mouse handling system based on
global handler and hit detection.
|
My head's still not clear on this, but I'm now thinking the place to rally here is around We put it on The goal would be to enable TGD to minimize throwing away as much as that code as possible whilst leveraging the new architecture in TG V2. Just spitballing of course to get the juices flowing. This will be an interesting challenge. I'll repeat again: We don't ship V2 until TGD is amazing on it. |
Instead of adding a new |
I think we should split to 2 goals
The first will enable a polished use experience and full range of Views supported in TGD in relatively short period of time. The second is far more ambitious and will take longer. 1. Enable FrameView and Borders as simply as possibleI will have to refresh my memory on the exact issue with Borders and FrameView but I think it was around hit detection and the 'out of the box' FrameView being moveable. Probably can fix that in CreateSubControlDesign where it explicitly makes everything focusable we can just make everything immoveable and let the original TGD move code take over. There are already some Border related hacks that TGD applies in its extension version of /// <summary>
/// <para>
/// Sometimes <see cref="View.FindDeepestView"/> returns what the library considers
/// the clicked View rather than what the user would expect. For example clicking in
/// the <see cref="Border"/> area of a <see cref="View"/>.
/// </para>
/// <para>This works out what the real view is.</para>
/// </summary>
/// <param name="hit"></param>
/// <returns></returns>
public static View? UnpackHitView(this View? hit)
{
if (hit != null && hit.GetType().Name.Equals("TabRowView"))
{
hit = hit.SuperView;
}
// Translate clicks in the border as the real View being clicked
if (hit is Border b)
{
hit = b.Parent;
}
// TabView nesting of 'fake' views goes:
// TabView
// - TabViewRow
// - View (pane)
// - Border (note you need Parent not SuperView to find Border parent)
if (hit?.SuperView is TabView tv)
{
hit = tv;
}
return hit;
} 2. Migrate 'design' code from TGD to Terminal.GuiThis is the Design class which is at the core of TGD. It is how TGD distinguishes between Views the user created e.g. a We might start tackling this feature with a new namespace |
Fixes Window being core 'moveable' This goes considerable way to fixing: gui-cs/Terminal.Gui#3650 But can consider making the Arrangement property user configureable in the same way that we do with Visible (see TestSettingVisible_False) where user can change the value but it does not manifest in the behavior of the view (only for code gen).
…nt.Fixed` so user can still design it. Fixes gui-cs/Terminal.Gui#3650
Re:
Border:
Padding: Note that This is relevant because I don't think TGD needs to support the design of such things, but it DOES need to be aware. Instead of TGD having a special Right? |
Wow, I see a lot of issues in https://github.com/gui-cs/TerminalGuiDesigner/blob/v2/src/Design.cs that could be addressed with fixes in TG. Text - should be an attribute of a View somehow, not a hard-coded list in TGD: /// <summary>
/// View Types for which <see cref="View.Text"/> does not make sense as a user
/// configurable field (e.g. there is a Title field instead).
/// </summary>
private readonly HashSet<Type> excludeTextPropertyFor = new()
{ ALL Views have It is true that not all views need a Text property. Back in v1, we moved Would this allow you to simplify Defn of
|
FWIW, I plan on addressing the cray that led to this in |
I view any The only remaining examples of
|
Is there any reason this concept of If we were able to do that, there'd be no need for TGD to have carnal/internal knowledge of the various views in |
From #3490 which I'm now closing as a dupe of this: We should find all places in TGD where reflection is used to get to the internals of TG and open an Issue for each to address.
etc... |
FrameView
due to loss of draggability
I am not sure ignoring Adornments is exactly what is required. I think TGD can be smarter about it. Lets look at the use case. When you click somewhere TGD wants to work out what the most 'user meaningful' thing(s) there are in the click hierarchy. It does this by inspecting the hit and all the SuperViews: So when we right click the View in a TabView we will show:
Looking at the results of The only issue I think with Adornments is that they have var actualSuperView = v is IAdornment ? v.Parent : v.SuperView |
That sounds sensible, so that check for making The only thing to be careful about is inheritance where a subview decides it doesn't want Text to be supported but not a big deal. |
Being a 'container' determines whether the user is able to drag and drop other views into it. This covers the use case:
If user drags a View over a So we need to know by class what is designed to have stuff dropped into it at design time. But having an attribute
I don't think this is relevant to whether a view is a container. |
I agree, it will simplify code and also potentially allow design of user custom Views later in a consistent manner. One thing to be careful of is that TGD needs to robustly support the property that means:
We also need to decorate 'sub properties' not just those on the root TGD can then use reflection to step into the sub properties and identify those that can be designed. BackgroundThe current approach of explicitly listing in TGD the properties comes from stability point of view. It is important that TGD does not offer properties that then crash when you try to modify them or save/load them (code gen/compilation). For this reason I was very conservative about adding properties and only enabling them when there was adequate unit testing and manual testing for each property |
Via @tznind "we have lost support for the FrameView because drag/move doesn't work properly with it." here
gui-cs/TerminalGuiDesigner#189
May be same issue: "Borders are disabled for now I think too for same reason (they break click drag)"
The text was updated successfully, but these errors were encountered: