mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-13 03:28:03 +00:00
@@ -450,22 +450,17 @@ class _PeerSortDropdownState extends State<PeerSortDropdown> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final enableStyle = TextStyle(
|
||||
final style = TextStyle(
|
||||
color: Theme.of(context).textTheme.titleLarge?.color,
|
||||
fontSize: MenuConfig.fontSize,
|
||||
fontWeight: FontWeight.normal);
|
||||
final disableStyle = TextStyle(
|
||||
color: Colors.grey,
|
||||
fontSize: MenuConfig.fontSize,
|
||||
fontWeight: FontWeight.normal);
|
||||
List<PopupMenuEntry> items = List.empty(growable: true);
|
||||
items.add(PopupMenuItem(
|
||||
enabled: false,
|
||||
child: Text(translate("Sort by"), style: disableStyle)));
|
||||
enabled: false, child: Text(translate("Sort by"), style: style)));
|
||||
for (var e in PeerSortType.values) {
|
||||
items.add(PopupMenuItem(
|
||||
child: Obx(() => getRadio(
|
||||
Text(translate(e), style: enableStyle), e, peerSort.value,
|
||||
child: Obx(() =>
|
||||
getRadio(Text(translate(e), style: style), e, peerSort.value,
|
||||
(String? v) async {
|
||||
if (v != null) {
|
||||
peerSort.value = v;
|
||||
@@ -477,6 +472,7 @@ class _PeerSortDropdownState extends State<PeerSortDropdown> {
|
||||
}))));
|
||||
}
|
||||
|
||||
var menuPos = RelativeRect.fromLTRB(0, 0, 0, 0);
|
||||
return InkWell(
|
||||
child: Icon(
|
||||
Icons.sort,
|
||||
@@ -485,14 +481,14 @@ class _PeerSortDropdownState extends State<PeerSortDropdown> {
|
||||
onTapDown: (details) {
|
||||
final x = details.globalPosition.dx;
|
||||
final y = details.globalPosition.dy;
|
||||
final menuPos = RelativeRect.fromLTRB(x, y, x, y);
|
||||
showMenu(
|
||||
context: context,
|
||||
position: menuPos,
|
||||
items: items,
|
||||
elevation: 8,
|
||||
);
|
||||
menuPos = RelativeRect.fromLTRB(x, y, x, y);
|
||||
},
|
||||
onTap: () => showMenu(
|
||||
context: context,
|
||||
position: menuPos,
|
||||
items: items,
|
||||
elevation: 8,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user