Skip to content

Commit

Permalink
Re #4282. Fixed window minimizing on Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
mantid-roman committed Jan 17, 2012
1 parent e18d7d8 commit e21f3e9
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 60 deletions.
41 changes: 2 additions & 39 deletions Code/Mantid/MantidPlot/src/ApplicationWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,9 @@ m_exitCode(0),
QCoreApplication::setOrganizationName("ISIS");
QCoreApplication::setApplicationName("MantidPlot");
#ifdef SHARED_MENUBAR
if (settings.value("/General/SharedMenuBar",false).toBool())
{
m_sharedMenuBar = new QMenuBar(NULL);
setMenuBar(m_sharedMenuBar);
}
else
{
m_sharedMenuBar = NULL;
}
//setMenuBar(m_sharedMenuBar);
m_sharedMenuBar->setNativeMenuBar(true);
#endif
mantidUI = new MantidUI(this);
setAttribute(Qt::WA_DeleteOnClose);
Expand Down Expand Up @@ -1414,7 +1408,6 @@ void ApplicationWindow::customMenu(MdiSubWindow* w)
editMenuAboutToShow();
myMenuBar()->insertItem(tr("&View"), view);


//#ifdef SCRIPTING_DIALOG
// scriptingMenu->addAction(actionScriptingLang);
//#endif
Expand Down Expand Up @@ -5212,9 +5205,6 @@ void ApplicationWindow::saveSettings()
settings.setValue("/height", d_app_rect.height());
settings.endGroup();

#ifdef SHARED_MENUBAR
settings.setValue("/SharedMenuBar", m_sharedMenuBar != NULL);
#endif
settings.setValue("/AutoSearchUpdates", autoSearchUpdates);
settings.setValue("/Language", appLanguage);
settings.setValue("/ShowWindowsPolicy", show_windows_policy);
Expand Down Expand Up @@ -17491,12 +17481,6 @@ FloatingWindow* ApplicationWindow::addMdiSubWindowAsFloating(MdiSubWindow* w, QP
{
const QPoint none(-1,-1);
FloatingWindow* fw =new FloatingWindow(this);//, Qt::WindowStaysOnTopHint);
#ifdef SHARED_MENUBAR
if (m_sharedMenuBar != NULL)
{
fw->setMenuBar(m_sharedMenuBar);
}
#endif
QSize sz = w->size();
if (pos == none)
{
Expand Down Expand Up @@ -17744,27 +17728,6 @@ void ApplicationWindow::activateNewWindow()
activateWindow(newone);
}

#ifdef SHARED_MENUBAR
/**
* Toggles sharing of the menu bar.
* @param yes :: True to share the menu bar.
*/
void ApplicationWindow::shareMenuBar(bool yes)
{
if (yes == this->isMenuBarShared()) return;
if (yes)
{
m_sharedMenuBar = new QMenuBar(NULL);
setMenuBar(m_sharedMenuBar);
}
else
{
m_sharedMenuBar = NULL;
}
initMainMenu();
}
#endif

/**
* The slot to change the active window from docked to floating.
*/
Expand Down
4 changes: 0 additions & 4 deletions Code/Mantid/MantidPlot/src/ApplicationWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -1051,10 +1051,6 @@ public slots:
bool isDefaultFloating(const MdiSubWindow* w) const;
bool isDefaultFloating(const QString& aClassName) const;
QMenuBar* myMenuBar();
#ifdef SHARED_MENUBAR
bool isMenuBarShared() const {return m_sharedMenuBar != NULL;}
void shareMenuBar(bool yes);
#endif
void changeActiveToFloating();
void changeActiveToDocked();

Expand Down
14 changes: 0 additions & 14 deletions Code/Mantid/MantidPlot/src/ConfigDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,15 +518,7 @@ void ConfigDialog::initAppPage()
boxSearchUpdates->setChecked(app->autoSearchUpdates);
topBoxLayout->addWidget( boxSearchUpdates, 9, 0, 1, 2 );

#ifdef SHARED_MENUBAR
boxSharedMenuBar = new QCheckBox();
boxSharedMenuBar->setChecked(app->isMenuBarShared());
topBoxLayout->addWidget( boxSharedMenuBar, 10, 0, 1, 2 );
topBoxLayout->setRowStretch(11, 1);
#else
boxSharedMenuBar = NULL;
topBoxLayout->setRowStretch(10, 1);
#endif

appTabWidget->addTab(application, QString());

Expand Down Expand Up @@ -1744,9 +1736,6 @@ void ConfigDialog::languageChange()
boxSave->setText(tr("Save every"));
boxBackupProject->setText(tr("&Backup project before saving"));
boxSearchUpdates->setText(tr("Check for new versions at startup"));
#ifdef SHARED_MENUBAR
boxSharedMenuBar->setText(tr("Share menu bar"));
#endif
boxMinutes->setSuffix(tr(" minutes"));
lblScriptingLanguage->setText(tr("Default scripting language"));
lblUndoStackSize->setText(tr("Matrix Undo Stack Size"));
Expand Down Expand Up @@ -1964,9 +1953,6 @@ void ConfigDialog::apply()
setFont(appFont);
app->changeAppStyle(boxStyle->currentText());
app->autoSearchUpdates = boxSearchUpdates->isChecked();
#ifdef SHARED_MENUBAR
app->shareMenuBar(boxSharedMenuBar->isChecked());
#endif
app->setSaveSettings(boxSave->isChecked(), boxMinutes->value());
app->d_backup_files = boxBackupProject->isChecked();
app->defaultScriptingLang = boxScriptingLanguage->currentText();
Expand Down
1 change: 0 additions & 1 deletion Code/Mantid/MantidPlot/src/ConfigDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ class ConfigDialog : public QDialog

QPushButton* buttonAxesFont, *buttonNumbersFont, *buttonLegendFont, *buttonTitleFont, *fontsBtn;
QCheckBox *boxSearchUpdates, *boxOrthogonal, *logBox, *plotLabelBox, *scaleErrorsBox;
QCheckBox *boxSharedMenuBar;
QCheckBox *boxTitle, *boxFrame, *boxPlots3D, *boxPlots2D, *boxTables, *boxNotes, *boxFolders,*boxInstrWindow;
QCheckBox *boxSave, *boxBackbones, *boxShowLegend, *boxSmoothMesh;
QCheckBox *boxAllAxes;
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/MantidPlot/src/FloatingWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
* Constructor.
*/
FloatingWindow::FloatingWindow(ApplicationWindow* appWindow, Qt::WindowFlags f):
//QMainWindow(NULL,f),
QMainWindow(appWindow,f),
QMainWindow(NULL,f),
//QMainWindow(appWindow,f),
d_app(appWindow)
{
setFocusPolicy(Qt::StrongFocus);
Expand Down

0 comments on commit e21f3e9

Please sign in to comment.