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 @@
#include "Clip.h"
#include <QMessageBox>
#include <QLayout>
PreviewWidget::PreviewWidget( QWidget *parent ) :
QWidget( parent ),
......@@ -37,6 +38,14 @@ PreviewWidget::PreviewWidget( QWidget *parent ) :
{
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 );
// Prepare and set the black background
......
......@@ -29,7 +29,16 @@
<property name="spacing">
<number>0</number>
</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>
</property>
<item>
......@@ -53,380 +62,388 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="pushButtonPreviousFrame">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>Go to the previous frame</string>
</property>
<property name="statusTip">
<string>Go to the previous frame</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../../resources.qrc">
<normaloff>:/images/previous_frame</normaloff>:/images/previous_frame</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonPlay">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>Play / Pause</string>
</property>
<property name="statusTip">
<string>Play / Pause</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../../resources.qrc">
<normaloff>:/images/play</normaloff>:/images/play</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonNextFrame">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>Go to the next frame</string>
</property>
<property name="statusTip">
<string>Go to the next frame</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../../resources.qrc">
<normaloff>:/images/next_frame</normaloff>:/images/next_frame</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonStop">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>Stop the playback</string>
</property>
<property name="statusTip">
<string>Stop the playback</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../../resources.qrc">
<normaloff>:/images/stop</normaloff>:/images/stop</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="default">
<bool>false</bool>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonMarkerStart">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>Set marker A</string>
</property>
<property name="statusTip">
<string>Set marker A</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../../resources.qrc">
<normaloff>:/images/marker_start</normaloff>:/images/marker_start</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonMarkerStop">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>Set marker B</string>
</property>
<property name="statusTip">
<string>Set marker B</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../../resources.qrc">
<normaloff>:/images/marker_stop</normaloff>:/images/marker_stop</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonCreateClip">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>Cut at markers position</string>
</property>
<property name="statusTip">
<string>Cut at markers position</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../../resources.qrc">
<normaloff>:/images/editcut</normaloff>:/images/editcut</iconset>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSlider" name="volumeSlider">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>32</height>
</size>
</property>
<property name="toolTip">
<string>Adjust Volume</string>
</property>
<property name="statusTip">
<string>Adjust Volume</string>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="value">
<number>50</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="invertedControls">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="LCDTimecode" name="lcdNumber">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="numDigits">
<number>11</number>
</property>
<property name="segmentStyle">
<enum>QLCDNumber::Flat</enum>
</property>
</widget>
</item>
</layout>
<widget class="QWidget" name="toolsWidget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>2</number>
</property>
<item>
<widget class="QPushButton" name="pushButtonPreviousFrame">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>Go to the previous frame</string>
</property>
<property name="statusTip">
<string>Go to the previous frame</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../../resources.qrc">
<normaloff>:/images/previous_frame</normaloff>:/images/previous_frame</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonPlay">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>Play / Pause</string>
</property>
<property name="statusTip">
<string>Play / Pause</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../../resources.qrc">
<normaloff>:/images/play</normaloff>:/images/play</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonNextFrame">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>Go to the next frame</string>
</property>
<property name="statusTip">
<string>Go to the next frame</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../../resources.qrc">
<normaloff>:/images/next_frame</normaloff>:/images/next_frame</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonStop">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>Stop the playback</string>
</property>
<property name="statusTip">
<string>Stop the playback</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../../resources.qrc">
<normaloff>:/images/stop</normaloff>:/images/stop</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="default">
<bool>false</bool>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonMarkerStart">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>Set marker A</string>
</property>
<property name="statusTip">
<string>Set marker A</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../../resources.qrc">
<normaloff>:/images/marker_start</normaloff>:/images/marker_start</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonMarkerStop">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>Set marker B</string>
</property>
<property name="statusTip">
<string>Set marker B</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../../resources.qrc">
<normaloff>:/images/marker_stop</normaloff>:/images/marker_stop</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonCreateClip">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>Cut at markers position</string>
</property>
<property name="statusTip">
<string>Cut at markers position</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../../resources.qrc">
<normaloff>:/images/editcut</normaloff>:/images/editcut</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSlider" name="volumeSlider">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>32</height>
</size>