mirror of https://github.com/MidnightCommander/mc
Buttonbar: use WST_VISIBLE state
...instead of WButtonBar::visible member. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
0e75e85598
commit
913403b10c
|
@ -173,7 +173,7 @@ buttonbar_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, voi
|
|||
return MSG_NOT_HANDLED;
|
||||
|
||||
case MSG_DRAW:
|
||||
if (bb->visible)
|
||||
if (widget_get_state (w, WST_VISIBLE))
|
||||
{
|
||||
buttonbar_init_button_positions (bb);
|
||||
widget_gotoyx (w, 0, 0);
|
||||
|
@ -238,7 +238,7 @@ buttonbar_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event)
|
|||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
WButtonBar *
|
||||
buttonbar_new (gboolean visible)
|
||||
buttonbar_new (void)
|
||||
{
|
||||
WButtonBar *bb;
|
||||
Widget *w;
|
||||
|
@ -248,7 +248,6 @@ buttonbar_new (gboolean visible)
|
|||
widget_init (w, LINES - 1, 0, 1, COLS, buttonbar_callback, buttonbar_mouse_callback);
|
||||
|
||||
w->pos_flags = WPOS_KEEP_HORZ | WPOS_KEEP_BOTTOM;
|
||||
bb->visible = visible;
|
||||
widget_want_hotkey (w, TRUE);
|
||||
|
||||
return bb;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
typedef struct WButtonBar
|
||||
{
|
||||
Widget widget;
|
||||
gboolean visible; /* Is it visible? */
|
||||
|
||||
struct
|
||||
{
|
||||
char *text;
|
||||
|
@ -36,17 +36,11 @@ typedef struct WButtonBar
|
|||
|
||||
/*** declarations of public functions ************************************************************/
|
||||
|
||||
WButtonBar *buttonbar_new (gboolean visible);
|
||||
WButtonBar *buttonbar_new (void);
|
||||
void buttonbar_set_label (WButtonBar * bb, int idx, const char *text,
|
||||
const global_keymap_t * keymap, Widget * receiver);
|
||||
WButtonBar *find_buttonbar (const WDialog * h);
|
||||
|
||||
/*** inline functions ****************************************************************************/
|
||||
|
||||
static inline void
|
||||
buttonbar_set_visible (WButtonBar * bb, gboolean visible)
|
||||
{
|
||||
bb->visible = visible;
|
||||
}
|
||||
|
||||
#endif /* MC__WIDGET_BUTTONBAR_H */
|
||||
|
|
|
@ -3459,7 +3459,7 @@ diff_view (const char *file1, const char *file2, const char *label1, const char
|
|||
w->keymap = diff_map;
|
||||
group_add_widget_autopos (g, w, WPOS_KEEP_ALL, NULL);
|
||||
|
||||
w = WIDGET (buttonbar_new (TRUE));
|
||||
w = WIDGET (buttonbar_new ());
|
||||
group_add_widget_autopos (g, w, w->pos_flags, NULL);
|
||||
|
||||
dview_dlg->get_title = dview_get_title;
|
||||
|
|
|
@ -1262,7 +1262,7 @@ edit_files (const GList * files)
|
|||
group_add_widget_autopos (g, w, w->pos_flags, NULL);
|
||||
edit_init_menu (menubar);
|
||||
|
||||
w = WIDGET (buttonbar_new (TRUE));
|
||||
w = WIDGET (buttonbar_new ());
|
||||
group_add_widget_autopos (g, w, w->pos_flags, NULL);
|
||||
|
||||
for (file = files; file != NULL; file = g_list_next (file))
|
||||
|
|
|
@ -1082,7 +1082,7 @@ tree_box (const char *current_dir)
|
|||
mytree = tree_new (2, 2, wd->lines - 6, wd->cols - 5, FALSE);
|
||||
group_add_widget_autopos (g, mytree, WPOS_KEEP_ALL, NULL);
|
||||
group_add_widget_autopos (g, hline_new (wd->lines - 4, 1, -1), WPOS_KEEP_BOTTOM, NULL);
|
||||
bar = buttonbar_new (TRUE);
|
||||
bar = buttonbar_new ();
|
||||
group_add_widget (g, bar);
|
||||
/* restore ButtonBar coordinates after add_widget() */
|
||||
WIDGET (bar)->x = 0;
|
||||
|
|
|
@ -939,7 +939,7 @@ create_file_manager (void)
|
|||
the_prompt->transparent = TRUE;
|
||||
group_add_widget (g, the_prompt);
|
||||
|
||||
the_bar = buttonbar_new (mc_global.keybar_visible);
|
||||
the_bar = buttonbar_new ();
|
||||
group_add_widget (g, the_bar);
|
||||
midnight_set_buttonbar (the_bar);
|
||||
}
|
||||
|
|
|
@ -895,9 +895,8 @@ setup_panels (void)
|
|||
widget_set_size (WIDGET (the_prompt), mw->lines, mw->cols, 0, 0);
|
||||
}
|
||||
|
||||
widget_set_size (WIDGET (the_bar), mw->lines - 1, mw->x, mc_global.keybar_visible ? 1 : 0,
|
||||
mw->cols);
|
||||
buttonbar_set_visible (the_bar, mc_global.keybar_visible);
|
||||
widget_set_size (WIDGET (the_bar), mw->lines - 1, mw->x, 1, mw->cols);
|
||||
widget_set_visibility (WIDGET (the_bar), mc_global.keybar_visible);
|
||||
|
||||
update_xterm_title_path ();
|
||||
}
|
||||
|
|
|
@ -1153,14 +1153,14 @@ help_interactive_display (const gchar * event_group_name, const gchar * event_na
|
|||
history[history_ptr].link = selected_item;
|
||||
}
|
||||
|
||||
help_bar = buttonbar_new (TRUE);
|
||||
help_bar = buttonbar_new ();
|
||||
WIDGET (help_bar)->y -= wh->y;
|
||||
WIDGET (help_bar)->x -= wh->x;
|
||||
|
||||
md = mousedispatch_new (1, 1, help_lines, HELP_WINDOW_WIDTH - 2);
|
||||
|
||||
group_add_widget (g, md);
|
||||
group_add_widget (g, help_bar);
|
||||
group_add_widget (g, help_bar); /* FIXME */
|
||||
|
||||
buttonbar_set_label (help_bar, 1, Q_ ("ButtonBar|Help"), wh->keymap, NULL);
|
||||
buttonbar_set_label (help_bar, 2, Q_ ("ButtonBar|Index"), wh->keymap, NULL);
|
||||
|
|
|
@ -250,7 +250,7 @@ mcview_viewer (const char *command, const vfs_path_t * file_vpath, int start_lin
|
|||
lc_mcview = mcview_new (vw->y, vw->x, vw->lines - 1, vw->cols, FALSE);
|
||||
group_add_widget_autopos (g, lc_mcview, WPOS_KEEP_ALL, NULL);
|
||||
|
||||
b = WIDGET (buttonbar_new (TRUE));
|
||||
b = WIDGET (buttonbar_new ());
|
||||
group_add_widget_autopos (g, b, b->pos_flags, NULL);
|
||||
|
||||
view_dlg->get_title = mcview_get_title;
|
||||
|
|
Loading…
Reference in New Issue