1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

More statusbar size fixes. Shouldn't corrupt entry line anymore.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1343 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-03-04 03:52:17 +00:00 committed by cras
parent a1842e6baa
commit 24e36e0081
3 changed files with 16 additions and 11 deletions

View File

@ -403,8 +403,8 @@ static void statusbar_activity(SBAR_ITEM_REC *item, int ypos)
if (!item->shrinked && item->size != size_needed)
{
/* we need more (or less..) space! */
statusbar_item_resize(item, size_needed);
return;
if (statusbar_item_resize(item, size_needed))
return;
}
if (item->size <= 7)
@ -412,9 +412,9 @@ static void statusbar_activity(SBAR_ITEM_REC *item, int ypos)
move(ypos, item->xpos);
set_color(stdscr, sbar_color_dim); addch('[');
if (act) draw_activity("Act: ", TRUE, !det, item->size-1);
if (act) draw_activity("Act: ", TRUE, !det, item->size-7);
if (act && det) addch(' ');
if (det) draw_activity("Det: ", FALSE, TRUE, item->size-1);
if (det) draw_activity("Det: ", FALSE, TRUE, item->size-7);
set_color(stdscr, sbar_color_dim); addch(']');
screen_refresh(NULL);

View File

@ -231,14 +231,19 @@ SBAR_ITEM_REC *statusbar_item_create(STATUSBAR_REC *bar, int size, int right_jus
return rec;
}
void statusbar_item_resize(SBAR_ITEM_REC *item, int size)
int statusbar_item_resize(SBAR_ITEM_REC *item, int size)
{
g_return_if_fail(item != NULL);
g_return_val_if_fail(item != NULL, FALSE);
if (size <= item_max_size) {
item->size = size;
statusbar_redraw_all();
}
if (item->size >= item_max_size)
return FALSE;
if (size > item_max_size)
size = item_max_size;
item->size = size;
statusbar_redraw_all();
return TRUE;
}
void statusbar_item_remove(SBAR_ITEM_REC *item)

View File

@ -33,7 +33,7 @@ void statusbar_destroy(STATUSBAR_REC *bar);
STATUSBAR_REC *statusbar_find(int pos, int line);
SBAR_ITEM_REC *statusbar_item_create(STATUSBAR_REC *bar, int size, gboolean right_justify, STATUSBAR_FUNC func);
void statusbar_item_resize(SBAR_ITEM_REC *item, int size);
int statusbar_item_resize(SBAR_ITEM_REC *item, int size);
void statusbar_item_remove(SBAR_ITEM_REC *item);
/* redraw statusbar, NULL = all */