diff options
author | Dan Winship <danw@gnome.org> | 2014-02-06 16:01:14 +0100 |
---|---|---|
committer | Dan Winship <danw@gnome.org> | 2014-02-17 15:30:04 -0500 |
commit | fae47c19169309bbce7d05e82a25c88635c0b307 (patch) | |
tree | d935e4eb161cc8abdd6dfe6db0b186413b1a7e03 | |
parent | 6ee48dc964b27788da4375a65c05815d22985b5e (diff) | |
download | NetworkManager-fae47c19169309bbce7d05e82a25c88635c0b307.tar.gz |
tui: don't expand editor form to fullscreen horizontally
The form doesn't make use of the extra horizontal space, so it looks
bad to expand it rather than centering it.
-rw-r--r-- | tui/newt/nmt-newt-form.c | 44 | ||||
-rw-r--r-- | tui/nmt-editor.c | 2 |
2 files changed, 45 insertions, 1 deletions
diff --git a/tui/newt/nmt-newt-form.c b/tui/newt/nmt-newt-form.c index 8191c75ea4..4b02003e73 100644 --- a/tui/newt/nmt-newt-form.c +++ b/tui/newt/nmt-newt-form.c @@ -62,6 +62,8 @@ enum { PROP_0, PROP_TITLE, PROP_FULLSCREEN, + PROP_FULLSCREEN_VERTICAL, + PROP_FULLSCREEN_HORIZONTAL, PROP_X, PROP_Y, PROP_WIDTH, @@ -471,6 +473,24 @@ nmt_newt_form_set_property (GObject *object, priv->fixed_width = priv->fixed_height = TRUE; } break; + case PROP_FULLSCREEN_VERTICAL: + if (g_value_get_boolean (value)) { + newtGetScreenSize (&screen_width, &screen_height); + priv->y = 2; + priv->fixed_y = TRUE; + priv->height = screen_height - 4; + priv->fixed_height = TRUE; + } + break; + case PROP_FULLSCREEN_HORIZONTAL: + if (g_value_get_boolean (value)) { + newtGetScreenSize (&screen_width, &screen_height); + priv->x = 2; + priv->fixed_x = TRUE; + priv->width = screen_width - 4; + priv->fixed_width = TRUE; + } + break; case PROP_X: if (g_value_get_uint (value)) { priv->x = g_value_get_uint (value); @@ -607,6 +627,30 @@ nmt_newt_form_class_init (NmtNewtFormClass *form_class) G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY)); /** + * NmtNewtForm:fullscreen-vertical: + * + * If %TRUE, the form will fill the entire "screen" (ie, terminal + * window) vertically, but not necessarily horizontally. + */ + g_object_class_install_property (object_class, PROP_FULLSCREEN_VERTICAL, + g_param_spec_boolean ("fullscreen-vertical", "", "", + FALSE, + G_PARAM_WRITABLE | + G_PARAM_STATIC_STRINGS | + G_PARAM_CONSTRUCT_ONLY)); + /** + * NmtNewtForm:fullscreen-horizontal: + * + * If %TRUE, the form will fill the entire "screen" (ie, terminal + * window) horizontally, but not necessarily vertically. + */ + g_object_class_install_property (object_class, PROP_FULLSCREEN_HORIZONTAL, + g_param_spec_boolean ("fullscreen-horizontal", "", "", + FALSE, + G_PARAM_WRITABLE | + G_PARAM_STATIC_STRINGS | + G_PARAM_CONSTRUCT_ONLY)); + /** * NmtNewtForm:x: * * The form's x coordinate. By default, the form will be centered diff --git a/tui/nmt-editor.c b/tui/nmt-editor.c index aa46cc1a8b..c570842a42 100644 --- a/tui/nmt-editor.c +++ b/tui/nmt-editor.c @@ -93,7 +93,7 @@ nmt_editor_new (NMConnection *connection) "connection", connection, "type-data", type_data, "title", _("Edit connection"), - "fullscreen", TRUE, + "fullscreen-vertical", TRUE, NULL); } |