Ticket #4184 (new enhancement)

Opened 9 months ago

Last modified 9 months ago

[patch] WindowCascade action

Reported by: psprint Owned by:
Priority: major Milestone: Future Releases
Component: mcedit Version: master
Keywords: windows,cascade Cc:
Blocked By: Blocking: #4185, #4186
Branch state: no branch Votes for changeset:

Description

Hi!
I've implemented the main part of the requested non-fullscreen mode startup (see post).

The patch is fairly simple. It just:

  • registers the command in keybind.h/.c/*-defaults.c/mc.default.keymap,
  • then adds the case for it in editwidget.c,
  • and also a function + a helper function in the same file to implement it.

The implementation is a simple loop that arranges the windows in cascade arrangement. It's somewhat intelligent as it gradually lowers the shift between windows as seen in the asciicast.

Attachments

WindowCascade.patch (4.4 KB) - added by psprint 9 months ago.
WindowCascadeTiled___-w_-T_opts___menus___man_doc.patch (9.5 KB) - added by psprint 9 months ago.
WindowCascadeTiled__-w_-T_opts__menus__man_doc.patch (10.0 KB) - added by psprint 9 months ago.

Change History

Changed 9 months ago by psprint

comment:1 Changed 9 months ago by psprint

  • Blocking 4185 added

comment:2 Changed 9 months ago by psprint

  • Blocking 4186 added

comment:3 follow-up: ↓ 4 Changed 9 months ago by psprint

Following comment:2:ticket:4186 I've merged the ticket:4185-4186 's into this one. Patch is attached. I've also:

  • added man documentation of -w/--cascade -T/--tile options,
  • extended Window menu with the two arrangement commands,
  • wrapped the options structures extension with #ifdef USE_INTERNAL_EDIT.

IMO -w is a very good option – it's read as "-w(indowed)". All other possible options like -c, -C are already taken, so the -w is quite a lucky last resort.

It would be difficult to add options just for mcedit as the code doesn't have such option-palette (like e.g.: --help-terminal). Plus the fact that mc has the option -e which basically works like the mcedit symlink – so it has sense to include -w/-T in general options.

comment:4 in reply to: ↑ 3 Changed 9 months ago by andrew_b

Replying to psprint:

IMO -w is a very good option – it's read as "-w(indowed)".

"windowed" != "cascade"

Why misc/mc.default.emacs is ignored?

Reduce variable scope as much as possible.

comment:5 Changed 9 months ago by psprint

For me -w seems natural for the cascade view… But I'm not going to cling on it, if you have better idea.

I'm attaching a patch with:

  • mc.default.emacs extended with the two actions,
  • WRect moved to the inner block (are there any other variable scopes that you've meant to limited?)
  • some comments added.

Changed 9 months ago by psprint

Note: See TracTickets for help on using tickets.