Commit ee8d97ea authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

PreviewWidget: Fix layout on MacOS

parent e06111b4
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "Clip.h" #include "Clip.h"
#include <QMessageBox> #include <QMessageBox>
#include <QLayout>
PreviewWidget::PreviewWidget( QWidget *parent ) : PreviewWidget::PreviewWidget( QWidget *parent ) :
QWidget( parent ), QWidget( parent ),
...@@ -37,6 +38,14 @@ PreviewWidget::PreviewWidget( QWidget *parent ) : ...@@ -37,6 +38,14 @@ PreviewWidget::PreviewWidget( QWidget *parent ) :
{ {
m_ui->setupUi( this ); m_ui->setupUi( this );
// Prevent buttons overlap on MacOS
for (int i = 0; i < m_ui->toolsWidget->layout()->count(); ++i)
{
QWidget* w = m_ui->toolsWidget->layout()->itemAt( i )->widget();
if ( w != NULL )
w->setAttribute( Qt::WA_LayoutUsesWidgetRect );
}
m_ui->rulerWidget->setFocusPolicy( Qt::NoFocus ); m_ui->rulerWidget->setFocusPolicy( Qt::NoFocus );
// Prepare and set the black background // Prepare and set the black background
......
...@@ -29,7 +29,16 @@ ...@@ -29,7 +29,16 @@
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
<property name="margin"> <property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
...@@ -53,380 +62,388 @@ ...@@ -53,380 +62,388 @@
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <widget class="QWidget" name="toolsWidget" native="true">
<property name="spacing"> <layout class="QHBoxLayout" name="horizontalLayout">
<number>0</number> <property name="spacing">
</property> <number>2</number>
<item> </property>
<widget class="QPushButton" name="pushButtonPreviousFrame"> <item>
<property name="sizePolicy"> <widget class="QPushButton" name="pushButtonPreviousFrame">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <property name="sizePolicy">
<horstretch>0</horstretch> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<verstretch>0</verstretch> <horstretch>0</horstretch>
</sizepolicy> <verstretch>0</verstretch>
</property> </sizepolicy>
<property name="minimumSize"> </property>
<size> <property name="minimumSize">
<width>30</width> <size>
<height>30</height> <width>30</width>
</size> <height>30</height>
</property> </size>
<property name="maximumSize"> </property>
<size> <property name="maximumSize">
<width>30</width> <size>
<height>30</height> <width>30</width>
</size> <height>30</height>
</property> </size>
<property name="toolTip"> </property>
<string>Go to the previous frame</string> <property name="toolTip">
</property> <string>Go to the previous frame</string>
<property name="statusTip"> </property>
<string>Go to the previous frame</string> <property name="statusTip">
</property> <string>Go to the previous frame</string>
<property name="text"> </property>
<string/> <property name="text">
</property> <string/>
<property name="icon"> </property>
<iconset resource="../../../../resources.qrc"> <property name="icon">
<normaloff>:/images/previous_frame</normaloff>:/images/previous_frame</iconset> <iconset resource="../../../../resources.qrc">
</property> <normaloff>:/images/previous_frame</normaloff>:/images/previous_frame</iconset>
<property name="iconSize"> </property>
<size> <property name="iconSize">
<width>20</width> <size>
<height>20</height> <width>20</width>
</size> <height>20</height>
</property> </size>
</widget> </property>
</item> </widget>
<item> </item>
<widget class="QPushButton" name="pushButtonPlay"> <item>
<property name="sizePolicy"> <widget class="QPushButton" name="pushButtonPlay">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <property name="sizePolicy">
<horstretch>0</horstretch> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<verstretch>0</verstretch> <horstretch>0</horstretch>
</sizepolicy> <verstretch>0</verstretch>
</property> </sizepolicy>
<property name="minimumSize"> </property>
<size> <property name="minimumSize">
<width>30</width> <size>
<height>30</height> <width>30</width>
</size> <height>30</height>
</property> </size>
<property name="maximumSize"> </property>
<size> <property name="maximumSize">
<width>30</width> <size>
<height>30</height> <width>30</width>
</size> <height>30</height>
</property> </size>
<property name="toolTip"> </property>
<string>Play / Pause</string> <property name="toolTip">
</property> <string>Play / Pause</string>
<property name="statusTip"> </property>
<string>Play / Pause</string> <property name="statusTip">
</property> <string>Play / Pause</string>
<property name="text"> </property>
<string/> <property name="text">
</property> <string/>
<property name="icon"> </property>
<iconset resource="../../../../resources.qrc"> <property name="icon">
<normaloff>:/images/play</normaloff>:/images/play</iconset> <iconset resource="../../../../resources.qrc">
</property> <normaloff>:/images/play</normaloff>:/images/play</iconset>
<property name="iconSize"> </property>
<size> <property name="iconSize">
<width>20</width> <size>
<height>20</height> <width>20</width>
</size> <height>20</height>
</property> </size>
</widget> </property>
</item> </widget>
<item> </item>
<widget class="QPushButton" name="pushButtonNextFrame"> <item>
<property name="sizePolicy"> <widget class="QPushButton" name="pushButtonNextFrame">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <property name="sizePolicy">
<horstretch>0</horstretch> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<verstretch>0</verstretch> <horstretch>0</horstretch>
</sizepolicy> <verstretch>0</verstretch>
</property> </sizepolicy>
<property name="minimumSize"> </property>
<size> <property name="minimumSize">
<width>30</width> <size>
<height>30</height> <width>30</width>
</size> <height>30</height>
</property> </size>
<property name="maximumSize"> </property>
<size> <property name="maximumSize">
<width>30</width> <size>
<height>30</height> <width>30</width>
</size> <height>30</height>
</property> </size>
<property name="toolTip"> </property>
<string>Go to the next frame</string> <property name="toolTip">
</property> <string>Go to the next frame</string>
<property name="statusTip"> </property>
<string>Go to the next frame</string> <property name="statusTip">
</property> <string>Go to the next frame</string>
<property name="text"> </property>
<string/> <property name="text">
</property> <string/>
<property name="icon"> </property>
<iconset resource="../../../../resources.qrc"> <property name="icon">
<normaloff>:/images/next_frame</normaloff>:/images/next_frame</iconset> <iconset resource="../../../../resources.qrc">
</property> <normaloff>:/images/next_frame</normaloff>:/images/next_frame</iconset>
<property name="iconSize"> </property>
<size> <property name="iconSize">
<width>20</width> <size>
<height>20</height> <width>20</width>
</size> <height>20</height>
</property> </size>
</widget> </property>
</item> </widget>
<item> </item>
<widget class="QPushButton" name="pushButtonStop"> <item>
<property name="sizePolicy"> <widget class="QPushButton" name="pushButtonStop">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <property name="sizePolicy">
<horstretch>0</horstretch> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<verstretch>0</verstretch> <horstretch>0</horstretch>
</sizepolicy> <verstretch>0</verstretch>
</property> </sizepolicy>
<property name="minimumSize"> </property>
<size> <property name="minimumSize">
<width>30</width> <size>
<height>30</height> <width>30</width>
</size> <height>30</height>
</property> </size>
<property name="maximumSize"> </property>
<size> <property name="maximumSize">
<width>30</width> <size>
<height>30</height> <width>30</width>
</size> <height>30</height>
</property> </size>
<property name="toolTip"> </property>
<string>Stop the playback</string> <property name="toolTip">
</property> <string>Stop the playback</string>
<property name="statusTip"> </property>
<string>Stop the playback</string> <property name="statusTip">
</property> <string>Stop the playback</string>
<property name="text"> </property>
<string/> <property name="text">
</property> <string/>
<property name="icon"> </property>
<iconset resource="../../../../resources.qrc"> <property name="icon">
<normaloff>:/images/stop</normaloff>:/images/stop</iconset> <iconset resource="../../../../resources.qrc">
</property> <normaloff>:/images/stop</normaloff>:/images/stop</iconset>
<property name="iconSize"> </property>
<size> <property name="iconSize">
<width>20</width> <size>
<height>20</height> <width>20</width>
</size> <height>20</height>
</property> </size>
<property name="autoDefault"> </property>
<bool>false</bool> <property name="autoDefault">
</property> <bool>false</bool>
<property name="default"> </property>
<bool>false</bool> <property name="default">
</property> <bool>false</bool>
<property name="flat"> </property>
<bool>false</bool> <property name="flat">
</property> <bool>false</bool>
</widget> </property>
</item> </widget>
<item> </item>
<widget class="QPushButton" name="pushButtonMarkerStart"> <item>
<property name="sizePolicy"> <widget class="QPushButton" name="pushButtonMarkerStart">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <property name="sizePolicy">
<horstretch>0</horstretch> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<verstretch>0</verstretch> <horstretch>0</horstretch>
</sizepolicy> <verstretch>0</verstretch>
</property> </sizepolicy>
<property name="minimumSize"> </property>
<size> <property name="minimumSize">
<width>30</width> <size>
<height>30</height> <width>30</width>
</size> <height>30</height>
</property> </size>
<property name="maximumSize"> </property>
<size> <property name="maximumSize">
<width>30</width> <size>
<height>30</height> <width>30</width>
</size> <height>30</height>
</property> </size>
<property name="toolTip"> </property>
<string>Set marker A</string> <property name="toolTip">
</property> <string>Set marker A</string>
<property name="statusTip"> </property>
<string>Set marker A</string> <property name="statusTip">
</property> <string>Set marker A</string>
<property name="text"> </property>
<string/> <property name="text">
</property> <string/>
<property name="icon"> </property>
<iconset resource="../../../../resources.qrc"> <property name="icon">
<normaloff>:/images/marker_start</normaloff>:/images/marker_start</iconset> <iconset resource="../../../../resources.qrc">
</property> <normaloff>:/images/marker_start</normaloff>:/images/marker_start</iconset>
<property name="iconSize"> </property>
<size> <property name="iconSize">
<width>20</width> <size>
<height>20</height> <width>20</width>
</size> <height>20</height>
</property> </size>
</widget> </property>
</item> </widget>
<item> </item>
<widget class="QPushButton" name="pushButtonMarkerStop"> <item>
<property name="sizePolicy"> <widget class="QPushButton" name="pushButtonMarkerStop">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <property name="sizePolicy">
<horstretch>0</horstretch> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<verstretch>0</verstretch> <horstretch>0</horstretch>
</sizepolicy> <verstretch>0</verstretch>
</property> </sizepolicy>
<property name="minimumSize"> </property>
<size> <property name="minimumSize">
<width>30</width> <size>
<height>30</height> <width>30</width>
</size> <height>30</height>
</property> </size>
<property name="maximumSize"> </property>
<size> <property name="maximumSize">
<width>30</width> <size>
<height>30</height> <width>30</width>
</size> <height>30</height>
</property> </size>
<property name="toolTip"> </property>
<string>Set marker B</string> <property name="toolTip">
</property> <string>Set marker B</string>
<property name="statusTip"> </property>
<string>Set marker B</string> <property name="statusTip">
</property> <string>Set marker B</string>
<property name="text"> </property>
<string/> <property name="text">
</property> <string/>
<property name="icon"> </property>
<iconset resource="../../../../resources.qrc"> <property name="icon">
<normaloff>:/images/marker_stop</normaloff>:/images/marker_stop</iconset> <iconset resource="../../../../resources.qrc">
</property> <normaloff>:/images/marker_stop</normaloff>:/images/marker_stop</iconset>
<property name="iconSize"> </property>
<size> <property name="iconSize">
<width>20</width> <size>
<height>20</height> <width>20</width>
</size> <height>20</height>
</property> </size>
</widget> </property>
</item> </widget>
<item> </item>
<widget class="QPushButton" name="pushButtonCreateClip"> <item>
<property name="sizePolicy"> <widget class="QPushButton" name="pushButtonCreateClip">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <property name="sizePolicy">
<horstretch>0</horstretch> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<verstretch>0</verstretch> <horstretch>0</horstretch>
</sizepolicy> <verstretch>0</verstretch>
</property> </sizepolicy>
<property name="minimumSize"> </property>
<size> <property name="minimumSize">
<width>30</width> <size>
<height>30</height> <width>30</width>
</size> <height>30</height>
</property> </size>
<property name="maximumSize"> </property>
<size> <property name="maximumSize">
<width>30</width> <size>
<height>30</height> <width>30</width>
</size> <height>30</height>
</property> </size>
<property name="toolTip"> </property>
<string>Cut at markers position</string> <property name="toolTip">
</property> <string>Cut at markers position</string>
<property name="statusTip"> </property>
<string>Cut at markers position</string> <property name="statusTip">
</property> <string>Cut at markers position</string>
<property name="text"> </property>
<string/> <property name="text">
</property> <string/>
<property name="icon"> </property>
<iconset resource="../../../../resources.qrc"> <property name="icon">
<normaloff>:/images/editcut</normaloff>:/images/editcut</iconset> <iconset resource="../../../../resources.qrc">
</property> <normaloff>:/images/editcut</normaloff>:/images/editcut</iconset>
</widget> </property>
</item> <property name="iconSize">
<item> <size>
<spacer name="horizontalSpacer"> <width>20</width>
<property name="orientation"> <height>20</height>
<enum>Qt::Horizontal</enum> </size>
</property> </property>
<property name="sizeHint" stdset="0"> </widget>
<size> </item>
<width>20</width> <item>
<height>20</height> <spacer name="horizontalSpacer">
</size> <property name="orientation">
</property> <enum>Qt::Horizontal</enum>
</spacer> </property>
</item> <property name="sizeHint" stdset="0">
<item> <size>
<widget class="QSlider" name="volumeSlider"> <width>20</width>
<property name="sizePolicy"> <height>20</height>
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> </size>
<horstretch>0</horstretch> </property>
<verstretch>0</verstretch> </spacer>
</sizepolicy> </item>
</property> <item>
<property name="minimumSize"> <widget class="QSlider" name="volumeSlider">
<size> <property name="sizePolicy">
<width>80</width> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<height>32</height> <horstretch>0</horstretch>
</size> <verstretch>0</verstretch>
</property> </sizepolicy>
<property name="toolTip"> </property>
<string>Adjust Volume</string> <property name="minimumSize">
</property> <size>
<property name="statusTip"> <width>80</width>
<string>Adjust Volume</string>