From bc53940651195f977b35d55aaa628c783b4b23ba Mon Sep 17 00:00:00 2001 From: AzulRadio <50132891+AzulRadio@users.noreply.github.com> Date: Thu, 7 Jul 2022 13:25:18 -0500 Subject: [PATCH] Fix common widget Pose (#431) * common widget variables fix * remove spacer * change show to expand Signed-off-by: youhy --- include/ignition/gui/qml/GzPose.qml | 38 ++++++++--------------------- 1 file changed, 10 insertions(+), 28 deletions(-) diff --git a/include/ignition/gui/qml/GzPose.qml b/include/ignition/gui/qml/GzPose.qml index 3cc05efa3..d863e6bfc 100644 --- a/include/ignition/gui/qml/GzPose.qml +++ b/include/ignition/gui/qml/GzPose.qml @@ -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 { @@ -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: {} @@ -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" @@ -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)' @@ -197,12 +185,6 @@ Item { } } - // Right spacer - Item { - Layout.rowSpan: 3 - width: margin - } - Text { text: 'Y (m)' leftPadding: 5