mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-20 18:29:19 +03:00
(widget_set_size_rect): reimplement
...to pass given WRect object directly to widget callback withowt constuction/deconstuction of intermediate WRect object. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
b265b388aa
commit
3978dee37c
@ -10,7 +10,7 @@
|
|||||||
Jakub Jelinek, 1995
|
Jakub Jelinek, 1995
|
||||||
Andrej Borsenkow, 1996
|
Andrej Borsenkow, 1996
|
||||||
Norbert Warmuth, 1997
|
Norbert Warmuth, 1997
|
||||||
Andrew Borodin <aborodin@vmail.ru>, 2009, 2010, 2011, 2012, 2013
|
Andrew Borodin <aborodin@vmail.ru>, 2009-2022
|
||||||
|
|
||||||
This file is part of the Midnight Commander.
|
This file is part of the Midnight Commander.
|
||||||
|
|
||||||
@ -447,6 +447,21 @@ widget_set_size (Widget * w, int y, int x, int lines, int cols)
|
|||||||
widget_draw (w);
|
widget_draw (w);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
/**
|
||||||
|
* Change widget position and size.
|
||||||
|
*
|
||||||
|
* @param w widget
|
||||||
|
* @param r WRect obgect that holds position and size
|
||||||
|
*/
|
||||||
|
|
||||||
|
void
|
||||||
|
widget_set_size_rect (Widget * w, WRect * r)
|
||||||
|
{
|
||||||
|
send_message (w, NULL, MSG_RESIZE, 0, r);
|
||||||
|
widget_draw (w);
|
||||||
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -210,6 +210,7 @@ cb_ret_t widget_default_callback (Widget * w, Widget * sender, widget_msg_t msg,
|
|||||||
void widget_set_options (Widget * w, widget_options_t options, gboolean enable);
|
void widget_set_options (Widget * w, widget_options_t options, gboolean enable);
|
||||||
void widget_adjust_position (widget_pos_flags_t pos_flags, int *y, int *x, int *lines, int *cols);
|
void widget_adjust_position (widget_pos_flags_t pos_flags, int *y, int *x, int *lines, int *cols);
|
||||||
void widget_set_size (Widget * w, int y, int x, int lines, int cols);
|
void widget_set_size (Widget * w, int y, int x, int lines, int cols);
|
||||||
|
void widget_set_size_rect (Widget * w, WRect * r);
|
||||||
/* select color for widget in dependance of state */
|
/* select color for widget in dependance of state */
|
||||||
void widget_selectcolor (Widget * w, gboolean focused, gboolean hotkey);
|
void widget_selectcolor (Widget * w, gboolean focused, gboolean hotkey);
|
||||||
cb_ret_t widget_draw (Widget * w);
|
cb_ret_t widget_draw (Widget * w);
|
||||||
@ -426,14 +427,6 @@ widget_update_cursor (Widget * w)
|
|||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
static inline void
|
|
||||||
widget_set_size_rect (Widget * w, const WRect * r)
|
|
||||||
{
|
|
||||||
widget_set_size (w, r->y, r->x, r->lines, r->cols);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
widget_show (Widget * w)
|
widget_show (Widget * w)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user