From: "Shan Shaji" <s.shaji@proxmox.com>
To: "Michael Köppl" <m.koeppl@proxmox.com>,
"Proxmox VE development discussion" <pve-devel@lists.proxmox.com>
Cc: pve-devel <pve-devel-bounces@lists.proxmox.com>,
Thomas Lamprecht <t.lamprecht@proxmox.com>
Subject: Re: [pve-devel] [PATCH pve_flutter_frontend v2] feat: ui: add edit button in guests options page
Date: Wed, 03 Sep 2025 10:42:44 +0200 [thread overview]
Message-ID: <DCJ15S5SQR9F.3VSLG4BWIBC0R@proxmox.com> (raw)
In-Reply-To: <DCI9NAS6ZL9V.1396MYPCNES1F@proxmox.com>
Thanks for the review. Will send an updated patch.
On Tue Sep 2, 2025 at 1:09 PM CEST, Michael Köppl wrote:
> Gave this a spin in my Android emulator. Works as expected. I also
> checked that there's no state change, etc. when rotating to landscape
> and back and that options are locked again upon re-opening the VM/LXC
> options view. Did not notice anything off.
>
> Consider this
> Tested-by: Michael Köppl <m.koeppl@proxmox.com>
>
>> +class LockLxcOptions extends PveLxcOverviewEvent {
>> + final bool isLockOptions;
>
> nit: I think isOptionsLocked would work better here as well.
Yeah, makes sense. will update it accordingly.
>> @override
>> Widget build(BuildContext context) {
>> @@ -26,7 +28,11 @@ class PveConfigSwitchListTile extends StatelessWidget {
>> return SwitchListTile(
>> title: _getTitle(),
>> value: pBool ?? value ?? defaultValue!,
>> - onChanged: pending != null ? null : onChanged,
>> + onChanged: disable
>> + ? null
>> + : pending != null
>> + ? null
>> + : onChanged,
>
> Wouldn't
>
> disable || pending != null ? null : onChanged
>
> work here as well?
>
>> );
>> }
Yes, Thank you. Will update it.
>>
>> diff --git a/lib/widgets/pve_icon_button_widget.dart b/lib/widgets/pve_icon_button_widget.dart
>> new file mode 100644
>> index 0000000..0d30ce8
>> --- /dev/null
>> +++ b/lib/widgets/pve_icon_button_widget.dart
>> @@ -0,0 +1,43 @@
>> +import 'package:flutter/material.dart';
>> +
>> +class PveIconButton extends StatelessWidget {
>> + final IconData icon;
>> + final String label;
>> + final Color? color;
>> + final VoidCallback? onPressed;
>> +
>> + const PveIconButton({
>> + super.key,
>> + required this.icon,
>> + required this.label,
>> + this.color,
>> + this.onPressed,
>> + });
>> +
>> + const PveIconButton.edit({
>> + super.key,
>> + this.color,
>> + this.onPressed,
>> + }) : icon = Icons.edit,
>> + label = 'Edit';
>
> I don't know what @Thomas initially suggested, but I think what would
> work well here is a "lock", so either a button or a toggle to unlock and
> lock the settings, so you could also revert back to a read-only view
> without closing the view and re-opening it. It's just a suggestion from
> my side though. I think a button would have the advantage that it could
> also either show an unlocked or a locked icon depending on the state,
> which would illustrate to the user what the button does without
> additional text (though a tooltip thingy when long-pressing on it could
> be added). It would work with a toggle as well, but I think icons and
> toggles are not usually used together (at least in Android).
IMHO, I think toggle might not be nice, i liked your idea on using a lock and
unlock icon with the text. I think it's more user friendly than a toggle
with just icon. It will be like "<icon> (lock | unlock)". I will create
another patch including that change.
>> +
>> + @override
>> + Widget build(BuildContext context) {
>> + return TextButton(
>> + onPressed: onPressed,
>> + child: Row(
>> + spacing: 2,
>> + children: [
>> + Icon(
>> + icon,
>> + color: color,
>> + ),
>> + Text(
>> + label,
>> + style: TextStyle(color: color),
>> + ),
>> + ],
>> + ),
>> + );
>> + }
>> +}
>
> nit: was this changed by the formatter? I see that you added the
> ..events.add, but the formatting change from
This was not an intented change. Thanks for pointing out.
> () => ...
>
> to
>
> () {
> return ...
> }
>
> seems kind of unrelated.
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-09-03 8:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-29 15:18 Shan Shaji
2025-09-02 11:09 ` Michael Köppl
2025-09-03 8:42 ` Shan Shaji [this message]
2025-09-04 9:29 ` Shan Shaji
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DCJ15S5SQR9F.3VSLG4BWIBC0R@proxmox.com \
--to=s.shaji@proxmox.com \
--cc=m.koeppl@proxmox.com \
--cc=pve-devel-bounces@lists.proxmox.com \
--cc=pve-devel@lists.proxmox.com \
--cc=t.lamprecht@proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox