universal-access: Parent zoom options to panel
This commit is contained in:
parent
77abe0eced
commit
f60e2fa4ae
4 changed files with 21 additions and 14 deletions
|
@ -49,7 +49,7 @@ struct _CcUaPanelPrivate
|
|||
GSettings *application_settings;
|
||||
GSettings *mediakeys_settings;
|
||||
|
||||
GObject *zoom_options;
|
||||
ZoomOptions *zoom_options;
|
||||
};
|
||||
|
||||
|
||||
|
@ -205,10 +205,11 @@ static void
|
|||
zoom_options_launch_cb (GtkWidget *options_button, CcUaPanel *self)
|
||||
{
|
||||
if (self->priv->zoom_options == NULL)
|
||||
self->priv->zoom_options = g_object_new (ZOOM_TYPE_OPTIONS, NULL);
|
||||
self->priv->zoom_options = zoom_options_new ();
|
||||
|
||||
if (self->priv->zoom_options != NULL)
|
||||
zoom_options_present_dialog (ZOOM_OPTIONS (self->priv->zoom_options));
|
||||
zoom_options_set_parent (self->priv->zoom_options,
|
||||
GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (self))));
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -475,8 +475,7 @@ zoom_options_init (ZoomOptions *self)
|
|||
|
||||
/* ... Window itself ... */
|
||||
priv->dialog = WID ("magPrefsDialog");
|
||||
gtk_window_set_position (GTK_WINDOW (priv->dialog),
|
||||
GTK_WIN_POS_CENTER);
|
||||
|
||||
w = WID ("closeButton");
|
||||
g_signal_connect (G_OBJECT (w), "clicked",
|
||||
G_CALLBACK (zoom_option_close_dialog_cb),
|
||||
|
@ -486,21 +485,28 @@ zoom_options_init (ZoomOptions *self)
|
|||
NULL);
|
||||
|
||||
pango_attr_list_unref (pango_attrs);
|
||||
|
||||
zoom_options_present_dialog (self);
|
||||
}
|
||||
|
||||
/**
|
||||
* zoom_options_present_dialog:
|
||||
* zoom_options_set_parent:
|
||||
* @self: the #ZoomOptions object
|
||||
* @parent: the parent #GtkWindow
|
||||
*
|
||||
* Activate the dialog associated with this ZoomOptions.
|
||||
*/
|
||||
void
|
||||
zoom_options_present_dialog (ZoomOptions *self)
|
||||
zoom_options_set_parent (ZoomOptions *self,
|
||||
GtkWindow *parent)
|
||||
{
|
||||
g_return_if_fail (ZOOM_IS_OPTIONS (self));
|
||||
|
||||
if (self->priv->dialog != NULL)
|
||||
gtk_window_present (GTK_WINDOW (self->priv->dialog));
|
||||
gtk_window_set_transient_for (GTK_WINDOW (self->priv->dialog), parent);
|
||||
gtk_window_set_modal (GTK_WINDOW (self->priv->dialog), TRUE);
|
||||
gtk_widget_show (self->priv->dialog);
|
||||
}
|
||||
|
||||
ZoomOptions *
|
||||
zoom_options_new (void)
|
||||
{
|
||||
return g_object_new (ZOOM_TYPE_OPTIONS, NULL);
|
||||
}
|
||||
|
|
|
@ -66,7 +66,9 @@ struct _ZoomOptions
|
|||
|
||||
GType zoom_options_get_type (void) G_GNUC_CONST;
|
||||
|
||||
void zoom_options_present_dialog (ZoomOptions *self);
|
||||
ZoomOptions *zoom_options_new (void);
|
||||
void zoom_options_set_parent (ZoomOptions *self,
|
||||
GtkWindow *parent);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
|
|
@ -21,8 +21,6 @@
|
|||
<property name="border_width">5</property>
|
||||
<property name="title" translatable="yes">Zoom Options</property>
|
||||
<property name="resizable">False</property>
|
||||
<property name="window_position">center-on-parent</property>
|
||||
<property name="type_hint">normal</property>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox" id="dialog-vbox1">
|
||||
<property name="visible">True</property>
|
||||
|
|
Loading…
Add table
Reference in a new issue