fix on help tools and tranlating 'Failed'
This commit is contained in:
parent
600f604611
commit
5df90d4fa1
@ -21,7 +21,6 @@ class MyTheme {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final ButtonStyle flatButtonStyle = TextButton.styleFrom(
|
final ButtonStyle flatButtonStyle = TextButton.styleFrom(
|
||||||
primary: MyTheme.accent,
|
|
||||||
minimumSize: Size(88, 36),
|
minimumSize: Size(88, 36),
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16.0),
|
padding: EdgeInsets.symmetric(horizontal: 16.0),
|
||||||
shape: const RoundedRectangleBorder(
|
shape: const RoundedRectangleBorder(
|
||||||
|
@ -741,7 +741,10 @@ final langs = <String, Map<String, String>>{
|
|||||||
'en': <String, String>{}
|
'en': <String, String>{}
|
||||||
};
|
};
|
||||||
|
|
||||||
String translate(name) {
|
String translate(String name) {
|
||||||
|
if (name.startsWith('Failed') && name.contains(':')) {
|
||||||
|
return name.split(': ').map((x) => translate(x)).join(': ');
|
||||||
|
}
|
||||||
final tmp = isCn ? langs['cn'] : langs['en'];
|
final tmp = isCn ? langs['cn'] : langs['en'];
|
||||||
final v = tmp[name];
|
final v = tmp[name];
|
||||||
if (v == null) {
|
if (v == null) {
|
||||||
|
@ -352,26 +352,24 @@ class _RemotePageState extends State<RemotePage> {
|
|||||||
}
|
}
|
||||||
var wrap =
|
var wrap =
|
||||||
(String text, void Function() onPressed, [bool active, IconData icon]) {
|
(String text, void Function() onPressed, [bool active, IconData icon]) {
|
||||||
return ButtonTheme(
|
return TextButton(
|
||||||
padding: EdgeInsets.symmetric(
|
style: TextButton.styleFrom(
|
||||||
vertical: icon != null ? 3 : 6,
|
minimumSize: Size(0, 0),
|
||||||
horizontal: 6), //adds padding inside the button
|
padding: EdgeInsets.symmetric(
|
||||||
materialTapTargetSize: MaterialTapTargetSize
|
vertical: icon != null ? 3 : 6,
|
||||||
.shrinkWrap, //limits the touch area to the button area
|
horizontal: 6), //adds padding inside the button
|
||||||
minWidth: 0, //wraps child's width
|
tapTargetSize: MaterialTapTargetSize
|
||||||
height: 0,
|
.shrinkWrap, //limits the touch area to the button area
|
||||||
child: TextButton(
|
shape: RoundedRectangleBorder(
|
||||||
style: TextButton.styleFrom(
|
borderRadius: BorderRadius.circular(5.0),
|
||||||
shape: RoundedRectangleBorder(
|
),
|
||||||
borderRadius: BorderRadius.circular(5.0),
|
backgroundColor: active == true ? MyTheme.accent80 : null,
|
||||||
),
|
),
|
||||||
primary: active == true ? MyTheme.accent80 : null,
|
child: icon != null
|
||||||
),
|
? Icon(icon, size: 17, color: Colors.white)
|
||||||
child: icon != null
|
: Text(translate(text),
|
||||||
? Icon(icon, size: 17, color: Colors.white)
|
style: TextStyle(color: Colors.white, fontSize: 11)),
|
||||||
: Text(translate(text),
|
onPressed: onPressed);
|
||||||
style: TextStyle(color: Colors.white, fontSize: 11)),
|
|
||||||
onPressed: onPressed));
|
|
||||||
};
|
};
|
||||||
final mouse = <Widget>[
|
final mouse = <Widget>[
|
||||||
wrap('Drag', () {
|
wrap('Drag', () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user