summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGO63-samara <go1@list.ru>2021-03-08 21:32:38 +0400
committerGO63-samara <go1@list.ru>2021-03-08 21:32:38 +0400
commit13e9b3ab23da11e8092dbed9a1e57d35b50ebc73 (patch)
tree74e1869ce1807a37a6f78278d617220eb3a3ae71
parent058942f40e17e091b91df5436d771d61203ccc73 (diff)
Fixed the sizes of the widgets in the main window
Fixed the sizes of the widgets in the main window. Removed the background fill in the pose-widget to better match the dark theme.
-rw-r--r--opentrack/main-window.ui130
-rw-r--r--pose-widget/pose-widget.cpp6
2 files changed, 111 insertions, 25 deletions
diff --git a/opentrack/main-window.ui b/opentrack/main-window.ui
index 0ec5b5ab..af3234c5 100644
--- a/opentrack/main-window.ui
+++ b/opentrack/main-window.ui
@@ -7,16 +7,22 @@
<rect>
<x>0</x>
<y>0</y>
- <width>818</width>
- <height>567</height>
+ <width>649</width>
+ <height>511</height>
</rect>
</property>
<property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>500</height>
+ </size>
+ </property>
<property name="windowIcon">
<iconset resource="../gui/opentrack-res.qrc">
<normaloff>:/images/opentrack.png</normaloff>:/images/opentrack.png</iconset>
@@ -50,6 +56,12 @@
</property>
<item>
<widget class="QFrame" name="frame">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
@@ -77,6 +89,24 @@
</property>
<item alignment="Qt::AlignLeft|Qt::AlignTop">
<widget class="QWidget" name="top" native="true">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>240</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>640</width>
+ <height>16777215</height>
+ </size>
+ </property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>0</number>
@@ -201,7 +231,7 @@
<item>
<widget class="pose_widget" name="pose_display" native="true">
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -220,7 +250,7 @@
<item>
<widget class="QFrame" name="top_display">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
+ <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -250,11 +280,17 @@
<item>
<widget class="QGroupBox" name="box_raw_headpose">
<property name="sizePolicy">
- <sizepolicy hsizetype="MinimumExpanding" vsizetype="Maximum">
+ <sizepolicy hsizetype="Fixed" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>316</width>
+ <height>0</height>
+ </size>
+ </property>
<property name="title">
<string>Raw tracker data</string>
</property>
@@ -574,11 +610,17 @@
<item>
<widget class="QGroupBox" name="box_mapped_headpose">
<property name="sizePolicy">
- <sizepolicy hsizetype="MinimumExpanding" vsizetype="Maximum">
+ <sizepolicy hsizetype="Fixed" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>316</width>
+ <height>0</height>
+ </size>
+ </property>
<property name="title">
<string>Game data</string>
</property>
@@ -901,11 +943,17 @@
<item>
<widget class="QFrame" name="bottom_controls">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>180</height>
+ </size>
+ </property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<number>6</number>
@@ -925,14 +973,14 @@
<item row="0" column="1">
<widget class="QFrame" name="groupWindows">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>4</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
- <width>400</width>
+ <width>315</width>
<height>0</height>
</size>
</property>
@@ -958,7 +1006,7 @@
<item>
<widget class="QFrame" name="groupProfile">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -1018,6 +1066,12 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>245</width>
+ <height>0</height>
+ </size>
+ </property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
@@ -1032,7 +1086,7 @@
<item>
<widget class="QPushButton" name="btnShortcuts">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
+ <sizepolicy hsizetype="Expanding" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -1055,7 +1109,7 @@
<item>
<widget class="QPushButton" name="btnEditCurves">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
+ <sizepolicy hsizetype="Expanding" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -1078,11 +1132,17 @@
<item>
<widget class="QGroupBox" name="groupStartStop">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>3</horstretch>
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Maximum">
+ <horstretch>4</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
<property name="title">
<string>Tracking</string>
</property>
@@ -1108,11 +1168,17 @@
<item>
<widget class="QToolButton" name="btnStartTracker">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>34</height>
+ </size>
+ </property>
<property name="font">
<font>
<weight>75</weight>
@@ -1130,11 +1196,17 @@
<bool>false</bool>
</property>
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>34</height>
+ </size>
+ </property>
<property name="font">
<font>
<weight>75</weight>
@@ -1155,14 +1227,14 @@
<item row="0" column="0">
<widget class="QFrame" name="frame_2">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>4</horstretch>
+ <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
+ <horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
- <width>400</width>
+ <width>310</width>
<height>0</height>
</size>
</property>
@@ -1190,6 +1262,12 @@
</property>
<item>
<widget class="QGroupBox" name="groupTrackerSource">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="title">
<string>Input</string>
</property>
@@ -1259,6 +1337,12 @@
</item>
<item>
<widget class="QGroupBox" name="groupGameProtocol">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="title">
<string>Output</string>
</property>
@@ -1328,6 +1412,12 @@
</item>
<item>
<widget class="QGroupBox" name="groupFilter">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="title">
<string>Filter</string>
</property>
diff --git a/pose-widget/pose-widget.cpp b/pose-widget/pose-widget.cpp
index c5a6b78e..e662424c 100644
--- a/pose-widget/pose-widget.cpp
+++ b/pose-widget/pose-widget.cpp
@@ -63,12 +63,8 @@ void pose_widget::resizeEvent(QResizeEvent *event)
float w = event->size().width();
float h = event->size().height();
- // fill background by color
- constexpr int clr = 220;
- QImage background(QImage(w, h, QImage::Format_ARGB32));
- background.fill(QColor(clr,clr,clr));
-
// draw axes
+ QImage background(QImage(w, h, QImage::Format_ARGB32));
QPainter p(&background);
p.setPen(QPen(Qt::gray, 1, Qt::SolidLine));
p.drawLine(0.5*w, 0 , 0.5*w, h );