final macOS

This commit is contained in:
Michel Mastriani
2023-07-18 22:50:43 -03:00
parent 2c0d4fbfe9
commit ec35cf92c7
46 changed files with 16185 additions and 28 deletions

View File

@ -69,9 +69,7 @@ Fractorium::Fractorium(QWidget* p)
m_VarDialog = new FractoriumVariationsDialog(this);
m_AboutDialog = new FractoriumAboutDialog(this);
//Put the about dialog in the screen center.
auto screen = QGuiApplication::screenAt(pos());
auto geom = screen->availableGeometry();
m_AboutDialog->move(geom.center() - m_AboutDialog->rect().center());
m_AboutDialogCentered = false;
connect(m_ColorDialog, SIGNAL(colorSelected(const QColor&)), this, SLOT(OnColorSelected(const QColor&)), Qt::QueuedConnection);
m_XformComboColors[i++] = QColor(0XFF, 0X00, 0X00);
m_XformComboColors[i++] = QColor(0XCC, 0XCC, 0X00);
@ -756,6 +754,25 @@ void Fractorium::showEvent(QShowEvent* e)
//Tell Qt to refresh the native menubar from this widget.
emit qGuiApp->focusWindowChanged(windowHandle());
QMainWindow::showEvent(e);
if(!m_AboutDialogCentered)
{
m_AboutDialogCentered = true;
QTimer::singleShot(100, this, SLOT(WindowShown()));
}
}
/// <summary>
/// Center About Dialog window.
/// Called on program starts after show is completed.
/// See https://doc.qt.io/qt-6/application-windows.html#window-geometry for more information
/// </summary>
void Fractorium::WindowShown()
{
//Put the about dialog in the screen center.
auto screen = QGuiApplication::screenAt(pos());
auto geom = screen->availableGeometry();
m_AboutDialog->move(geom.center() - m_AboutDialog->rect().center());
}
/// <summary>

View File

@ -397,6 +397,9 @@ public slots:
//Can't have a template function be a slot.
void SetTreeItemData(EmberTreeWidgetItemBase* item, vv4F& v, uint w, uint h);
private slots:
void WindowShown();
public:
//template<typename spinType, typename valType>//See below.
//static void SetupSpinner(QTableWidget* table, const QObject* receiver, int& row, int col, spinType*& spinBox, int height, valType min, valType max, valType step, const char* signal, const char* slot, bool incRow = true, valType val = 0, valType doubleClickZero = -999, valType doubleClickNonZero = -999);
@ -623,6 +626,7 @@ private:
std::unordered_map<QString, std::pair<int, int>> m_HeightPresets;
bool m_PreviousAffineState[4];
bool m_AboutDialogCentered;
int m_FontSize;
int m_VarSortMode;
int m_PaletteSortMode;