Changeset db52892a in mainline
- Timestamp:
- 2021-09-23T22:38:06Z (3 years ago)
- Branches:
- master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c1c7c20
- Parents:
- e2ca44f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/edit/edit.c
re2ca44f rdb52892a 96 96 gfx_color_t *color; 97 97 98 /** Selection color */ 99 gfx_color_t *sel_color; 100 98 101 /* Pane dimensions */ 99 102 int rows, columns; … … 925 928 gfx_rect_t arect; 926 929 930 pane->control = NULL; 931 pane->color = NULL; 932 pane->sel_color = NULL; 933 927 934 rc = ui_control_new(&pane_ctl_ops, (void *) pane, &pane->control); 928 935 if (rc != EOK) 929 return rc;936 goto error; 930 937 931 938 rc = gfx_color_new_ega(0x07, &pane->color); 932 if (rc != EOK) { 933 ui_control_delete(pane->control); 934 return rc; 935 } 939 if (rc != EOK) 940 goto error; 941 942 rc = gfx_color_new_ega(0x1e, &pane->sel_color); 943 if (rc != EOK) 944 goto error; 936 945 937 946 pane->res = ui_window_get_res(window); … … 948 957 949 958 return EOK; 959 error: 960 if (pane->control != NULL) { 961 ui_control_delete(pane->control); 962 pane->control = NULL; 963 } 964 965 if (pane->color != NULL) { 966 gfx_color_delete(pane->color); 967 pane->color = NULL; 968 } 969 970 return rc; 950 971 } 951 972 … … 960 981 gfx_color_delete(pane->color); 961 982 pane->color = NULL; 983 gfx_color_delete(pane->sel_color); 984 pane->sel_color = NULL; 962 985 ui_control_delete(pane->control); 963 986 pane->control = NULL; … … 1108 1131 /* Draw rows from the sheet. */ 1109 1132 1110 // console_set_pos(con, 0, 0);1111 1133 for (i = r0; i < r1; ++i) { 1112 1134 tpos.x = pane->rect.p0.x; … … 1130 1152 if (coord_cmp(&csel_start, &rbc) <= 0 && 1131 1153 coord_cmp(&rbc, &csel_end) < 0) { 1132 // console_flush(con); 1133 // console_set_style(con, STYLE_SELECTED); 1134 // console_flush(con); 1154 fmt.color = pane->sel_color; 1135 1155 } 1136 1156 1137 // console_set_pos(con, 0, i);1138 1157 size = str_size(row_buf); 1139 1158 pos = 0; 1140 1159 s_column = pane->sh_column; 1141 1160 while (pos < size) { 1142 if ((csel_start.row == rbc.row) && (csel_start.column == s_column)) { 1143 // console_flush(con); 1144 // console_set_style(con, STYLE_SELECTED); 1145 // console_flush(con); 1146 } 1147 1148 if ((csel_end.row == rbc.row) && (csel_end.column == s_column)) { 1149 // console_flush(con); 1150 // console_set_style(con, STYLE_NORMAL); 1151 // console_flush(con); 1152 } 1161 if ((csel_start.row == rbc.row) && (csel_start.column == s_column)) 1162 fmt.color = pane->sel_color; 1163 1164 if ((csel_end.row == rbc.row) && (csel_end.column == s_column)) 1165 fmt.color = pane->color; 1153 1166 1154 1167 c = str_decode(row_buf, &pos, size); … … 1187 1200 } 1188 1201 1189 if ((csel_end.row == rbc.row) && (csel_end.column == s_column)) { 1190 // console_flush(con); 1191 // console_set_style(con, STYLE_NORMAL); 1192 // console_flush(con); 1193 } 1202 if ((csel_end.row == rbc.row) && (csel_end.column == s_column)) 1203 fmt.color = pane->color; 1194 1204 1195 1205 /* Fill until the end of display area. */
Note:
See TracChangeset
for help on using the changeset viewer.