mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-11 03:43:29 +00:00
better
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@818 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -245,38 +245,38 @@ static void frame_draw(MwWidget handle) {
|
|||||||
p.x = MwDefaultBorderWidth(handle) + MwGetInteger(handle->parent, MwNleftPadding);
|
p.x = MwDefaultBorderWidth(handle) + MwGetInteger(handle->parent, MwNleftPadding);
|
||||||
for(j = 0; j < arrlen(lb->list[i].name); j++) {
|
for(j = 0; j < arrlen(lb->list[i].name); j++) {
|
||||||
char* t = lb->list[i].name[j];
|
char* t = lb->list[i].name[j];
|
||||||
|
char* str;
|
||||||
|
int l = (j == 0 ? MwGetInteger(handle->parent, MwNleftPadding) : 0);
|
||||||
|
|
||||||
if(t == NULL) t = "";
|
if(t == NULL) t = "";
|
||||||
|
|
||||||
if(j == (arrlen(lb->list[i].name) - 1)) p.x -= MwDefaultBorderWidth(handle);
|
str = MwStringDuplicate(t);
|
||||||
if(arrlen(lb->alignment) <= j || lb->alignment[j] == MwALIGNMENT_BEGINNING) {
|
|
||||||
char* str = MwStringDuplicate(t);
|
|
||||||
int l = (j == 0 ? MwGetInteger(handle->parent, MwNleftPadding) : 0);
|
|
||||||
|
|
||||||
if(MwUTF8Length(str) > (get_col_width(lb, j) - l) / MwTextWidth(handle, "M")) {
|
if(MwUTF8Length(str) > (get_col_width(lb, j) - l) / MwTextWidth(handle, "M")) {
|
||||||
int ind = (get_col_width(lb, j) - l) / MwTextWidth(handle, "M");
|
int ind = (get_col_width(lb, j) - l) / MwTextWidth(handle, "M");
|
||||||
str[ind] = 0;
|
str[ind] = 0;
|
||||||
if(ind > 3) memset(str + ind - 3, '.', 3);
|
if(ind > 3) memset(str + ind - 3, '.', 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(j == (arrlen(lb->list[i].name) - 1)) p.x -= MwDefaultBorderWidth(handle);
|
||||||
|
if(arrlen(lb->alignment) <= j || lb->alignment[j] == MwALIGNMENT_BEGINNING) {
|
||||||
|
|
||||||
p.x += 4;
|
p.x += 4;
|
||||||
MwDrawText(handle, &p, str, 0, MwALIGNMENT_BEGINNING, selected ? base2 : text2);
|
MwDrawText(handle, &p, str, 0, MwALIGNMENT_BEGINNING, selected ? base2 : text2);
|
||||||
p.x -= 4;
|
p.x -= 4;
|
||||||
p.x += get_col_width(lb, j);
|
p.x += get_col_width(lb, j);
|
||||||
|
|
||||||
free(str);
|
|
||||||
} else if(lb->alignment[j] == MwALIGNMENT_CENTER) {
|
} else if(lb->alignment[j] == MwALIGNMENT_CENTER) {
|
||||||
int l = (j == 0 ? MwGetInteger(handle->parent, MwNleftPadding) : 0);
|
|
||||||
p.x += (get_col_width(lb, j) - l) / 2;
|
p.x += (get_col_width(lb, j) - l) / 2;
|
||||||
MwDrawText(handle, &p, t, 0, MwALIGNMENT_CENTER, selected ? base2 : text2);
|
MwDrawText(handle, &p, str, 0, MwALIGNMENT_CENTER, selected ? base2 : text2);
|
||||||
p.x += (get_col_width(lb, j) - l) / 2;
|
p.x += (get_col_width(lb, j) - l) / 2;
|
||||||
p.x += l;
|
p.x += l;
|
||||||
} else if(lb->alignment[j] == MwALIGNMENT_END) {
|
} else if(lb->alignment[j] == MwALIGNMENT_END) {
|
||||||
p.x += get_col_width(lb, j);
|
p.x += get_col_width(lb, j);
|
||||||
p.x -= 4;
|
p.x -= 4;
|
||||||
MwDrawText(handle, &p, t, 0, MwALIGNMENT_END, selected ? base2 : text2);
|
MwDrawText(handle, &p, str, 0, MwALIGNMENT_END, selected ? base2 : text2);
|
||||||
p.x += 4;
|
p.x += 4;
|
||||||
}
|
}
|
||||||
|
free(str);
|
||||||
|
|
||||||
if(j == 0) p.x -= MwGetInteger(handle->parent, MwNleftPadding);
|
if(j == 0) p.x -= MwGetInteger(handle->parent, MwNleftPadding);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user