|
@@ -188,6 +188,11 @@ class LeftSiderSelectMeasureState extends FState<LeftSiderSelectMeasure> {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ void _onShowItemTransStateChanged(_, e) {
|
|
|
+ setState(() {});
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
void _onRightClickFinishMeasure(_, e) {
|
|
|
if (activeItemIndex == -1) {
|
|
@@ -216,6 +221,8 @@ class LeftSiderSelectMeasureState extends FState<LeftSiderSelectMeasure> {
|
|
|
void initState() {
|
|
|
measureData.curItemMetaListChanged.addListener(_onCurItemMetaListChanged);
|
|
|
measureData.itemMetaListChanged.addListener(_onItemMetaListChanged);
|
|
|
+ measureData.showItemTransStateChanged
|
|
|
+ .addListener(_onShowItemTransStateChanged);
|
|
|
measureHandler.onRightClickFinishMeasure
|
|
|
.addListener(_onRightClickFinishMeasure);
|
|
|
WidgetsBinding.instance.addPostFrameCallback((call) {
|
|
@@ -232,6 +239,8 @@ class LeftSiderSelectMeasureState extends FState<LeftSiderSelectMeasure> {
|
|
|
measureData.curItemMetaListChanged
|
|
|
.removeListener(_onCurItemMetaListChanged);
|
|
|
measureData.itemMetaListChanged.removeListener(_onItemMetaListChanged);
|
|
|
+ measureData.showItemTransStateChanged
|
|
|
+ .removeListener(_onShowItemTransStateChanged);
|
|
|
measureHandler.onRightClickFinishMeasure
|
|
|
.removeListener(_onRightClickFinishMeasure);
|
|
|
final item = application.activeMeasureItem;
|
|
@@ -286,9 +295,11 @@ class LeftSiderSelectMeasureState extends FState<LeftSiderSelectMeasure> {
|
|
|
|
|
|
FWidget _buildItemButton(int itemIndex) {
|
|
|
final itemMeta = measureData.curItemMetaList[itemIndex];
|
|
|
- final ifShowCN = i18nBook.isCurrentChinese &&
|
|
|
- measureLanguage.t('measure', itemMeta.description) !=
|
|
|
- itemMeta.description;
|
|
|
+ final transValue = measureLanguage.t('measure', itemMeta.description);
|
|
|
+
|
|
|
+ final ifShowCN = i18nBook.isCurrentChinese &&
|
|
|
+ transValue != itemMeta.description &&
|
|
|
+ measureData.measureSystemSetting.showAnnotation;
|
|
|
final isActived = itemIndex == activeItemIndex;
|
|
|
return FElevatedButton(
|
|
|
name: itemMeta.name,
|
|
@@ -299,7 +310,7 @@ class LeftSiderSelectMeasureState extends FState<LeftSiderSelectMeasure> {
|
|
|
children: [
|
|
|
if (ifShowCN)
|
|
|
FText(
|
|
|
- measureLanguage.t('measure', itemMeta.description),
|
|
|
+ transValue,
|
|
|
maxLines: 1,
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
style: TextStyle(
|
|
@@ -331,9 +342,11 @@ class LeftSiderSelectMeasureState extends FState<LeftSiderSelectMeasure> {
|
|
|
|
|
|
FWidget _buildItemTitle(int itemIndex) {
|
|
|
final itemMeta = measureData.curItemMetaList[itemIndex];
|
|
|
- final ifShowCN = i18nBook.isCurrentChinese &&
|
|
|
- measureLanguage.t('measure', itemMeta.description) !=
|
|
|
- itemMeta.description;
|
|
|
+ final transValue = measureLanguage.t('measure', itemMeta.description);
|
|
|
+
|
|
|
+ final ifShowCN = i18nBook.isCurrentChinese &&
|
|
|
+ transValue != itemMeta.description &&
|
|
|
+ measureData.measureSystemSetting.showAnnotation;
|
|
|
return FContainer(
|
|
|
decoration: const BoxDecoration(
|
|
|
border: Border(
|
|
@@ -349,7 +362,7 @@ class LeftSiderSelectMeasureState extends FState<LeftSiderSelectMeasure> {
|
|
|
children: [
|
|
|
if (ifShowCN)
|
|
|
FText(
|
|
|
- measureLanguage.t('measure', itemMeta.description),
|
|
|
+ transValue,
|
|
|
maxLines: 1,
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
style: TextStyle(
|