Mercurial > hg > octave-nkf
changeset 17948:73f46593a51c
Center the Octave Community News window only when constructed (bug #40618)
* main-window.cc (main_window::display_community_news): Whenever OCN is built,
get desktop height and width and move OCN window to center of desktop using OCN
window width() and height().
author | Daniel J Sebald <daniel.sebald@ieee.org> |
---|---|
date | Sun, 17 Nov 2013 23:30:00 -0600 |
parents | 92b3343e28c4 |
children | 3341d2f1e5db |
files | libgui/src/main-window.cc |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/main-window.cc +++ b/libgui/src/main-window.cc @@ -513,6 +513,10 @@ community_news_window->setWindowTitle (tr ("Octave Community News")); community_news_window->setWindowIcon (QIcon (":/icons/logo.png")); community_news_window->resize (640, 480); + int win_x = QApplication::desktop ()->width (); + int win_y = QApplication::desktop ()->height (); + community_news_window->move ((win_x - community_news_window->width ())/2, + (win_y - community_news_window->height ())/2); } if (! community_news_window->isVisible ())