Browse Source

样式又调整了一波

master
hejl 3 weeks ago
parent
commit
77760d6a21
  1. 21
      win_text_editor/lib/modules/code_creater/widgets/node_table.dart
  2. 2
      win_text_editor/lib/modules/xml_search/widgets/results_view.dart
  3. 4
      win_text_editor/lib/shared/components/my_pluto_column.dart
  4. 13
      win_text_editor/lib/shared/components/my_pluto_configuration.dart
  5. 20
      win_text_editor/lib/shared/components/my_pluto_dropdown_column.dart

21
win_text_editor/lib/modules/code_creater/widgets/node_table.dart

@ -81,6 +81,12 @@ class _NodeTableState extends State<NodeTable> { @@ -81,6 +81,12 @@ class _NodeTableState extends State<NodeTable> {
onRowDoubleTap: (event) {
_selectedRowIndex = event.rowIdx;
},
rowColorCallback: (rowContext) {
//
return rowContext.stateManager.currentRow?.key == rowContext.row.key
? Colors.blue[200]! //
: Colors.white; // null
},
),
),
),
@ -163,12 +169,23 @@ class _NodeTableState extends State<NodeTable> { @@ -163,12 +169,23 @@ class _NodeTableState extends State<NodeTable> {
List<PlutoColumn> _buildColumns() {
return [
MyPlutoColumn(title: '#', field: 'rowNum', width: 40),
MyPlutoColumn(title: '成员', field: 'content', width: 300),
MyPlutoColumn(
title: '#',
field: 'rowNum',
width: 40,
enableRowChecked: false, //
),
MyPlutoColumn(
title: '成员',
field: 'content',
width: 300,
enableRowChecked: false, //
),
MyPlutoDropdownColumn(
title: '操作类型',
field: 'type',
width: 120,
enableRowChecked: false, //
optionsBuilder: (rowKey) {
final data = _nodeTypeData[rowKey as ValueKey];
return _getOptions(data?.originalType ?? '');

2
win_text_editor/lib/modules/xml_search/widgets/results_view.dart

@ -139,7 +139,7 @@ class _ResultsViewState extends State<ResultsView> { @@ -139,7 +139,7 @@ class _ResultsViewState extends State<ResultsView> {
List<PlutoColumn> _buildColumns() {
return [
MyPlutoColumn(title: '#', field: 'rowNum', width: 60, checkable: true),
MyPlutoColumn(title: '#', field: 'rowNum', width: 60, enableRowChecked: true),
MyPlutoColumn(
title: '搜索内容',
field: 'content',

4
win_text_editor/lib/shared/components/my_pluto_column.dart

@ -8,7 +8,7 @@ class MyPlutoColumn extends PlutoColumn { @@ -8,7 +8,7 @@ class MyPlutoColumn extends PlutoColumn {
dynamic type,
double width = 80,
bool editable = false,
bool checkable = false,
bool enableRowChecked = false,
bool enableSorting = false,
bool autoSize = false,
Widget Function(PlutoColumnRendererContext)? renderer,
@ -18,7 +18,7 @@ class MyPlutoColumn extends PlutoColumn { @@ -18,7 +18,7 @@ class MyPlutoColumn extends PlutoColumn {
field: field,
type: type ?? PlutoColumnType.text(defaultValue: ''),
width: width,
enableRowChecked: checkable,
enableRowChecked: enableRowChecked,
enableContextMenu: false,
enableEditingMode: editable,
enableSorting: enableSorting,

13
win_text_editor/lib/shared/components/my_pluto_configuration.dart

@ -6,12 +6,21 @@ import 'package:pluto_grid/pluto_grid.dart'; @@ -6,12 +6,21 @@ import 'package:pluto_grid/pluto_grid.dart';
class MyPlutoGridConfiguration extends PlutoGridConfiguration {
MyPlutoGridConfiguration()
: super(
style: const PlutoGridStyleConfig(
style: PlutoGridStyleConfig(
rowHeight: 32,
columnHeight: 32,
iconColor: Colors.transparent,
gridBorderRadius: BorderRadius.zero,
columnTextStyle: TextStyle(
enableGridBorderShadow: true,
gridBorderColor: Colors.grey,
activatedColor: Colors.blue[200]!,
activatedBorderColor: Colors.grey!,
inactivatedBorderColor: Colors.grey,
gridBackgroundColor: Colors.white,
cellColorInEditState: Colors.white,
defaultCellPadding: const EdgeInsets.all(8),
cellTextStyle: const TextStyle(color: Colors.black),
columnTextStyle: const TextStyle(
color: Colors.black,
fontSize: 14,
fontWeight: FontWeight.normal,

20
win_text_editor/lib/shared/components/my_pluto_dropdown_column.dart

@ -9,7 +9,7 @@ class MyPlutoDropdownColumn extends PlutoColumn { @@ -9,7 +9,7 @@ class MyPlutoDropdownColumn extends PlutoColumn {
required String field,
this.optionsBuilder,
double width = 200,
bool checkable = false,
bool enableRowChecked = false,
bool enableSorting = false,
bool autoSize = false,
PlutoColumnTextAlign textAlign = PlutoColumnTextAlign.start,
@ -18,7 +18,7 @@ class MyPlutoDropdownColumn extends PlutoColumn { @@ -18,7 +18,7 @@ class MyPlutoDropdownColumn extends PlutoColumn {
field: field,
type: PlutoColumnType.text(defaultValue: ''),
width: width,
enableRowChecked: checkable,
enableRowChecked: enableRowChecked,
enableContextMenu: false,
enableEditingMode: true,
enableSorting: enableSorting,
@ -33,14 +33,13 @@ class MyPlutoDropdownColumn extends PlutoColumn { @@ -33,14 +33,13 @@ class MyPlutoDropdownColumn extends PlutoColumn {
final currentValue = rendererContext.row.cells[field]!.value.toString();
return DropdownButton<String>(
value: options.contains(currentValue)
value:
options.contains(currentValue)
? currentValue
: (options.isNotEmpty ? options.first : ''),
items: options
.map((value) => DropdownMenuItem(
value: value,
child: Text(value),
))
items:
options
.map((value) => DropdownMenuItem(value: value, child: Text(value)))
.toList(),
onChanged: (newValue) {
if (newValue != null) {
@ -58,10 +57,7 @@ class MyPlutoDropdownColumn extends PlutoColumn { @@ -58,10 +57,7 @@ class MyPlutoDropdownColumn extends PlutoColumn {
iconSize: 24,
isExpanded: true,
underline: Container(), // 线
style: TextStyle(
fontSize: 14,
color: Colors.black87,
),
style: const TextStyle(fontSize: 14, color: Colors.black87),
dropdownColor: Colors.white,
elevation: 2,
borderRadius: BorderRadius.circular(4),

Loading…
Cancel
Save