mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 06:28:05 +02:00
tui: add nmt_newt_widget_get_realized(), realize forms properly
NmtNewtForm is an NmtNewtWidget, but previously it was only realizing its child, not itself, which is technically wrong (though it had no noticeable effect until get_realized() was added).
This commit is contained in:
parent
d0c380ea68
commit
1bdc4ba948
3 changed files with 19 additions and 2 deletions
|
|
@ -199,7 +199,7 @@ nmt_newt_form_build (NmtNewtForm *form)
|
|||
int i;
|
||||
|
||||
priv->dirty = FALSE;
|
||||
nmt_newt_widget_realize (priv->content);
|
||||
nmt_newt_widget_realize (NMT_NEWT_WIDGET (form));
|
||||
|
||||
nmt_newt_widget_size_request (priv->content, &form_width, &form_height);
|
||||
newtGetScreenSize (&screen_width, &screen_height);
|
||||
|
|
@ -268,7 +268,7 @@ nmt_newt_form_destroy (NmtNewtForm *form)
|
|||
priv->form = NULL;
|
||||
newtPopWindowNoRefresh ();
|
||||
|
||||
nmt_newt_widget_unrealize (priv->content);
|
||||
nmt_newt_widget_unrealize (NMT_NEWT_WIDGET (form));
|
||||
}
|
||||
|
||||
/* A "normal" newt program would call newtFormRun() to run newt's main loop
|
||||
|
|
|
|||
|
|
@ -132,6 +132,22 @@ nmt_newt_widget_unrealize (NmtNewtWidget *widget)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* nmt_newt_widget_get_realized:
|
||||
* @widget: an #NmtNewtWidget
|
||||
*
|
||||
* Checks if @widget is realized or not.
|
||||
*
|
||||
* Returns: whether @widget is realized.
|
||||
*/
|
||||
gboolean
|
||||
nmt_newt_widget_get_realized (NmtNewtWidget *widget)
|
||||
{
|
||||
NmtNewtWidgetPrivate *priv = NMT_NEWT_WIDGET_GET_PRIVATE (widget);
|
||||
|
||||
return priv->realized;
|
||||
}
|
||||
|
||||
/**
|
||||
* nmt_newt_widget_get_components:
|
||||
* @widget: an #NmtNewtWidget
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ GType nmt_newt_widget_get_type (void);
|
|||
|
||||
void nmt_newt_widget_realize (NmtNewtWidget *widget);
|
||||
void nmt_newt_widget_unrealize (NmtNewtWidget *widget);
|
||||
gboolean nmt_newt_widget_get_realized (NmtNewtWidget *widget);
|
||||
|
||||
newtComponent *nmt_newt_widget_get_components (NmtNewtWidget *widget);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue