Show a patch.

GET /api/patches/21163/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 21163,
    "url": "https://patchwork.libcamera.org/api/patches/21163/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/21163/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20240905141045.26165-1-laurent.pinchart@ideasonboard.com>",
    "date": "2024-09-05T14:10:45",
    "name": "[v2] qcam: Decrease minimum width of selector dialog",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "69f21deefb1dae3fe07c0debddce4ef7a0a2b8a8",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/21163/mbox/",
    "series": [
        {
            "id": 4562,
            "url": "https://patchwork.libcamera.org/api/series/4562/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4562",
            "date": "2024-09-05T14:10:45",
            "name": "[v2] qcam: Decrease minimum width of selector dialog",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/4562/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/21163/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/21163/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>",
        "X-Original-To": "parsemail@patchwork.libcamera.org",
        "Delivered-To": "parsemail@patchwork.libcamera.org",
        "Received": [
            "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 4D80FBF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  5 Sep 2024 14:10:51 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BF1E4634CB;\n\tThu,  5 Sep 2024 16:10:49 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DEAD36345D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  5 Sep 2024 16:10:47 +0200 (CEST)",
            "from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5299A3E6;\n\tThu,  5 Sep 2024 16:09:34 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"szm2ItS+\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1725545374;\n\tbh=ADVx6BuVXNL6Xk6Oej7Ha3pcd6ktU+Sc9YCEcP4dubE=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=szm2ItS+ID7yO4szt11LB16vQ6T7fnsrdY0hf1ltEpk+/k0rh+UIDePtSIDjdijAr\n\t0KMvLxX6naQ2Fqhg/p40Sef71EoV2mFiQzEW1O9KJGMkgeYumgiXcxtjCp3wXhEWu8\n\t+BsJo1Dm4rNsix6HUvxvblMnK3wrKKy5RG9Ncrx0=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Luca Weiss <luca@z3ntu.xyz>",
        "Subject": "[PATCH v2] qcam: Decrease minimum width of selector dialog",
        "Date": "Thu,  5 Sep 2024 17:10:45 +0300",
        "Message-ID": "<20240905141045.26165-1-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.44.2",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "<libcamera-devel.lists.libcamera.org>",
        "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>",
        "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>",
        "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>",
        "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "From: Luca Weiss <luca@z3ntu.xyz>\n\nOn phone screens the default width is too wide, so the OK button cannot\nbe clicked.\n\nFix this by decreasing the minimum size of the dialog so it fits nicely.\n\nSigned-off-by: Luca Weiss <luca@z3ntu.xyz>\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\nI found this patch in a branch in my tree. The v2 incorporates the\nchange I proposed in the review of v1. The discussion died out after\nthat, so I thought posting a new version could help getting it merged.\n\nI've dropped the R-b tags as the implementation has changed.\n---\nChanges since v1:\n\n- Make the minimum width depend on the screen geometry\n- Only decrease the width\n---\n src/apps/qcam/cam_select_dialog.cpp | 10 ++++++++++\n 1 file changed, 10 insertions(+)\n\n\nbase-commit: f75b8dd26feaca86701704390dea18c71e2f0350",
    "diff": "diff --git a/src/apps/qcam/cam_select_dialog.cpp b/src/apps/qcam/cam_select_dialog.cpp\nindex c51f59745e48..6b6d0713cc3d 100644\n--- a/src/apps/qcam/cam_select_dialog.cpp\n+++ b/src/apps/qcam/cam_select_dialog.cpp\n@@ -15,7 +15,9 @@\n #include <QComboBox>\n #include <QDialogButtonBox>\n #include <QFormLayout>\n+#include <QGuiApplication>\n #include <QLabel>\n+#include <QScreen>\n #include <QString>\n \n CameraSelectorDialog::CameraSelectorDialog(libcamera::CameraManager *cameraManager,\n@@ -53,6 +55,14 @@ CameraSelectorDialog::CameraSelectorDialog(libcamera::CameraManager *cameraManag\n \tlayout->addRow(\"Location:\", cameraLocation_);\n \tlayout->addRow(\"Model:\", cameraModel_);\n \tlayout->addWidget(buttonBox);\n+\n+\t/*\n+\t * Decrease the minimum width of dialog to fit on narrow screens, with a\n+\t * 20 pixels margin.\n+\t */\n+\tQRect screenGeometry = qGuiApp->primaryScreen()->availableGeometry();\n+\tif (screenGeometry.width() < minimumWidth())\n+\t\tsetMinimumWidth(screenGeometry.width() - 20);\n }\n \n CameraSelectorDialog::~CameraSelectorDialog() = default;\n",
    "prefixes": [
        "v2"
    ]
}