Skip to content

Commit

Permalink
Some layout fixing in RTL languages (#347).
Browse files Browse the repository at this point in the history
  • Loading branch information
punesemu committed Nov 26, 2023
1 parent 82c1079 commit f9afdb3
Show file tree
Hide file tree
Showing 6 changed files with 186 additions and 145 deletions.
244 changes: 127 additions & 117 deletions src/gui/designer/wdgRewind.ui
Original file line number Diff line number Diff line change
Expand Up @@ -26,115 +26,7 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item row="1" column="4">
<widget class="QToolButton" name="toolButton_Step_Forward">
<property name="toolTip">
<string>Forward (single frame)</string>
</property>
<property name="text">
<string notr="true">&gt;</string>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/icon/icons/rwnd_step_forward.svgz</normaloff>:/icon/icons/rwnd_step_forward.svgz</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRepeat">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QToolButton" name="toolButton_Step_Backward">
<property name="toolTip">
<string>Rewind (single frame)</string>
</property>
<property name="text">
<string notr="true">&lt;</string>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/icon/icons/rwnd_step_backward.svgz</normaloff>:/icon/icons/rwnd_step_backward.svgz</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRepeat">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QToolButton" name="toolButton_Pause">
<property name="toolTip">
<string>Pause</string>
</property>
<property name="text">
<string notr="true">Pause</string>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/icon/icons/rwnd_pause.svgz</normaloff>:/icon/icons/rwnd_pause.svgz</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="5">
<widget class="QToolButton" name="toolButton_Fast_Forward">
<property name="toolTip">
<string>Fast forward (from 1x to 8x)</string>
</property>
<property name="text">
<string notr="true">&gt;&gt;</string>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/icon/icons/rwnd_fast_forward.svgz</normaloff>:/icon/icons/rwnd_fast_forward.svgz</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QToolButton" name="toolButton_Fast_Backward">
<property name="toolTip">
<string>Fast rewind (from 1x to 8x)</string>
</property>
<property name="text">
<string notr="true">&lt;&lt;</string>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/icon/icons/rwnd_fast_backward.svgz</normaloff>:/icon/icons/rwnd_fast_backward.svgz</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QToolButton" name="toolButton_Play">
<property name="toolTip">
<string>Play</string>
</property>
<property name="text">
<string notr="true">Play</string>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/icon/icons/rwnd_play.svgz</normaloff>:/icon/icons/rwnd_play.svgz</iconset>
</property>
<property name="checkable">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="0" colspan="6">
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="label_title">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
Expand All @@ -150,16 +42,134 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QWidget" name="widget_buttons" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_buttons">
<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>
<widget class="QToolButton" name="toolButton_Fast_Backward">
<property name="toolTip">
<string>Fast rewind (from 1x to 8x)</string>
</property>
<property name="text">
<string notr="true">&lt;&lt;</string>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/icon/icons/rwnd_fast_backward.svgz</normaloff>:/icon/icons/rwnd_fast_backward.svgz</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_Step_Backward">
<property name="toolTip">
<string>Rewind (single frame)</string>
</property>
<property name="text">
<string notr="true">&lt;</string>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/icon/icons/rwnd_step_backward.svgz</normaloff>:/icon/icons/rwnd_step_backward.svgz</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRepeat">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_Play">
<property name="toolTip">
<string>Play</string>
</property>
<property name="text">
<string notr="true">Play</string>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/icon/icons/rwnd_play.svgz</normaloff>:/icon/icons/rwnd_play.svgz</iconset>
</property>
<property name="checkable">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_Pause">
<property name="toolTip">
<string>Pause</string>
</property>
<property name="text">
<string notr="true">Pause</string>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/icon/icons/rwnd_pause.svgz</normaloff>:/icon/icons/rwnd_pause.svgz</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_Step_Forward">
<property name="toolTip">
<string>Forward (single frame)</string>
</property>
<property name="text">
<string notr="true">&gt;</string>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/icon/icons/rwnd_step_forward.svgz</normaloff>:/icon/icons/rwnd_step_forward.svgz</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRepeat">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_Fast_Forward">
<property name="toolTip">
<string>Fast forward (from 1x to 8x)</string>
</property>
<property name="text">
<string notr="true">&gt;&gt;</string>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/icon/icons/rwnd_fast_forward.svgz</normaloff>:/icon/icons/rwnd_fast_forward.svgz</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>toolButton_Fast_Backward</tabstop>
<tabstop>toolButton_Step_Backward</tabstop>
<tabstop>toolButton_Play</tabstop>
<tabstop>toolButton_Pause</tabstop>
<tabstop>toolButton_Step_Forward</tabstop>
<tabstop>toolButton_Fast_Forward</tabstop>
</tabstops>
<resources>
<include location="resources.qrc"/>
</resources>
Expand Down
76 changes: 48 additions & 28 deletions src/gui/designer/wdgRotateScreen.ui
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,6 @@
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="pushButton_left">
<property name="toolTip">
<string>Rotate the screen 90 degrees to the left</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/icon/icons/rotate_left.svgz</normaloff>:/icon/icons/rotate_left.svgz</iconset>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLabel" name="label_desc">
<property name="toolTip">
Expand All @@ -66,20 +52,6 @@
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QPushButton" name="pushButton_right">
<property name="toolTip">
<string>Rotate the screen 90 degrees to the Right</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/icon/icons/rotate_right.svgz</normaloff>:/icon/icons/rotate_right.svgz</iconset>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QPushButton" name="pushButton_flip">
<property name="text">
Expand All @@ -94,10 +66,58 @@
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QWidget" name="widget_directions" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_directions">
<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>
<widget class="QPushButton" name="pushButton_left">
<property name="toolTip">
<string>Rotate the screen 90 degrees to the left</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/icon/icons/rotate_left.svgz</normaloff>:/icon/icons/rotate_left.svgz</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_right">
<property name="toolTip">
<string>Rotate the screen 90 degrees to the Right</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/icon/icons/rotate_right.svgz</normaloff>:/icon/icons/rotate_right.svgz</iconset>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>pushButton_left</tabstop>
<tabstop>pushButton_right</tabstop>
<tabstop>pushButton_flip</tabstop>
</tabstops>
<resources>
<include location="resources.qrc"/>
Expand Down
3 changes: 3 additions & 0 deletions src/gui/dlgStdPad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ dlgStdPad::dlgStdPad(QWidget *parent, _cfg_port *cfg_port) : QDialog(parent) {
setAttribute(Qt::WA_DeleteOnClose);
setFocusProxy(tabWidget_kbd_joy);

frame_kbd_buttons->setLayoutDirection(Qt::LeftToRight);
frame_joy_buttons->setLayoutDirection(Qt::LeftToRight);

groupBox_controller->setStyleSheet(group_title_bold_stylesheet());
groupBox_Misc->setStyleSheet(group_title_bold_stylesheet());

Expand Down
2 changes: 2 additions & 0 deletions src/gui/wdgOverlayUi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,8 @@ wdgOverlayUi::wdgOverlayUi(QWidget *parent) : QWidget(parent) {

setupUi(this);

setLayoutDirection(Qt::LeftToRight);

overlayInfo->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
overlayFPS->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
overlayFloppy->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
Expand Down
3 changes: 3 additions & 0 deletions src/gui/wdgRewind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ wdgRewind::wdgRewind(QWidget *parent) : QWidget(parent) {

setupUi(this);

widget_buttons->setLayoutDirection(Qt::LeftToRight);

gridLayout->setHorizontalSpacing(SPACING);
horizontalLayout_buttons->setSpacing(SPACING);

connect(toolButton_Fast_Backward, SIGNAL(clicked(bool)), this, SLOT(s_fast_backward(bool)));
connect(toolButton_Step_Backward, SIGNAL(clicked(bool)), this, SLOT(s_step_backward(bool)));
Expand Down
Loading

0 comments on commit f9afdb3

Please sign in to comment.