Skip to content

Commit

Permalink
Change QR code gestures and allow directly copying to clipboard
Browse files Browse the repository at this point in the history
New QR code gestures:
- Tap: show full URL in tooltip
- Long press: copy full URL to clipboard
  • Loading branch information
uintdev committed Jun 29, 2024
1 parent f935820 commit fb1e638
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ QRServ is a file sharing application that utilises its own HTTP server to serve
## Features

- QR Code
- Tap on the QR code to show full URL in a tooltip
- Press and hold on the QR code to copy full URL to clipboard
- Share / Copy to clipboard option
- Multi-file selection support (Android only)
- Multi-file selection would result in a ZIP archive
Expand Down
31 changes: 18 additions & 13 deletions lib/statemanager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -478,19 +478,24 @@ class StateManager extends State<StateManagerPage> {
elevation: 1,
child: ClipRRect(
borderRadius: BorderRadius.circular(25),
child: ForceLTR(
Tooltip(
message: _hostName,
triggerMode: TooltipTriggerMode.longPress,
showDuration: Duration(days: 1),
padding: const EdgeInsets.all(10),
child: QrImageView(
data: _hostName,
version: QrVersions.auto,
size: (MediaQuery.of(context).size.height * .23),
backgroundColor: const Color.fromRGBO(255, 255, 255, 1),
padding:
EdgeInsets.all((MediaQuery.of(context).size.height * .029)),
child: GestureDetector(
onLongPress: () {
ShareManager.copyURL(_hostName, context);
},
child: ForceLTR(
Tooltip(
message: _hostName,
triggerMode: TooltipTriggerMode.tap,
showDuration: Duration(days: 1),
padding: const EdgeInsets.all(10),
child: QrImageView(
data: _hostName,
version: QrVersions.auto,
size: (MediaQuery.of(context).size.height * .23),
backgroundColor: const Color.fromRGBO(255, 255, 255, 1),
padding:
EdgeInsets.all((MediaQuery.of(context).size.height * .029)),
),
),
),
),
Expand Down

0 comments on commit fb1e638

Please sign in to comment.