WABA: Fixed resizing (how about changing between 80 <--> 132 cols?)

svn path=/trunk/kdebase/konsole/; revision=37491
wilder-portage
Waldo Bastian 27 years ago
parent 4ce4cfb876
commit 8e836914e6
  1. 10
      src/TEWidget.C
  2. 13
      src/main.C

@ -911,13 +911,19 @@ void TEWidget::makeImage()
}
// calculate the needed size
QSize TEWidget::calcSize(int cols, int lins)
{ int frw = width() - contentsRect().width();
QSize TEWidget::calcSize(int cols, int lins) const
{
int frw = width() - contentsRect().width();
int frh = height() - contentsRect().height();
int scw = (scrollLoc==SCRNONE?0:scrollbar->width());
return QSize( font_w*cols + 2*rimX + frw + scw, font_h*lins + 2*rimY + frh );
}
QSize TEWidget::sizeHint() const
{
return size();
}
void TEWidget::styleChange(QStyle &)
{
propagateSize();

@ -104,7 +104,6 @@ TEDemo::TEDemo(const QString& name, QStrList & _args, int login_shell) : KTMainW
se = 0L;
rootxpm = 0L;
menubar = menuBar();
setMinimumSize(200,100);
// session management
@ -171,8 +170,11 @@ TEDemo::TEDemo(const QString& name, QStrList & _args, int login_shell) : KTMainW
// activate and run first session //////////////////////////////////////////
runSession(initial);
// WABA: Make sure all the xxxBars are in place so that
// we can resize our mainWidget to its target size.
updateRects();
runSession(initial);
}
/*!
@ -190,14 +192,15 @@ void TEDemo::setColLin(int columns, int lines)
defaultSize = te->calcSize(80,24);
notifySize(24,80); // set menu items (strange arg order !)
}
resize(defaultSize);
te->resize(defaultSize);
}
else
{
resize(te->calcSize(columns,lines));
QSize size = te->calcSize(columns, lines);
te->resize(size);
notifySize(lines,columns); // set menu items (strange arg order !)
}
updateRects();
adjustSize();
}
TEDemo::~TEDemo()

Loading…
Cancel
Save