[{"id":31096,"web_url":"https://patchwork.libcamera.org/comment/31096/","msgid":"<87bk12t8yh.fsf@redhat.com>","date":"2024-09-05T15:29:42","subject":"Re: [PATCH v2] qcam: Decrease minimum width of selector dialog","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Laurent Pinchart <laurent.pinchart@ideasonboard.com> writes:\n\n> From: Luca Weiss <luca@z3ntu.xyz>\n>\n> On phone screens the default width is too wide, so the OK button cannot\n> be clicked.\n>\n> Fix this by decreasing the minimum size of the dialog so it fits nicely.\n>\n> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n> I found this patch in a branch in my tree. The v2 incorporates the\n> change I proposed in the review of v1. The discussion died out after\n> that, so I thought posting a new version could help getting it merged.\n>\n> I've dropped the R-b tags as the implementation has changed.\n\nI don't know the history but the change looks reasonable and good to me.\nStruggling with app geometries myself on my Linux phone, I welcome any\nsuch change. :-)\n\nReviewed-by: Milan Zamazal <mzamazal@redhat.com>\n\n> ---\n> Changes 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> diff --git a/src/apps/qcam/cam_select_dialog.cpp b/src/apps/qcam/cam_select_dialog.cpp\n> index 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>\n> base-commit: f75b8dd26feaca86701704390dea18c71e2f0350","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 15419BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  5 Sep 2024 15:29:55 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3D5CA634E5;\n\tThu,  5 Sep 2024 17:29:54 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DA71E6345D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  5 Sep 2024 17:29:51 +0200 (CEST)","from mail-ej1-f71.google.com (mail-ej1-f71.google.com\n\t[209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-518-2pWcPGlpN_SuiAv85O1ygw-1; Thu, 05 Sep 2024 11:29:49 -0400","by mail-ej1-f71.google.com with SMTP id\n\ta640c23a62f3a-a86f0c0af53so88954466b.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 05 Sep 2024 08:29:49 -0700 (PDT)","from nuthatch (ip-77-48-47-2.net.vodafone.cz. [77.48.47.2])\n\tby smtp.gmail.com with ESMTPSA id\n\ta640c23a62f3a-a8a6236d057sm149197566b.124.2024.09.05.08.29.43\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 05 Sep 2024 08:29:43 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"FtOugfgj\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1725550190;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=EgH9KlxmJfAeVYiTXvjS76kWKjVQHx8SIZtPVzORk+4=;\n\tb=FtOugfgj2Kd1FcieRePKpAuoioqFGooF8WY5EQ1YgaflH7SprhnNpSmnZ14WB3gepexdWn\n\tIlSXx3smcNbfY8yTjg073WnkZeaBgyEqLsLRtVkoWIKa1tBUFdSmo1Va2P2PsFLtfMuMyR\n\tOUuOQiIOPBRybTrTrTVXWUMpb31vJLI=","X-MC-Unique":"2pWcPGlpN_SuiAv85O1ygw-1","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1725550188; x=1726154988;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=EgH9KlxmJfAeVYiTXvjS76kWKjVQHx8SIZtPVzORk+4=;\n\tb=VCQqd+qSwtcit2+JuqeqMukx/mjhc9/ZP4Wh+M5bbLXmD/LAsftVCHdMGXpQodhN5Z\n\tr67H7jlxdTLD5eF/af80GVfEmmhfA/T4vFC2hloSxm3tRx/0BFDtZkLJRbuaeEvIhRTm\n\tZNpYqDzgz+Wj3H5TB2bkM6lJYnlG22UHSZzRD/pvMV6dORL0JCChvv5Zoe3duK8GK5rA\n\tjF9N51cc36xu2BHC3RvvBUjZSp0XF6YSaZvkb7748FVtWSDAGquRbLkYmFHZKemTWpk5\n\tEH2O5oc6PfLNk2FLi2AaDQ5VB+/dqEEkd624AABbgv4gQ/qyLraoOMwaWPiMf93c/BWt\n\tYh4g==","X-Gm-Message-State":"AOJu0Yxd0jqTh/J8LvKNCSkIuQ54IOZ7D2rGLrVebd1CtVCWsiS3glxu\n\tzGaxugEqlaWQZy74/vQ99MxGKXHIXqC9E53xzGAw+7JQq9iGBeJjk1bHtHWirmNRXrSw9G3dQeh\n\tKYC7ppCMif8fESnaIt4cOe/nnu42MDLoJ3kWSgnr9m0sFLtT1q8Dxr/l+EEgc4lqiHALBowr7Y5\n\tY4M2k=","X-Received":["by 2002:a17:907:3f20:b0:a87:1026:3807 with SMTP id\n\ta640c23a62f3a-a897fad505amr1888231966b.61.1725550188005; \n\tThu, 05 Sep 2024 08:29:48 -0700 (PDT)","by 2002:a17:907:3f20:b0:a87:1026:3807 with SMTP id\n\ta640c23a62f3a-a897fad505amr1888219866b.61.1725550184436; \n\tThu, 05 Sep 2024 08:29:44 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IExjSRkH2KlPf5rUoRCnV9rVWUZP2X+IAzeGcEtwnzhA4Firnx8QwvtORiHWzGSQ6n+yPBbXg==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,  Luca Weiss <luca@z3ntu.xyz>","Subject":"Re: [PATCH v2] qcam: Decrease minimum width of selector dialog","In-Reply-To":"<20240905141045.26165-1-laurent.pinchart@ideasonboard.com>\n\t(Laurent Pinchart's message of \"Thu, 5 Sep 2024 17:10:45 +0300\")","References":"<20240905141045.26165-1-laurent.pinchart@ideasonboard.com>","Date":"Thu, 05 Sep 2024 17:29:42 +0200","Message-ID":"<87bk12t8yh.fsf@redhat.com>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain","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>"}},{"id":31097,"web_url":"https://patchwork.libcamera.org/comment/31097/","msgid":"<172555131025.129190.15375181938780615876@ping.linuxembedded.co.uk>","date":"2024-09-05T15:48:30","subject":"Re: [PATCH v2] qcam: Decrease minimum width of selector dialog","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2024-09-05 15:10:45)\n> From: Luca Weiss <luca@z3ntu.xyz>\n> \n> On phone screens the default width is too wide, so the OK button cannot\n> be clicked.\n> \n> Fix this by decreasing the minimum size of the dialog so it fits nicely.\n> \n> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n> I found this patch in a branch in my tree. The v2 incorporates the\n> change I proposed in the review of v1. The discussion died out after\n> that, so I thought posting a new version could help getting it merged.\n\nI have this stuck in some old branches of mine too so I'm happy to see\nit get merged too ;-)\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> \n> I've dropped the R-b tags as the implementation has changed.\n> ---\n> Changes 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> diff --git a/src/apps/qcam/cam_select_dialog.cpp b/src/apps/qcam/cam_select_dialog.cpp\n> index 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>         layout->addRow(\"Location:\", cameraLocation_);\n>         layout->addRow(\"Model:\", cameraModel_);\n>         layout->addWidget(buttonBox);\n> +\n> +       /*\n> +        * Decrease the minimum width of dialog to fit on narrow screens, with a\n> +        * 20 pixels margin.\n> +        */\n> +       QRect screenGeometry = qGuiApp->primaryScreen()->availableGeometry();\n> +       if (screenGeometry.width() < minimumWidth())\n> +               setMinimumWidth(screenGeometry.width() - 20);\n>  }\n>  \n>  CameraSelectorDialog::~CameraSelectorDialog() = default;\n> \n> base-commit: f75b8dd26feaca86701704390dea18c71e2f0350\n> -- \n> Regards,\n> \n> Laurent Pinchart\n>","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 3804FC324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  5 Sep 2024 15:48:36 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 30149634E5;\n\tThu,  5 Sep 2024 17:48:35 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 40D176345D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  5 Sep 2024 17:48:33 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9126B502;\n\tThu,  5 Sep 2024 17:47:19 +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=\"dwURUNhG\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1725551239;\n\tbh=C5w6k5dhM6NpD99J8G5/D1GMAwcOAyHuN3oxvJz5Us8=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=dwURUNhGHckxBg5zuVPKUpbf3/jSe+eH34VREc2sMujKiairuOd0M+EZDJ26uAWaR\n\tIfKKlBLG+H5+MAvrqyBphD8nHRrRI2BtkxH2PrqVRNeE1IobTq7D780080eNZ0crI7\n\tlrCRthM0jipZqq2CF393UrlFwcr5zs/jrARYtyQw=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240905141045.26165-1-laurent.pinchart@ideasonboard.com>","References":"<20240905141045.26165-1-laurent.pinchart@ideasonboard.com>","Subject":"Re: [PATCH v2] qcam: Decrease minimum width of selector dialog","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Luca Weiss <luca@z3ntu.xyz>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 05 Sep 2024 16:48:30 +0100","Message-ID":"<172555131025.129190.15375181938780615876@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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>"}},{"id":31098,"web_url":"https://patchwork.libcamera.org/comment/31098/","msgid":"<20240905155338.GA22763@pendragon.ideasonboard.com>","date":"2024-09-05T15:53:38","subject":"Re: [PATCH v2] qcam: Decrease minimum width of selector dialog","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Thu, Sep 05, 2024 at 04:48:30PM +0100, Kieran Bingham wrote:\n> Quoting Laurent Pinchart (2024-09-05 15:10:45)\n> > From: Luca Weiss <luca@z3ntu.xyz>\n> > \n> > On phone screens the default width is too wide, so the OK button cannot\n> > be clicked.\n> > \n> > Fix this by decreasing the minimum size of the dialog so it fits nicely.\n> > \n> > Signed-off-by: Luca Weiss <luca@z3ntu.xyz>\n> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > ---\n> > I found this patch in a branch in my tree. The v2 incorporates the\n> > change I proposed in the review of v1. The discussion died out after\n> > that, so I thought posting a new version could help getting it merged.\n> \n> I have this stuck in some old branches of mine too so I'm happy to see\n> it get merged too ;-)\n\nFor what it's worth, I tested this with a hack by hardcoding the minimum\nto a smaller value than the default size of the dialog on my system, and\nit then gets displayed with a smaller size.\n\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> > \n> > I've dropped the R-b tags as the implementation has changed.\n> > ---\n> > Changes 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> > diff --git a/src/apps/qcam/cam_select_dialog.cpp b/src/apps/qcam/cam_select_dialog.cpp\n> > index 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> >         layout->addRow(\"Location:\", cameraLocation_);\n> >         layout->addRow(\"Model:\", cameraModel_);\n> >         layout->addWidget(buttonBox);\n> > +\n> > +       /*\n> > +        * Decrease the minimum width of dialog to fit on narrow screens, with a\n> > +        * 20 pixels margin.\n> > +        */\n> > +       QRect screenGeometry = qGuiApp->primaryScreen()->availableGeometry();\n> > +       if (screenGeometry.width() < minimumWidth())\n> > +               setMinimumWidth(screenGeometry.width() - 20);\n> >  }\n> >  \n> >  CameraSelectorDialog::~CameraSelectorDialog() = default;\n> > \n> > base-commit: f75b8dd26feaca86701704390dea18c71e2f0350","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 CDD27BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  5 Sep 2024 15:53:44 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6FCAB634E5;\n\tThu,  5 Sep 2024 17:53:43 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 289CB6345D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  5 Sep 2024 17:53:42 +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 A24E0153F;\n\tThu,  5 Sep 2024 17:52:27 +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=\"NK1q6yHI\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1725551547;\n\tbh=UVVCtJ8xJUUv9DzYUn3Rno9eg1HZlJ+RpiYxwBdtYXQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=NK1q6yHIrKbKCag9bJdg3heB0qzN9zQ3eNI3QeyTbmXsuKg5ZjkyYIXFcCNZ8rvU+\n\t7O8BQS6GAOvR+QDaE5uL4bpbYeB9JAeSVw0yrZ1F4lxC7Xstc70NIGJx8HrOLp2PxP\n\t2HZwce/pq0W5I5MUuGsO9nUevBIBmD7IDVvK8uWw=","Date":"Thu, 5 Sep 2024 18:53:38 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org, Luca Weiss <luca@z3ntu.xyz>","Subject":"Re: [PATCH v2] qcam: Decrease minimum width of selector dialog","Message-ID":"<20240905155338.GA22763@pendragon.ideasonboard.com>","References":"<20240905141045.26165-1-laurent.pinchart@ideasonboard.com>\n\t<172555131025.129190.15375181938780615876@ping.linuxembedded.co.uk>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<172555131025.129190.15375181938780615876@ping.linuxembedded.co.uk>","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>"}},{"id":31099,"web_url":"https://patchwork.libcamera.org/comment/31099/","msgid":"<3DE861B1-5141-4450-B983-2072CD8A85D0@lucaweiss.eu>","date":"2024-09-05T17:36:46","subject":"Re: [PATCH v2] qcam: Decrease minimum width of selector dialog","submitter":{"id":205,"url":"https://patchwork.libcamera.org/api/people/205/","name":"Luca Weiss","email":"luca@lucaweiss.eu"},"content":"Thanks for picking this up again!\n(currently on my phone so no clue what the quoting will look like)\n\nRegards\nLuca\n\nLaurent Pinchart <laurent.pinchart@ideasonboard.com> schreef op 5 september 2024 16:10:45 CEST:\n>From: Luca Weiss <luca@z3ntu.xyz>\n>\n>On phone screens the default width is too wide, so the OK button cannot\n>be clicked.\n>\n>Fix this by decreasing the minimum size of the dialog so it fits nicely.\n>\n>Signed-off-by: Luca Weiss <luca@z3ntu.xyz>\n>Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n>---\n>I found this patch in a branch in my tree. The v2 incorporates the\n>change I proposed in the review of v1. The discussion died out after\n>that, so I thought posting a new version could help getting it merged.\n>\n>I've dropped the R-b tags as the implementation has changed.\n>---\n>Changes 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>diff --git a/src/apps/qcam/cam_select_dialog.cpp b/src/apps/qcam/cam_select_dialog.cpp\n>index 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>\n>base-commit: f75b8dd26feaca86701704390dea18c71e2f0350","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 EBCE2C324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  5 Sep 2024 17:52:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D4B59634CB;\n\tThu,  5 Sep 2024 19:52:40 +0200 (CEST)","from ahti.lucaweiss.eu (ahti.lucaweiss.eu [128.199.32.197])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2E95B634CB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  5 Sep 2024 19:37:20 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=lucaweiss.eu header.i=@lucaweiss.eu\n\theader.b=\"O3vjYMeg\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=lucaweiss.eu; s=s1;\n\tt=1725557809; bh=gBibbe4E9ejQ3SjLabp+f27UHGxy1kp4XCc1bpbKZ8w=;\n\th=Date:From:To:Subject:In-Reply-To:References;\n\tb=O3vjYMegvsNmJWyPpyre6dFA7Hs84rTCoL86zpPLYIE+tTd+KgZBobyF2wiqJAg5c\n\tbFKchNw5p17ZCx/wpuKr+Wm58kbQkoPC/XiAZ02ocwaQ1ufiO72lcBua7MYEGVerCJ\n\tb53tiyj03ZKXL8rkvs0tqDBxz3sMAsJZ0UJMVqdU=","Date":"Thu, 05 Sep 2024 19:36:46 +0200","From":"Luca Weiss <luca@lucaweiss.eu>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v2] qcam: Decrease minimum width of selector dialog","In-Reply-To":"<20240905141045.26165-1-laurent.pinchart@ideasonboard.com>","References":"<20240905141045.26165-1-laurent.pinchart@ideasonboard.com>","Message-ID":"<3DE861B1-5141-4450-B983-2072CD8A85D0@lucaweiss.eu>","MIME-Version":"1.0","Content-Type":"text/plain;\n charset=utf-8","Content-Transfer-Encoding":"quoted-printable","X-Mailman-Approved-At":"Thu, 05 Sep 2024 19:52:39 +0200","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>"}}]