Author Topic: Editor layout options  (Read 3375 times)

Offline omnishambles

  • Multiple posting newcomer
  • *
  • Posts: 12
Editor layout options
« on: July 28, 2020, 05:14:49 pm »
Hi,

I've been using CB for a few weeks (20.03, Windows 10) and love it so far. In my learning phase I have some questions on the editor I haven't been able to answer.

1. Is it possible to maximise/restore an individual file tab? If you have a few files open and arranged around the editor pane you may want to temporarily maximise one to write some code then restore the layout when finished. Double clicking a file tab maximises the whole editor, but not the individual file.

2. Is it possible to save/reload the editor layout on demand? I.e. which files are open and the position/size of their tabs. Settings/Environment lets you restore the layout on startup, but if you switch between projects in the same session you don't want to have to close/restart CB. I've been working on a project with several files open and arranged, and it seems switching to another project would incur quite some work (open project2 and its files, arrange them, work, close project2, re-open project1, open and arrange files from scratch again because the layout wasn't stored).

3. (related to 2) While working on projectA I started a new project, created a couple of files and started working in them. However, the files from projectA were all still open. There were two main.c files, etc. It feels like each project should have its own editor pane, each with its own set of open files. Do I need to close all projectA files manually (and lose their layout)?

I've read the manual on Personalities and Perspectives but they're concerned with CB's UI which I don't need to change. Have I missed something else, or is it necessary to do the above in a manual way?

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Editor layout options
« Reply #1 on: July 28, 2020, 06:16:30 pm »
You can open two instances of Codeblocks and open a project in each.

Layout switching with project switch is not supported as far as i know. You can "fast" switch layout with View->Perspective

1) Create the layout for Project 1
2) Save the layout with View->Perspective->Save, name it Project 1
3) Create the layout for Project 2
4) Save the layout with View->Perspective->Save, name it Project 2

Now you can switch between the perspectives with View->Perspective->Project 1...
It would probably be easy to create a plugin that switches perspective automatically on project activation...

Quote
1. Is it possible to maximise/restore an individual file tab? If you have a few files open and arranged around the editor pane you may want to temporarily maximise one to write some code then restore the layout when finished. Double clicking a file tab maximises the whole editor, but not the individual file.
Sorry, i am not aware that this is possible, but you could try to modify the "minimal codeblocks" perspective, to remove all not wanted controlls...





Offline omnishambles

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Editor layout options
« Reply #2 on: July 28, 2020, 06:51:01 pm »

Layout switching with project switch is not supported as far as i know. You can "fast" switch layout with View->Perspective

1) Create the layout for Project 1
2) Save the layout with View->Perspective->Save, name it Project 1
3) Create the layout for Project 2
4) Save the layout with View->Perspective->Save, name it Project 2

Now you can switch between the perspectives with View->Perspective->Project 1...

Thanks. That would be a workaround, but from whatI can tell Perspectives don't save the editor layout, only the CB UI (toolbars, management pane, etc.)

... Actually I just noticed that if you close a project it does save the editor layout and restore it on reopening. If you only keep one project open it seems fine and I'll go with that (if you have more than one it blends files from both into the single editor pane using the current layout).

I'll post the maximise thing as a feature request.