Menu items and keyboard shortcuts to change the size of the current view in split-view mode. Use Ctrl+Shift+[ to shrink the size of the current view by 10% and Ctrl+Shift+] to increase the size of the current view by 10%

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=663091
This commit is contained in:
Robert Knight
2007-05-10 01:09:55 +00:00
parent 9ea3227384
commit c43d476a1d
4 changed files with 66 additions and 2 deletions

View File

@@ -49,6 +49,38 @@ void ViewSplitter::childEmpty(ViewSplitter* splitter)
emit empty(this);
}
void ViewSplitter::adjustContainerSize(ViewContainer* container , int percentage)
{
int containerIndex = indexOf(container->containerWidget());
Q_ASSERT( containerIndex != -1 );
QList<int> containerSizes = sizes();
int oldSize = containerSizes[containerIndex];
int newSize = oldSize * ( 1.0 + percentage/100.0 );
// qDebug() << "Old container size:" << oldSize << ", new size:" << newSize;
int perContainerDelta = ( (newSize-oldSize) / (count()-1) ) * (-1);
// qDebug() << "Changing sizes of other containers by " << perContainerDelta << "pixels.";
for ( int i = 0 ; i < containerSizes.count() ; i++ )
{
//qDebug() << "Container" << i << "old size =" << containerSizes[i];
if ( i == containerIndex )
containerSizes[i] = newSize;
else
containerSizes[i] = containerSizes[i] + perContainerDelta;
//qDebug() << "Container" << i << "new size =" << containerSizes[i];
}
setSizes(containerSizes);
}
ViewSplitter* ViewSplitter::activeSplitter()
{
// qDebug() << "BEGIN activeSplitter" ;