Skip to content
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

[Bug]: When the ButtonSpecs are left aligned the System Menu icon does not react to the click event any more. #646

Closed
Smurf-IV opened this issue Feb 13, 2022 · 10 comments
Labels
awaiting feedback A fix for this issue has been implemented, waiting for feedback on the fix. bug Something isn't working
Milestone

Comments

@Smurf-IV
Copy link
Member

Smurf-IV commented Feb 13, 2022

From the investigations of #641:
When the ButtonSpecs are "left aligned" the System Menu icon does not react to the click event any more.

ALT+SPACE does popup the system menu though.

Edit: Right click also pop's up the system menu

@Smurf-IV Smurf-IV added bug Something isn't working under investigation This bug/issue is currently under investigation. labels Feb 13, 2022
@Smurf-IV Smurf-IV self-assigned this Feb 13, 2022
@Smurf-IV
Copy link
Member Author

thoughts on this possible solutions ....

  1. The ButtonSpec left forces the application icon (and then the app title) to be shifted.
    This prevents the default OS Window click handler to detect the button click on the icon area, and does nothing.
    This doe not look right.
    But thee might be a way of detecting this state, and then detecting the click in the icon (If visible) and then simulating the system menu, this would probably go wrong for windows with different OS themes, and scales and then the Krypton them applied over the top !

  2. Do not shift the App Icon (Or the app title), but place the Left shifted ButtonSpecs next to the title
    Requires a lot of fiddling due to space constraints, and the length of the title, and could lead to ugly layouts in constrained (Resized to small) Form header areas.

  3. Split the Icon and App titles, so that the ButtonsSpecs sit next to the Icon and before the app title
    Needs a lot of layout code re-jigging, but would allow the menu to operate as expected.

As RTL is broken in Krypton, then any changes to the above will probably break RTL even more !
Any changes from the above will need to work in the designer.

Thoughts ?

@Smurf-IV Smurf-IV added the awaiting feedback A fix for this issue has been implemented, waiting for feedback on the fix. label Feb 13, 2022
@giduac
Copy link
Contributor

giduac commented Feb 13, 2022

That could be combined with this request #640

A possible KForm standard that separates the title from the icon and lets title be left/center/right aligned.

For example center the Title:
Leave the system menu icon on it's default spot
add (left aligned) ButtonSpecs right next to the sysmenu icon

.....

@giduac
Copy link
Contributor

giduac commented Feb 13, 2022

Title should respect the boundaries created by adding ButtonSpecs to the form when being aligned
So it doesn't interfere with the buttons and remains visible
......

@Smurf-IV
Copy link
Member Author

So it doesn't interfere with the buttons and remains visible ......

I'm confused.. What does this mean ?

@Smurf-IV
Copy link
Member Author

I have been able to implement option 1; and it looks like this:

LeftAlignedButtonSpec

Smurf-IV added a commit to Krypton-Suite/Standard-Toolkit-Demos that referenced this issue Feb 13, 2022
Smurf-IV added a commit that referenced this issue Feb 13, 2022
… left aligned

- ClearUp some value naming
- Add missing `GetSystemMenu`
Resolves: #646
@Smurf-IV Smurf-IV removed their assignment Feb 13, 2022
@Smurf-IV Smurf-IV removed the under investigation This bug/issue is currently under investigation. label Feb 13, 2022
@Smurf-IV Smurf-IV added this to the April 2022 milestone Feb 13, 2022
@giduac
Copy link
Contributor

giduac commented Feb 13, 2022

@Smurf-IV

What I had in mind (just thinking):
image

Looking a bit further.

If this is layout like above.
And the last buttonspec has text/extratext set
Then that would look like it was part of the form title

Personally I think the system belongs in the left corner. It's a very standard thing.
The connected double-click to close the program.

The user can easily mistake this, hit the buttonspec and start an undesired action at that point.

Might be better to ponder a bit longer over this.
For me at this point I would keep buttonspecs always right aligned

@Smurf-IV
Copy link
Member Author

@giduac Correct, Please put the whole of the above into a feature request, and reference here.

@giduac
Copy link
Contributor

giduac commented Feb 14, 2022

@Smurf-IV
I'm having a couple of other ideas about this.
Think it will be worked out by the end of the week.

@Smurf-IV
Copy link
Member Author

Great, and thanks for the feedback,
BTW the layout is also used for mdi forms so has to work in that area as well.
And whatever "we" come up with also has t be compatible with the Ribbon overlays (In their various guises)

@giduac
Copy link
Contributor

giduac commented Feb 16, 2022

Hi (@Smurf-IV @Wagnerp )

Before creating a feature request discussing this a little further here.

Findings:
MDI (sample program attached. Needs restoring packages)

The sample program can both add Kform and standard form as child windows. Which clearly shows the differences.

  • It has an RTL Toggle option (to have a look at this)
  • An option to test all the FormBorderStyle variants on the child windows
  • Keyboard combo ALT+- (dash) does invoke the system menu on main and child windows

Nightly .43 (without system menu fix and title alignement)

  • left aligned buttonspec
  • system menu on the main window does not react to click and double click
  • child window's system menu does react to click and double click
  • no left aligned button spec
  • both windows have a fully functional system menu

Nightly .45/.46 (with system menu fix)

  • left aligned buttonspec
  • system menu on the main window does not react to double click
  • child window's system menu does not react to click and double click
  • no left aligned button spec
  • system menu on the main window does not react to double click
  • both window's system menu does not react to click and double click

Ribbon

Nightly .43 (without system menu fix and title alignment)

  • App Button visible or not makes no difference
  • AllowFormIntegrate True or False makes no difference
  • The system menu is moved to the right of the QAT Toolbar. The menu does not react to click and double click
  • Double click on the App Button closes the program

Nightly .45/.46 (with system menu fix)

  • App Button visible or not makes no difference
  • AllowFormIntegrate True or False makes no difference
  • The system menu is moved to the right of the QAT Toolbar. The menu does not react to double click
  • Double click on the App Button closes the program

Proposal

System menu always in the outer-left corner (also with RTL == YES)
Removes the need to fix the click and double click events
Will be a change to devs that now have left aligned ButtonSpecs (how to deal with this)?
Looks like nobody hardly ever used left aligned ButtonSpecs. At least one or two should've ran in to the defunct system menu.

ButtonSpecs with left alignment: Aligned right to the system menu icon

Form Title placement (already implemented: FormTitleAlign | since nightly .45)
side note: RTL = Yes, in a standard form aligns the System menu left and the title right.

Doing it like this would add flexibility.
If the Buttonspec needs text/extra (that could interfere with the buttonspec text/extratext) the decision is left to the developer and leaves the option open to others.

If the title is left aligned: It should appear at the first possible position next to the last left aligned Buttonspec.

Also has to be compatible with the Ribbon overlays (In their various guises). How does the above behave in a Ribbon overlay / non overlay / Dynamic overlay (user controlled)

Options:

  • When the system is left aligned (on it's default spot) The App button when visible would cover it
  • Other apps like Windows Explorer in W10 / WordPad have no App Button and the system menu in the left corner.
  • Not all themes support the KRibbon to be moved onto the title bar or inhibit displaying the App Button.

**3-3-2022 Added: **

Tested with Nightly .62
With(out) buttonspecs: since the fix was introduced for the click event the double-click on the form-icon does not work any more.

MdiApp1.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting feedback A fix for this issue has been implemented, waiting for feedback on the fix. bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants