mirror of
https://github.com/irssi/irssi.git
synced 2025-01-03 14:56:47 -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:
parent
a1842e6baa
commit
24e36e0081
@ -403,7 +403,7 @@ static void statusbar_activity(SBAR_ITEM_REC *item, int ypos)
|
|||||||
if (!item->shrinked && item->size != size_needed)
|
if (!item->shrinked && item->size != size_needed)
|
||||||
{
|
{
|
||||||
/* we need more (or less..) space! */
|
/* we need more (or less..) space! */
|
||||||
statusbar_item_resize(item, size_needed);
|
if (statusbar_item_resize(item, size_needed))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -412,9 +412,9 @@ static void statusbar_activity(SBAR_ITEM_REC *item, int ypos)
|
|||||||
|
|
||||||
move(ypos, item->xpos);
|
move(ypos, item->xpos);
|
||||||
set_color(stdscr, sbar_color_dim); addch('[');
|
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 (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(']');
|
set_color(stdscr, sbar_color_dim); addch(']');
|
||||||
|
|
||||||
screen_refresh(NULL);
|
screen_refresh(NULL);
|
||||||
|
@ -231,14 +231,19 @@ SBAR_ITEM_REC *statusbar_item_create(STATUSBAR_REC *bar, int size, int right_jus
|
|||||||
return rec;
|
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 (item->size >= item_max_size)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (size > item_max_size)
|
||||||
|
size = item_max_size;
|
||||||
|
|
||||||
if (size <= item_max_size) {
|
|
||||||
item->size = size;
|
item->size = size;
|
||||||
statusbar_redraw_all();
|
statusbar_redraw_all();
|
||||||
}
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void statusbar_item_remove(SBAR_ITEM_REC *item)
|
void statusbar_item_remove(SBAR_ITEM_REC *item)
|
||||||
|
@ -33,7 +33,7 @@ void statusbar_destroy(STATUSBAR_REC *bar);
|
|||||||
STATUSBAR_REC *statusbar_find(int pos, int line);
|
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);
|
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);
|
void statusbar_item_remove(SBAR_ITEM_REC *item);
|
||||||
|
|
||||||
/* redraw statusbar, NULL = all */
|
/* redraw statusbar, NULL = all */
|
||||||
|
Loading…
Reference in New Issue
Block a user