Skip to content

Commit

Permalink
add onhover icon
Browse files Browse the repository at this point in the history
  • Loading branch information
LiquidatorCoder committed Nov 15, 2021
1 parent 471ee77 commit 5cb3916
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion lib/pages/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class _HomePageState extends State<HomePage>
final Tween<double> _sizeTween = Tween(begin: .4, end: 1);

bool _dragging = false;
bool _hovering = false;
bool glow = true;

@override
Expand Down Expand Up @@ -114,7 +115,7 @@ class _HomePageState extends State<HomePage>
(MediaQuery.of(context).size.width / 4.8 * 1).toDouble()),
painter: _fileNotifier.fileLink != null
? DoneIconCustomPainter()
: _dragging
: _dragging || _hovering
? DropIconCustomPainter()
: OdinLogoCustomPainter(),
),
Expand Down Expand Up @@ -264,6 +265,33 @@ class _HomePageState extends State<HomePage>
),
),
),
Center(
child: SizedBox(
width: MediaQuery.of(context).size.width / 4.8,
height: MediaQuery.of(context).size.width / 4.8,
child: MouseRegion(
onEnter: (event) {
setState(() {
_hovering = true;
});
},
onExit: (event) {
setState(() {
_hovering = false;
});
},
cursor: SystemMouseCursors.click,
child: Align(
alignment: Alignment.center,
child: GestureDetector(
onTap: () async {
await _fileNotifier.getLinkFromFilePicker();
},
),
),
),
),
),
const WindowTopBar(),
],
),
Expand Down

0 comments on commit 5cb3916

Please sign in to comment.