diff --git a/qml/ui/configpopup/openhd_settings/ChooseResolutionDialoque.qml b/qml/ui/configpopup/openhd_settings/ChooseResolutionDialoque.qml index 2f7f30c5f..e83c24489 100644 --- a/qml/ui/configpopup/openhd_settings/ChooseResolutionDialoque.qml +++ b/qml/ui/configpopup/openhd_settings/ChooseResolutionDialoque.qml @@ -92,23 +92,13 @@ Card { } - cardBody: Column { + cardBody: Column{ spacing: 10 padding: 10 - Text { + Text{ width: 200 - text: { - var camType = m_cam_type_as_string; - if (camType.length > 18) { - var underscoreIndex = camType.indexOf('_'); - if (underscoreIndex !== -1) { - camType = camType.substring(underscoreIndex + 1); - } - } - return "Your Camera: " + camType; - } + text: "Your Camera: "+m_cam_type_as_string; } - Text{ width: 200 text: "Default Resolution: "+m_default_resolution_fps @@ -168,55 +158,48 @@ Card { } } hasFooter: true - Item { - anchors.fill: parent - anchors.top: parent.top - anchors.topMargin: 285 - - Rectangle { - width: parent.width - height: parent.height - color: "transparent" - - RowLayout { - anchors.centerIn: parent - - Button { - Layout.preferredWidth: 150 - text: "CANCEL" - onPressed: { + cardFooter: + Item { + anchors.horizontalCenter: parent.horizontalCenter + RowLayout { + anchors.horizontalCenter: parent.horizontalCenter // Center the RowLayout horizontally within the parent + spacing: 20 // Add spacing between the buttons (optional) + + Button { + Layout.preferredWidth: 150 + text: "CANCEL" + onPressed: { + close(); + } + } + Button{ + Layout.preferredWidth: 150 + text: "SAVE" + onPressed: { + var success=false; + const selected_res_fps=get_user_selected_resolution(); + console.log("Setting "+(m_is_for_secondary ? "CAM2" : "CAM1")+" to {"+selected_res_fps+"}"); + if(m_is_for_secondary){ + success=_airCameraSettingsModel2.try_update_parameter_string("RESOLUTION_FPS",selected_res_fps)==="" + }else{ + success=_airCameraSettingsModel.try_update_parameter_string("RESOLUTION_FPS",selected_res_fps)==="" + } + if(success){ + _messageBoxInstance.set_text_and_show("Saved "+selected_res_fps); close(); + }else{ + _messageBoxInstance.set_text_and_show("Failed,please try again"); } } - Button{ - Layout.preferredWidth: 150 - text: "SAVE" - onPressed: { - var success=false; - const selected_res_fps=get_user_selected_resolution(); - console.log("Setting "+(m_is_for_secondary ? "CAM2" : "CAM1")+" to {"+selected_res_fps+"}"); - if(m_is_for_secondary){ - success=_airCameraSettingsModel2.try_update_parameter_string("RESOLUTION_FPS",selected_res_fps)==="" - }else{ - success=_airCameraSettingsModel.try_update_parameter_string("RESOLUTION_FPS",selected_res_fps)==="" - } - if(success){ - _messageBoxInstance.set_text_and_show("Saved "+selected_res_fps); - close(); - }else{ - _messageBoxInstance.set_text_and_show("Failed,please try again"); - } - } - enabled: { - if(argh_is_changing_model){ - return false; - } - const selected_res_fps=get_user_selected_resolution(); - return _cameraStreamModelPrimary.is_valid_resolution_fps_string(selected_res_fps) && selected_res_fps!=m_current_resolution_fps; + enabled: { + if(argh_is_changing_model){ + return false; } + const selected_res_fps=get_user_selected_resolution(); + return _cameraStreamModelPrimary.is_valid_resolution_fps_string(selected_res_fps) && selected_res_fps!=m_current_resolution_fps; } } } } - } +