Skip to content

Commit

Permalink
fix(desktop): titlebar drag to move not working
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Jun 6, 2024
1 parent 6591ec0 commit 5f280a1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 18 deletions.
35 changes: 19 additions & 16 deletions lib/components/root/sidebar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import 'package:spotube/provider/user_preferences/user_preferences_provider.dart
import 'package:spotube/provider/user_preferences/user_preferences_state.dart';
import 'package:spotube/utils/platform.dart';
import 'package:spotube/utils/service_utils.dart';
import 'package:window_manager/window_manager.dart';

class Sidebar extends HookConsumerWidget {
final Widget child;
Expand Down Expand Up @@ -207,22 +208,24 @@ class SidebarHeader extends HookWidget {
);
}

return Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
if (kIsMacOS) const SizedBox(height: 25),
Row(
children: [
Sidebar.brandLogo(),
const SizedBox(width: 10),
Text(
"Spotube",
style: theme.textTheme.titleLarge,
),
],
),
],
return DragToMoveArea(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
if (kIsMacOS) const SizedBox(height: 25),
Row(
children: [
Sidebar.brandLogo(),
const SizedBox(width: 10),
Text(
"Spotube",
style: theme.textTheme.titleLarge,
),
],
),
],
),
),
);
}
Expand Down
10 changes: 8 additions & 2 deletions lib/components/shared/page_window_title_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ class _PageWindowTitleBarState extends ConsumerState<PageWindowTitleBar> {
leadingWidth: widget.leadingWidth,
toolbarTextStyle: widget.toolbarTextStyle,
titleTextStyle: widget.titleTextStyle,
title: widget.title,
title: SizedBox(
width: double.infinity, // workaround to force dragging
child: widget.title ?? const Text(""),
),
pinned: widget.pinned,
floating: widget.floating,
snap: widget.snap,
Expand Down Expand Up @@ -164,7 +167,10 @@ class _PageWindowTitleBarState extends ConsumerState<PageWindowTitleBar> {
leadingWidth: widget.leadingWidth,
toolbarTextStyle: widget.toolbarTextStyle,
titleTextStyle: widget.titleTextStyle,
title: widget.title,
title: SizedBox(
width: double.infinity, // workaround to force dragging
child: widget.title ?? const Text(""),
),
scrolledUnderElevation: 0,
shadowColor: Colors.transparent,
forceMaterialTransparency: true,
Expand Down

0 comments on commit 5f280a1

Please sign in to comment.