universal-access: Hide zoom options when not in shell
https://bugzilla.gnome.org/show_bug.cgi?id=671386
This commit is contained in:
parent
d378dbae48
commit
c48536c102
2 changed files with 36 additions and 1 deletions
|
@ -50,6 +50,7 @@ struct _CcUaPanelPrivate
|
||||||
GSettings *mediakeys_settings;
|
GSettings *mediakeys_settings;
|
||||||
|
|
||||||
ZoomOptions *zoom_options;
|
ZoomOptions *zoom_options;
|
||||||
|
guint shell_watch_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -84,6 +85,12 @@ cc_ua_panel_dispose (GObject *object)
|
||||||
{
|
{
|
||||||
CcUaPanelPrivate *priv = CC_UA_PANEL (object)->priv;
|
CcUaPanelPrivate *priv = CC_UA_PANEL (object)->priv;
|
||||||
|
|
||||||
|
if (priv->shell_watch_id)
|
||||||
|
{
|
||||||
|
g_bus_unwatch_name (priv->shell_watch_id);
|
||||||
|
priv->shell_watch_id = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (priv->builder)
|
if (priv->builder)
|
||||||
{
|
{
|
||||||
g_object_unref (priv->builder);
|
g_object_unref (priv->builder);
|
||||||
|
@ -462,6 +469,27 @@ cc_ua_panel_set_shortcut_label (CcUaPanel *self,
|
||||||
g_free (text);
|
g_free (text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
shell_vanished_cb (GDBusConnection *connection,
|
||||||
|
const gchar *name,
|
||||||
|
CcUaPanel *self)
|
||||||
|
{
|
||||||
|
CcUaPanelPrivate *priv = self->priv;
|
||||||
|
|
||||||
|
gtk_widget_hide (WID (priv->builder, "zoom_frame"));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
shell_appeared_cb (GDBusConnection *connection,
|
||||||
|
const gchar *name,
|
||||||
|
const gchar *name_owner,
|
||||||
|
CcUaPanel *self)
|
||||||
|
{
|
||||||
|
CcUaPanelPrivate *priv = self->priv;
|
||||||
|
|
||||||
|
gtk_widget_show (WID (priv->builder, "zoom_frame"));
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
cc_ua_panel_init_seeing (CcUaPanel *self)
|
cc_ua_panel_init_seeing (CcUaPanel *self)
|
||||||
{
|
{
|
||||||
|
@ -480,6 +508,13 @@ cc_ua_panel_init_seeing (CcUaPanel *self)
|
||||||
WID (priv->builder, "seeing_enable_toggle_keys_checkbutton"), "active",
|
WID (priv->builder, "seeing_enable_toggle_keys_checkbutton"), "active",
|
||||||
G_SETTINGS_BIND_DEFAULT);
|
G_SETTINGS_BIND_DEFAULT);
|
||||||
|
|
||||||
|
priv->shell_watch_id = g_bus_watch_name (G_BUS_TYPE_SESSION,
|
||||||
|
"org.gnome.Shell",
|
||||||
|
G_BUS_NAME_WATCHER_FLAGS_NONE,
|
||||||
|
(GBusNameAppearedCallback) shell_appeared_cb,
|
||||||
|
(GBusNameVanishedCallback) shell_vanished_cb,
|
||||||
|
self,
|
||||||
|
NULL);
|
||||||
g_signal_connect (WID (priv->builder, "seeing_zoom_preferences_button"),
|
g_signal_connect (WID (priv->builder, "seeing_zoom_preferences_button"),
|
||||||
"clicked",
|
"clicked",
|
||||||
G_CALLBACK (zoom_options_launch_cb), self);
|
G_CALLBACK (zoom_options_launch_cb), self);
|
||||||
|
|
|
@ -428,7 +428,7 @@
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkFrame" id="frame4">
|
<object class="GtkFrame" id="zoom_frame">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="label_xalign">0</property>
|
<property name="label_xalign">0</property>
|
||||||
<property name="shadow_type">none</property>
|
<property name="shadow_type">none</property>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue