Skip to content

Conversation

uiYzzi
Copy link

@uiYzzi uiYzzi commented Jul 27, 2025

This PR introduces a new dragRegionBuilder property to the TabView component, allowing developers to easily implement window dragging functionality in borderless window applications.

Changes Made

Core Implementation:

  • Added dragRegionBuilder property to TabView class in lib/src/controls/navigation/tab_view/tab_view.dart
  • Modified build logic to wrap the entire tab strip with the drag region builder
  • Maintained full backward compatibility with existing stripBuilder functionality
  • Added comprehensive debug information for the new property

Documentation & Examples:

  • Updated example app in example/lib/screens/navigation/tab_view.dart with practical usage demonstration
  • Added dedicated showcase for borderless window dragging with window_manager integration
  • Included clear usage patterns for developers

Testing:

  • Added comprehensive test coverage in test/tab_view_test.dart
  • Tests verify both dragRegionBuilder functionality and null handling
  • All existing tests continue to pass

Related Issue

#1239

Usage Example

TabView(
  currentIndex: currentIndex,
  tabs: tabs,
  dragRegionBuilder: (context, child) {
    return GestureDetector(
      behavior: HitTestBehavior.translucent,
      onPanStart: (details) => windowManager.startDragging(),
      child: child,
    );
  },
)

Pre-launch Checklist

  • I have updated CHANGELOG.md with my changes
  • I have run "dart format ." on the project
  • I have added/updated relevant documentation
  • All tests pass successfully
  • Example app demonstrates the new functionality

uiYzzi added 2 commits July 28, 2025 01:26
The TabView component has a new parameter dragRegionBuilder, allowing the creation of a draggable area in the blank area of the tab bar, which facilitates the dragging operation of borderless windows. At the same time, the macOS project configuration and dependency versions have been updated.

Test cases have been added to verify the functionality of the custom drag area builder and the handling of null values. Example code has been updated to demonstrate the use of the new feature.
Remove excess blank lines in test files and adjust the format of code snippets to improve readability.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant