Skip to content
Snippets Groups Projects
Commit 2b269858 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

never show the message console on startup: this reverts to the old behaviour...

never show the message console on startup: this reverts to the old behaviour when we had a separate message window
parent 55090b19
No related branches found
No related tags found
No related merge requests found
...@@ -810,9 +810,8 @@ void FlGui::storeCurrentWindowsInfo() ...@@ -810,9 +810,8 @@ void FlGui::storeCurrentWindowsInfo()
CTX::instance()->glPosition[0] = graph[0]->win->x(); CTX::instance()->glPosition[0] = graph[0]->win->x();
CTX::instance()->glPosition[1] = graph[0]->win->y(); CTX::instance()->glPosition[1] = graph[0]->win->y();
CTX::instance()->glSize[0] = graph[0]->win->w(); CTX::instance()->glSize[0] = graph[0]->win->w();
CTX::instance()->glSize[1] = (graph[0]->win->h() - graph[0]->bottom->h() - CTX::instance()->glSize[1] = (graph[0]->win->h() - graph[0]->bottom->h());
graph[0]->browser->h()); CTX::instance()->msgSize = graph[0]->getMessageHeight();
CTX::instance()->msgSize = graph[0]->browser->h();
CTX::instance()->optPosition[0] = options->win->x(); CTX::instance()->optPosition[0] = options->win->x();
CTX::instance()->optPosition[1] = options->win->y(); CTX::instance()->optPosition[1] = options->win->y();
CTX::instance()->pluginPosition[0] = plugins->win->x(); CTX::instance()->pluginPosition[0] = plugins->win->x();
......
...@@ -522,25 +522,17 @@ graphicWindow::graphicWindow(bool main, int numTiles) : _autoScrollMessages(true ...@@ -522,25 +522,17 @@ graphicWindow::graphicWindow(bool main, int numTiles) : _autoScrollMessages(true
int sh = 2 * FL_NORMAL_SIZE - 4; // status bar height int sh = 2 * FL_NORMAL_SIZE - 4; // status bar height
int sw = FL_NORMAL_SIZE + 3; // status button width int sw = FL_NORMAL_SIZE + 3; // status button width
int width = CTX::instance()->glSize[0]; int width = CTX::instance()->glSize[0];
int mheight = CTX::instance()->msgSize; int mheight = 10; // dummy (nonzero)
int glheight = CTX::instance()->glSize[1]; int glheight = CTX::instance()->glSize[1] - mheight;
int height = glheight + mheight + sh; int height = glheight + mheight + sh;
// make sure height < screen height // make sure height < screen height
if(height > Fl::h()){ if(height > Fl::h()){
height = Fl::h(); height = Fl::h();
mheight = 50;
glheight = height - mheight - sh; glheight = height - mheight - sh;
CTX::instance()->msgSize = mheight;
CTX::instance()->glSize[1] = glheight; CTX::instance()->glSize[1] = glheight;
} }
// no tile should be zero during tile creation
if(CTX::instance()->msgSize <= 0){
mheight = 10;
glheight = CTX::instance()->glSize[1] - 10;
}
// the graphic window should be a "normal" window (neither modal nor // the graphic window should be a "normal" window (neither modal nor
// non-modal) // non-modal)
if(main){ if(main){
...@@ -820,9 +812,9 @@ void graphicWindow::resizeMessages(int dh) ...@@ -820,9 +812,9 @@ void graphicWindow::resizeMessages(int dh)
void graphicWindow::showMessages() void graphicWindow::showMessages()
{ {
if(!win->shown()) return; if(!win->shown()) return;
if(browser->h() < 10){ if(browser->h() < 5){
int height = _savedMessageHeight; int height = _savedMessageHeight;
if(height < 1) height = 50; if(height < 5) height = 50;
int maxh = win->h() - bottom->h(); int maxh = win->h() - bottom->h();
if(height > maxh) height = maxh / 2; if(height > maxh) height = maxh / 2;
resizeMessages(height - browser->h()); resizeMessages(height - browser->h());
...@@ -837,6 +829,12 @@ void graphicWindow::hideMessages() ...@@ -837,6 +829,12 @@ void graphicWindow::hideMessages()
resizeMessages(-browser->h()); resizeMessages(-browser->h());
} }
int graphicWindow::getMessageHeight()
{
if(!browser->h()) return _savedMessageHeight;
return browser->h();
}
void graphicWindow::addMessage(const char *msg) void graphicWindow::addMessage(const char *msg)
{ {
browser->add(msg, 0); browser->add(msg, 0);
......
...@@ -36,6 +36,7 @@ class graphicWindow{ ...@@ -36,6 +36,7 @@ class graphicWindow{
void setTitle(std::string str); void setTitle(std::string str);
void setAutoScroll(bool val){ _autoScrollMessages = val; } void setAutoScroll(bool val){ _autoScrollMessages = val; }
bool getAutoScroll(){ return _autoScrollMessages; } bool getAutoScroll(){ return _autoScrollMessages; }
int getMessageHeight();
void split(openglWindow *g, char how); void split(openglWindow *g, char how);
void setAnimButtons(int mode); void setAnimButtons(int mode);
void checkAnimButtons(); void checkAnimButtons();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment