Skip to content

Commit

Permalink
Fix common widget Pose (#431)
Browse files Browse the repository at this point in the history
* common widget variables fix

* remove spacer

* change show to expand

Signed-off-by: youhy <haoyuan2019@outlook.com>
  • Loading branch information
AzulRadio authored Jul 7, 2022
1 parent cc557e9 commit bc53940
Showing 1 changed file with 10 additions and 28 deletions.
38 changes: 10 additions & 28 deletions include/ignition/gui/qml/GzPose.qml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import QtQuick.Controls.Styles 1.4
/**
* Item displaying 3D pose information.
*
* Users should load values to xValues, yValues, etc.
* Users can set values to xValue, yValue, etc.
* If readOnly == False,
* users can read from signal pararmeters of gzPoseSet: _x, _y, etc.
* users can read from signal parameters of gzPoseSet: _x, _y, etc.
*
* Usage example:
* GzPose {
Expand Down Expand Up @@ -66,21 +66,15 @@ Item {
*/
signal gzPoseSet(double _x, double _y, double _z, double _roll, double _pitch, double _yaw)

// Maximum spinbox value
property double spinMax: Number.MAX_VALUE

/*** The following are private variables: ***/
// Show Pose bar (used to control expand)
property bool show: true

height: gzPoseContent.height

// Left indentation
property int indentation: 10
// Expand/Collapse of this widget
property bool expand: true

// Horizontal margins
property int margin: 5

// Maximum spinbox value
property double spinMax: 1000000
/*** The following are private variables: ***/
height: gzPoseContent.height

// local variables to store spinbox values
property var xItem: {}
Expand Down Expand Up @@ -133,7 +127,7 @@ Item {
Rectangle {
id: gzPoseContent
width: parent.width
height: show ? gzPoseGrid.height : 0
height: expand ? gzPoseGrid.height : 0
clip: true
color: "transparent"

Expand All @@ -147,13 +141,7 @@ Item {
GridLayout {
id: gzPoseGrid
width: parent.width
columns: 6

// Left spacer
Item {
Layout.rowSpan: 3
width: margin + indentation
}
columns: 4

Text {
text: 'X (m)'
Expand Down Expand Up @@ -197,12 +185,6 @@ Item {
}
}

// Right spacer
Item {
Layout.rowSpan: 3
width: margin
}

Text {
text: 'Y (m)'
leftPadding: 5
Expand Down

0 comments on commit bc53940

Please sign in to comment.