Fixed problem with 2 monitors scaling in portrait configuration

This commit is contained in:
GPayne
2022-01-23 21:16:43 -07:00
parent 9f5e8a7de8
commit 4518cfab49
4 changed files with 4 additions and 11 deletions
@@ -22,7 +22,7 @@ class MonitorBox : public QWidget
Q_OBJECT
public:
explicit MonitorBox(QRect widgetDims, std::vector<QRect> monitorResolution,
unsigned int nWindows, bool showMonitorLabel, QString* winColors);
unsigned int nWindows, QString* winColors);
~MonitorBox();
void mapMonitorResolutionToWidgetCoordinates();
void mapWindowResolutionToWidgetCoordinates(unsigned int mIdx, unsigned int wIdx,
@@ -43,10 +43,9 @@ private:
QVBoxLayout* _displayLayout = nullptr;
QFrame* _displayFrame = nullptr;
Display* _displayWidget = nullptr;
QRect _monitorWidgetSize = {0, 0, 400, 350};
QRect _monitorWidgetSize = {0, 0, 500, 500};
FileSupport* _fileSupportWidget = nullptr;
Orientation* _orientationWidget = nullptr;
bool _showMonitorLabel = false;
sgct::config::Cluster& _cluster;
std::vector<sgct::config::Window>& _windowList;
bool _saveSelected = false;
@@ -2,14 +2,14 @@
MonitorBox::MonitorBox(QRect widgetDims, std::vector<QRect> monitorResolution,
unsigned int nWindows, bool showMonitorLabel, QString* winColors)
unsigned int nWindows, QString* winColors)
: _monitorWidgetSize(widgetDims)
, _monitorResolution(monitorResolution)
, _nWindows(nWindows)
, _showLabel(showMonitorLabel)
, _colorsForWindows(winColors)
{
_nMonitors = monitorResolution.size();
_showLabel = (_nMonitors > 1);
mapMonitorResolutionToWidgetCoordinates();
}
@@ -44,17 +44,11 @@ void SgctEdit::createWidgets() {
QHBoxLayout* layoutMainH = new QHBoxLayout;
_orientationWidget = new Orientation();
if (_monitorSizeList.size() > 1) {
_monitorWidgetSize = QRect(0, 0, 600, 350);
_showMonitorLabel = true;
}
{
_monBox = new MonitorBox(
_monitorWidgetSize,
_monitorSizeList,
_nMaxWindows,
_showMonitorLabel,
_colorsForWindows
);
QHBoxLayout* layoutMonBox = new QHBoxLayout();