* fix: prevent custom scale dialog from closing when interacting with slider
Wrapped MobileCustomScaleControls in GestureDetector with opaque behavior
to prevent touch events from propagating to parent dialog's clickMaskDismiss
handler. The slider now works correctly without closing the dialog.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* Update flutter/lib/mobile/widgets/custom_scale_widget.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update flutter/lib/mobile/widgets/custom_scale_widget.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update flutter/lib/mobile/widgets/custom_scale_widget.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update flutter/lib/mobile/widgets/custom_scale_widget.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Revert "fix: mobile remove "Scale custom" (#13323)"
This reverts commit 265d08fc3b.
* chore: keep remote_toolbar.dart cleanup (remove dead code)
The dead code removed in 265d08fc3 hasn't been used since Aug 2023.
Only reverting toolbar.dart is needed for the mobile Scale custom fix.
* Update flutter/lib/mobile/pages/remote_page.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* refactor: Implement CustomScaleControlsMixin for shared scaling logic across mobile and desktop widgets
- Introduced a new mixin `CustomScaleControlsMixin` to encapsulate custom scale control logic, allowing for code reuse in both mobile and desktop widgets.
- Refactored `_CustomScaleMenuControlsState` and `_MobileCustomScaleControlsState` to utilize the new mixin, simplifying the scaling logic and reducing code duplication.
- Updated slider handling and state management to leverage the mixin's methods for improved maintainability.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* Update flutter/lib/desktop/widgets/remote_toolbar.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update flutter/lib/mobile/widgets/custom_scale_widget.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update flutter/lib/mobile/pages/remote_page.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* refactor: changed from mixin to abstract class
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* Revert "Update flutter/lib/mobile/pages/remote_page.dart"
This reverts commit 7c35897408.
* refactor: remove unnecessary tap event handling in custom scale controls
- Removed the `onTap` handler from the
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* refactor: simplify MobileCustomScaleControls usage in remote_page.dart
- Removed unnecessary GestureDetector wrapper around MobileCustomScaleControls for cleaner code.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
---------
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* feat(ui): custom scale mode with inline controls and live apply
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* Update flutter/lib/models/model.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update flutter/lib/desktop/widgets/remote_toolbar.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* refactor(dialog): remove unused showCustomScaleDialog function
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* feat(ui): enhance custom scale controls with live updates and improved UI
- Introduced a reactive custom scale percentage using RxInt.
- Added initialization of custom scale from stored options after the widget builds.
- Updated viewStyle method to conditionally display custom controls based on selection.
- Implemented a debouncer for smoother scale adjustments.
- Enhanced slider UI with custom thumb shape and improved button interactions.
This update improves user experience by allowing real-time adjustments to the custom scale settings.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* refactor(remote_toolbar): improve widget lifecycle management and enhance slider dimensions
- Moved initialization of custom scale percentage to initState for better lifecycle handling.
- Updated slider thumb dimensions and layout for improved UI consistency.
- Added dispose method to clean up resources in custom scale controls.
These changes enhance the overall performance and user experience of the remote toolbar.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* feat(remote_toolbar): enhance scroll behavior and improve slider thumb rendering
- Introduced a new state variable to manage scroll enablement based on canvas model changes.
- Updated the return value of the viewStyle method to include the scroll enablement status.
- Refactored the slider thumb shape for better performance and visual consistency.
- Improved the initialization of image overflow detection in the CanvasModel.
These changes enhance the user experience by providing dynamic scroll control and a more responsive UI.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* Update flutter/lib/desktop/widgets/remote_toolbar.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* refactor(scale): introduce utility functions for custom scale management for DRY
- Added a new file `scale.dart` containing utility functions to clamp, parse, and compute custom scale percentages.
- Refactored the `CanvasModel` and `_DisplayMenuState` to utilize the new utility functions for fetching and applying custom scale settings.
- Improved code readability and maintainability by centralizing scale-related logic.
These changes enhance the handling of custom scale settings across the application.
Signed-off-by: Alessandro De Blasis alex@deblasis.net
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* Update flutter/lib/utils/scale.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update flutter/lib/models/model.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update flutter/lib/desktop/widgets/remote_toolbar.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update flutter/lib/desktop/widgets/remote_toolbar.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update flutter/lib/desktop/widgets/remote_toolbar.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update flutter/lib/models/model.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* chore: Remove unused import of 'uuid' in scale.dart
Signed-off-by: Alessandro De Blasis alex@deblasis.net
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* feat(remote_toolbar): implement nonlinear mapping for custom scale slider
- Added piecewise mapping functions to convert normalized slider positions to custom scale percentages and vice versa.
- Introduced snapping behavior for the slider to enhance user experience.
- Updated the slider's minimum and maximum values to align with the new mapping logic.
- Adjusted the clamping function to ensure the minimum percentage is 10.
These changes improve the precision and usability of the custom scale slider in the remote toolbar.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* fix(scale): update minimum scale percentage to 5
- Adjusted the minimum scale percentage in both the remote toolbar and the clamping function to improve consistency and usability.
- This change aligns the clamping logic with the updated minimum value for the custom scale slider.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* Update flutter/lib/desktop/widgets/remote_toolbar.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* refactor(scale): centralize custom scale constants in consts.dart
- Moved piecewise mapping constants for the custom scale slider from the remote toolbar to consts.dart for better organization and maintainability.
- Introduced additional constants related to custom scale behavior, including minimum, pivot, and maximum percentages, as well as debounce duration.
- Updated the remote toolbar to reference these centralized constants, improving code clarity and reducing duplication.
These changes enhance the structure and readability of the custom scale implementation.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* refactor(consts): remove duplicate custom scale percent key definition
- Eliminated redundant declaration of the custom scale percent key in consts.dart, ensuring a single source of truth for this constant.
- This change improves code clarity and maintainability by reducing duplication.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* refactor(scale): update clamping logic to use centralized constants
- Modified the clamping function to utilize the newly defined constants for minimum and maximum scale percentages, enhancing code maintainability and clarity.
- This change ensures consistency across the application by referencing a single source for scale limits.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* Enhance RdoMenuButton behavior for custom scale selection
- Updated the RdoMenuButton to include a new `closeOnActivate` parameter, allowing the submenu to remain open when selecting custom scale options.
- Modified the onChanged callback to conditionally trigger a rebuild when entering custom mode, improving user experience by immediately displaying the slider controls.
These changes streamline the interaction with the custom scale feature in the remote toolbar.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* refactor(toolbar): _DisplayMenuState to simplify scroll handling
- Removed the _scrollEnabled state variable and its associated logic, streamlining the component's state management.
- Updated the RdoMenuButton onChanged callbacks to directly reference the canvasModel's imageOverflow value, enhancing responsiveness and reducing complexity.
These changes improve code clarity and maintainability in the remote toolbar's display menu.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* feat(lang): Add translations for custom scale features in multiple languages
- Introduced new entries for "Scale custom", "Custom scale slider", "Decrease", and "Increase" in various language files to support the custom scale functionality.
- This update enhances the localization of the application, ensuring users can interact with the custom scale features in their preferred language.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* feat(lang): Add translations for custom scale features in Catalan and Romanian
- Updated language files for Catalan and Romanian to include translations for "Custom scale slider", "Decrease", and "Increase".
- This enhancement improves the localization of the application, allowing users to interact with custom scale features in their native languages.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* fix(model): Correct error logging in getSessionCustomScale method
- Updated the error logging statement in the getSessionCustomScale method to properly interpolate the exception message, improving debugging clarity.
- This change ensures that error messages are more informative, aiding in troubleshooting issues related to session scaling.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* refactor(scale): Simplify clamping logic for custom scale percent
- Updated the clampCustomScalePercent function to use the built-in clamp method, improving code readability and maintainability.
- This change ensures consistent clamping behavior across the application by centralizing the logic for valid scale ranges.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* refactor(scale): Remove unused import for web bridge
- Eliminated the conditional import of the web bridge from scale.dart, as it is no longer necessary. This change helps to clean up the code and improve maintainability by removing unused dependencies.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* chore(model): typo
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* Update flutter/lib/desktop/widgets/remote_toolbar.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* chore(toolbar): Clarify precision for scale adjustments in remote toolbar
- Added comments to clarify the use of a wide range of divisions for the scale slider, allowing for ~1% precision increments. This change improves user experience by enabling more precise scale value settings, reducing the need for fine-tuning with +/- buttons.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* Update flutter/lib/models/model.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update flutter/lib/desktop/widgets/remote_toolbar.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fix(model): Enhance error logging in getSessionCustomScale method
- Improved error logging by adding stack trace output to debugPrintStack, enhancing debugging capabilities for session scaling issues.
- This change provides clearer insights into errors encountered during scale retrieval, aiding in troubleshooting.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* refactor(toolbar): Simplify custom scale percent retrieval in remote toolbar
- Replaced the previous method of retrieving the custom scale percent with a new function, getSessionCustomScalePercent, enhancing code clarity and maintainability.
- This change streamlines the process of obtaining the scale value, ensuring a more efficient and readable implementation.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* Update flutter/lib/desktop/widgets/remote_toolbar.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
Signed-off-by: Alessandro De Blasis alex@deblasis.net
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
1. Merge code of mobile and desktop virtual display menu.
2. Mobile add seperate resolution menu, only support changing
resolutions.
3. Android add proxy setting
Signed-off-by: 21pages <sunboeasy@gmail.com>
* mobile add view mode menu, disable same menus as desktop
* show forbidden cursor when not view mode && no keyboard permission &&
not show remote cursor
* hide keyboard/mouse bottom action when keyboard disabled
* fix not listen keyboard permission change
* mobile missing changing resolution and http proxy setting, will add if
needed.
Signed-off-by: 21pages <sunboeasy@gmail.com>
* change negotiated codec name to negotiated codec format
Signed-off-by: 21pages <pages21@163.com>
* fallback to vp9 directly if failed to create encoder
Current fallback method is clear hwcodec config
Signed-off-by: 21pages <pages21@163.com>
* show current codec in menu when auto codec is chosen
Signed-off-by: 21pages <pages21@163.com>
---------
Signed-off-by: 21pages <pages21@163.com>
1. Explicitly specify the color space as bt601
2. Use fullrange by default for yuv420p if supported
3. Use the pix_fmt space range format to identify codec capabilities, make i444 proto field deprecated, and cause the non-release version of 444 true color to fail.
Signed-off-by: 21pages <pages21@163.com>