aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2012-03-23 04:30:34 +0800
committerCosimo Cecchi <cosimoc@gnome.org>2012-03-27 21:16:57 +0800
commit3873c839159fefbe9001338d6f162b610e4f4284 (patch)
tree6f28a862ad2fd52a17c0e7cb19124a0b675022e9 /src
parentd9c6227d30e2eb6521421c01f03749e8a4c576e9 (diff)
downloadgsoc2013-empathy-3873c839159fefbe9001338d6f162b610e4f4284.tar
gsoc2013-empathy-3873c839159fefbe9001338d6f162b610e4f4284.tar.gz
gsoc2013-empathy-3873c839159fefbe9001338d6f162b610e4f4284.tar.bz2
gsoc2013-empathy-3873c839159fefbe9001338d6f162b610e4f4284.tar.lz
gsoc2013-empathy-3873c839159fefbe9001338d6f162b610e4f4284.tar.xz
gsoc2013-empathy-3873c839159fefbe9001338d6f162b610e4f4284.tar.zst
gsoc2013-empathy-3873c839159fefbe9001338d6f162b610e4f4284.zip
call-window: don't use EmpathyRoundedActor for the floating toolbar
Make this a real toolbar, and add a CSS provider to set the correct border radius. In the future, GTK and Adwaita will support an 'OSD' style class that takes care of this automatically, but right now we have add these few lines of code. https://bugzilla.gnome.org/show_bug.cgi?id=672560
Diffstat (limited to 'src')
-rw-r--r--src/empathy-call-window.c20
-rw-r--r--src/empathy-call-window.ui36
2 files changed, 25 insertions, 31 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 1ddec200b..49723c6dd 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -1559,6 +1559,8 @@ empathy_call_window_init (EmpathyCallWindow *self)
ClutterConstraint *constraint;
ClutterActor *remote_avatar;
GtkStyleContext *context;
+ GtkCssProvider *provider;
+ GdkRGBA transparent = { 0., 0., 0., 0. };
GdkRGBA rgba;
ClutterColor bg;
@@ -1620,6 +1622,17 @@ empathy_call_window_init (EmpathyCallWindow *self)
"menupreviewswap", "activate", empathy_call_window_swap_camera_cb,
NULL);
+ /* FIXME: we should use a stock "OSD" style class for the toolbar,
+ * once it's available in GTK+/Adwaita.
+ */
+ provider = gtk_css_provider_new ();
+ gtk_css_provider_load_from_data (provider,
+ "#CallFloatingToolbar { border-radius: 6px; }", -1, NULL);
+ gtk_style_context_add_provider (
+ gtk_widget_get_style_context (priv->bottom_toolbar),
+ GTK_STYLE_PROVIDER (provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ g_object_unref (provider);
+
gtk_action_set_sensitive (priv->menu_fullscreen, FALSE);
priv->camera_monitor = empathy_camera_monitor_dup_singleton ();
@@ -1707,8 +1720,11 @@ empathy_call_window_init (EmpathyCallWindow *self)
create_audio_input (self);
create_video_input (self);
- priv->floating_toolbar = empathy_rounded_actor_new (2);
- clutter_actor_set_margin_bottom (priv->floating_toolbar, FLOATING_TOOLBAR_SPACING);
+ priv->floating_toolbar = gtk_clutter_actor_new ();
+ gtk_widget_override_background_color (
+ gtk_clutter_actor_get_widget (
+ GTK_CLUTTER_ACTOR (priv->floating_toolbar)),
+ GTK_STATE_FLAG_NORMAL, &transparent);
gtk_widget_reparent (priv->bottom_toolbar,
gtk_clutter_actor_get_widget (GTK_CLUTTER_ACTOR (priv->floating_toolbar)));
diff --git a/src/empathy-call-window.ui b/src/empathy-call-window.ui
index 924bab6f4..2158b2b83 100644
--- a/src/empathy-call-window.ui
+++ b/src/empathy-call-window.ui
@@ -253,9 +253,10 @@
</packing>
</child>
<child>
- <object class="GtkHBox" id="bottom_toolbar">
+ <object class="GtkToolbar" id="bottom_toolbar">
<property name="visible">True</property>
- <property name="homogeneous">False</property>
+ <property name="show_arrow">False</property>
+ <property name="name">CallFloatingToolbar</property>
<child>
<object class="GtkToggleToolButton" id="camera">
<property name="visible">True</property>
@@ -264,10 +265,6 @@
<property name="sensitive">False</property>
<property name="tooltip_text" translatable="yes">Toggle video transmission</property>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
</child>
<child>
<object class="GtkToolItem" id="toolitem3">
@@ -279,10 +276,6 @@
</object>
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
</child>
<child>
<object class="GtkToggleToolButton" id="microphone">
@@ -292,13 +285,10 @@
<property name="icon_name">gnome-stock-mic</property>
<property name="tooltip_text" translatable="yes">Toggle audio transmission</property>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
</child>
<child>
- <object class="GtkToolItem" id="toolbar_space2">
+ <object class="GtkSeparatorToolItem" id="toolbutton2">
+ <property name="draw">False</property>
<property name="visible">True</property>
</object>
<packing>
@@ -311,25 +301,13 @@
<child>
<object class="GtkLabel" id="status_label">
<property name="visible">True</property>
+ <property name="margin_left">10</property>
+ <property name="margin_right">10</property>
</object>
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <object class="GtkSeparatorToolItem" id="toolbutton2">
- <property name="draw">False</property>
- <property name="visible">True</property>
- </object>
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="position">4</property>
- </packing>
</child>
</object>