Bug 116826 - Change splitter orientiation on the fly
Summary: Change splitter orientiation on the fly
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist with 60 votes (vote)
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-21 20:58 UTC by Eike Hein
Modified: 2014-09-11 15:30 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eike Hein 2005-11-21 20:58:42 UTC
Version:            (using KDE KDE 3.5.0)
Installed from:    Compiled From Sources

It would be quite cool if it were possible to "rotate" a splitter in Kate, i.e. change its orientation from vertical to horizontal (and vice-versa) via a single hotkey and/or a splitter context menu.


When I'm using Kate on a smaller screen, I quite often run into a situation where manually I switch my splitter setup from one orientation to the other depending on the nature of the code I work - whichever gives me the most comfortable working environment for the job at hand. Even on relatively large screens, this may well be very nice and convenient to have.


Thinking about the practical implementation, the functionality requires two new actions: "Rotate clockwise" and "Rotate counter-clockwise" (or "to the left" and "to the right", respectively), controlling which view ends up on which side of the splitter in the new orientation. 

The associated keyword shortcuts should operate on the splitter for the currently highlighted view. The actions should also be available in a newly created context menu for the splitter widget, if that's "worth it" (i.e., reasonably maintainable).


Shouldn't bloat too much, and result in a real workflow improvement.
Comment 1 Eike Hein 2005-11-21 21:06:51 UTC
Err, "keyboard shortcuts", of course.
Comment 2 Sebastian Pipping 2007-08-30 23:05:39 UTC
As far as I can remember: Wasn't there somebody with a patch for this already? mwoehlke, was it you?
Comment 3 Eike Hein 2007-08-31 03:29:34 UTC
No, it was me. It's likely bitrotted quite a bit, though; I'll look into it some time.
Comment 4 Dominik Haumann 2007-08-31 11:52:25 UTC
Code: kdesdk/kate/app/kateviewmanager.cpp
- add entries in the .xml file
- create actions in the ::setupActions function
- add a function, example:

void simpleRotate() {
  KateViewSpace *vs = activeViewSpace();
  QSplitter *currentSplitter = qobject_cast<QSplitter*>(vs->parentWidget());
  if (currentSplitter.count() == 1) return; // root, nothing to switch
  if (currentSplitter.orientatoin() == Qt::Horizontal)
    currentSplitter.setOrientation(Qt::Vertical);
  else
    currentSplitter.setOrientation(Qt::Horizontal);
}

This would be rotate clockwise :) Counterclockwise needs a bit more work.
Comment 5 Christoph Cullmann 2014-09-11 15:30:49 UTC
Git commit 8bd9d27f09612069997a55df05459baa592bb436 by Christoph Cullmann.
Committed on 11/09/2014 at 15:30.
Pushed by cullmann into branch 'master'.

implement toggle of orientation of current splitter

M  +2    -1    kate/data/kateui.rc
M  +32   -0    kate/src/kateviewmanager.cpp
M  +6    -0    kate/src/kateviewmanager.h

http://commits.kde.org/kate/8bd9d27f09612069997a55df05459baa592bb436