flutter_desktop: pin menubar, rotate icon

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou 2022-09-13 07:24:06 -07:00
parent a075385a11
commit 27e0bdca97
23 changed files with 40 additions and 11 deletions

View File

@ -1,4 +1,5 @@
import 'dart:io';
import 'dart:math' as math;
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@ -141,16 +142,21 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
}
Widget _buildPinMenubar(BuildContext context) {
return IconButton(
tooltip: translate('Pin menubar'),
onPressed: () {
_pinMenubar.value = !_pinMenubar.value;
},
icon: Obx(() => Icon(
Icons.push_pin,
color: _pinMenubar.isTrue ? _MenubarTheme.commonColor : Colors.grey,
)),
);
return Obx(() => IconButton(
tooltip:
translate(_pinMenubar.isTrue ? 'Unpin menubar' : 'Pin menubar'),
onPressed: () {
_pinMenubar.value = !_pinMenubar.value;
},
icon: Obx(() => Transform.rotate(
angle: _pinMenubar.isTrue ? math.pi / 4 : 0,
child: Icon(
Icons.push_pin,
color: _pinMenubar.isTrue
? _MenubarTheme.commonColor
: Colors.grey,
))),
));
}
Widget _buildFullscreen(BuildContext context) {

View File

@ -345,5 +345,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Network", "网络"),
("Enable RDP", "允许RDP访问"),
("Pin menubar", "固定菜单栏"),
("Unpin menubar", "取消固定菜单栏"),
].iter().cloned().collect();
}

View File

@ -345,5 +345,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Network", ""),
("Enable RDP", ""),
("Pin menubar", "Připnout panel nabídek"),
("Unpin menubar", "Odepnout panel nabídek"),
].iter().cloned().collect();
}

View File

@ -345,5 +345,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Network", ""),
("Enable RDP", ""),
("Pin menubar", "Fastgør menulinjen"),
("Unpin menubar", "Frigør menulinjen"),
].iter().cloned().collect();
}

View File

@ -345,5 +345,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Network", ""),
("Enable RDP", ""),
("Pin menubar", "Pin-Menüleiste"),
("Unpin menubar", "Menüleiste lösen"),
].iter().cloned().collect();
}

View File

@ -345,5 +345,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Network", ""),
("Enable RDP", ""),
("Pin menubar", "Alpingla menubreto"),
("Unpin menubar", "Malfiksi menubreton"),
].iter().cloned().collect();
}

View File

@ -358,5 +358,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Network", ""),
("Enable RDP", ""),
("Pin menubar", "Pin barra de menú"),
("Unpin menubar", "Desbloquear barra de menú"),
].iter().cloned().collect();
}

View File

@ -345,5 +345,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Network", ""),
("Enable RDP", ""),
("Pin menubar", "Épingler la barre de menus"),
("Unpin menubar", "Détacher la barre de menu"),
].iter().cloned().collect();
}

View File

@ -345,5 +345,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Network", ""),
("Enable RDP", ""),
("Pin menubar", "Menüsor rögzítése"),
("Unpin menubar", "Menüsor rögzítésének feloldása"),
].iter().cloned().collect();
}

View File

@ -358,5 +358,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Network", ""),
("Enable RDP", ""),
("Pin menubar", "Pin menubar"),
("Unpin menubar", "Unpin menubar"),
].iter().cloned().collect();
}

View File

@ -343,6 +343,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Use IP Whitelisting", ""),
("Network", ""),
("Enable RDP", ""),
("Pin menubar", "Aggiungi barra dei menu"),
("Pin menubar", "Blocca la barra dei menu"),
("Unpin menubar", "Sblocca la barra dei menu"),
].iter().cloned().collect();
}

View File

@ -342,5 +342,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Network", ""),
("Enable RDP", ""),
("Pin menubar", "メニューバーを固定する"),
("Unpin menubar", "メニューバーのピン留めを外す"),
].iter().cloned().collect();
}

View File

@ -339,5 +339,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Network", ""),
("Enable RDP", ""),
("Pin menubar", "핀 메뉴 바"),
("Unpin menubar", "메뉴 모음 고정 해제"),
].iter().cloned().collect();
}

View File

@ -319,5 +319,7 @@ lazy_static::lazy_static! {
("Insecure Connection", "Қатерлі Қосылым"),
("Scale original", "Scale original"),
("Scale adaptive", "Scale adaptive"),
("Pin menubar", "Мәзір жолағын бекіту"),
("Unpin menubar", "Мәзір жолағын босату"),
].iter().cloned().collect();
}

View File

@ -343,5 +343,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Network", ""),
("Enable RDP", ""),
("Pin menubar", "Przypnij pasek menu"),
("Unpin menubar", "Odepnij pasek menu"),
].iter().cloned().collect();
}

View File

@ -339,5 +339,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Network", ""),
("Enable RDP", ""),
("Pin menubar", "Fixar barra de menu"),
("Unpin menubar", "Desenganxa la barra de menús"),
].iter().cloned().collect();
}

View File

@ -345,5 +345,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Network", ""),
("Enable RDP", ""),
("Pin menubar", ""),
("Unpin menubar", ""),
].iter().cloned().collect();
}

View File

@ -345,5 +345,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Network", ""),
("Enable RDP", ""),
("Pin menubar", "Закрепить строку меню"),
("Unpin menubar", "Открепить строку меню"),
].iter().cloned().collect();
}

View File

@ -345,5 +345,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Network", ""),
("Enable RDP", ""),
("Pin menubar", "Pripnúť panel s ponukami"),
("Unpin menubar", "Uvoľniť panel s ponukami"),
].iter().cloned().collect();
}

View File

@ -345,5 +345,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Network", ""),
("Enable RDP", ""),
("Pin menubar", ""),
("Unpin menubar", ""),
].iter().cloned().collect();
}

View File

@ -358,5 +358,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Network", ""),
("Enable RDP", ""),
("Pin menubar", "Menü çubuğunu sabitle"),
("Unpin menubar", "Menü çubuğunun sabitlemesini kaldır"),
].iter().cloned().collect();
}

View File

@ -345,5 +345,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Network", "網絡"),
("Enable RDP", "允許RDP訪問"),
("Pin menubar", "固定菜單欄"),
("Unpin menubar", "取消固定菜單欄"),
].iter().cloned().collect();
}

View File

@ -345,5 +345,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Network", ""),
("Enable RDP", ""),
("Pin menubar", "Ghim thanh menu"),
("Unpin menubar", "Bỏ ghim thanh menu"),
].iter().cloned().collect();
}