1
1

* dialog.h (widget_msg_t): Added WIDGET_RESIZED to inform widgets

that they had been resized.
	* dialog.c (widget_set_size): Send a WIDGET_RESIZED message after
	setting the size.
	* layout.c (panel_do_cols): Don't explicitly update the
	bytes_per_line of a hexview WView.
	* view.h (view_update_bytes_per_line): Removed from the interface
	to WView.
	* view.c (view_update_bytes_per_line): Declared as `static'.
	* view.c (view_callback): Call update_bytes_per_line when the
	WView is initialized and whenever a WIDGET_RESIZED message is
	received.
Этот коммит содержится в:
Roland Illig 2005-01-25 22:40:50 +00:00
родитель fe0cc18988
Коммит ccc1b17f7d
6 изменённых файлов: 25 добавлений и 8 удалений

Просмотреть файл

@ -1,3 +1,18 @@
2005-01-25 Roland Illig <roland.illig@gmx.de>
* dialog.h (widget_msg_t): Added WIDGET_RESIZED to inform widgets
that they had been resized.
* dialog.c (widget_set_size): Send a WIDGET_RESIZED message after
setting the size.
* layout.c (panel_do_cols): Don't explicitly update the
bytes_per_line of a hexview WView.
* view.h (view_update_bytes_per_line): Removed from the interface
to WView.
* view.c (view_update_bytes_per_line): Declared as `static'.
* view.c (view_callback): Call update_bytes_per_line when the
WView is initialized and whenever a WIDGET_RESIZED message is
received.
2005-01-19 Jindrich Novy <jnovy@redhat.com>
* main.c (_do_panel_cd): Delete leading spaces from URL

Просмотреть файл

@ -819,6 +819,7 @@ void widget_set_size (Widget *widget, int y, int x, int lines, int cols)
widget->y = y;
widget->cols = cols;
widget->lines = lines;
send_message (widget, WIDGET_RESIZED, 0 /* unused */);
}
/* Replace widget old_w for widget new_w in the dialog h */

Просмотреть файл

@ -44,7 +44,8 @@ typedef enum {
WIDGET_HOTKEY, /* Sent to widget to catch preprocess key */
WIDGET_DESTROY, /* Sent to widget at destruction time */
WIDGET_CURSOR, /* Sent to widget to position the cursor */
WIDGET_IDLE, /* Send to widgets with options & W_WANT_IDLE*/
WIDGET_IDLE, /* Sent to widgets with options & W_WANT_IDLE*/
WIDGET_RESIZED, /* Sent after a widget has been resized */
} widget_msg_t;
typedef enum {

Просмотреть файл

@ -633,10 +633,6 @@ panel_do_cols (int index)
set_panel_formats ((WPanel *) panels [index].widget);
else {
panel_update_cols (panels [index].widget, frame_half);
/* In case of an Hex Quick View must review line length */
if (get_display_type (index) == view_quick)
view_update_bytes_per_line ((WView *) panels [index].widget);
}
}

Просмотреть файл

@ -753,7 +753,7 @@ do_view_init (WView *view, const char *_command, const char *_file,
return 0;
}
void
static void
view_update_bytes_per_line (WView *view)
{
int cols;
@ -2734,6 +2734,8 @@ view_callback (WView *view, widget_msg_t msg, int parm)
cb_ret_t i;
Dlg_head *h = view->widget.parent;
view_update_bytes_per_line (view);
switch (msg) {
case WIDGET_INIT:
view_update_bytes_per_line (view);
@ -2781,6 +2783,10 @@ view_callback (WView *view, widget_msg_t msg, int parm)
delete_hook (&select_file_hook, view_hook);
return MSG_HANDLED;
case WIDGET_RESIZED:
view_update_bytes_per_line (view);
/* FALLTROUGH */
default:
return default_proc (msg, parm);
}

Просмотреть файл

@ -9,8 +9,6 @@ WView *view_new (int y, int x, int cols, int lines, int is_panel);
int view_init (WView *view, const char *_command, const char *_file,
int start_line);
void view_update_bytes_per_line (WView *view);
/* Command: view a _file, if _command != NULL we use popen on _command */
/* move direction should be a pointer that will hold the direction in which */
/* the user wants to move (-1 previous file, 1 next file, 0 do nothing) */