[empathy] call-window: don't use EmpathyRoundedActor for the floating toolbar
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] call-window: don't use EmpathyRoundedActor for the floating toolbar
- Date: Tue, 27 Mar 2012 13:17:36 +0000 (UTC)
commit 3873c839159fefbe9001338d6f162b610e4f4284
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Thu Mar 22 16:30:34 2012 -0400
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
src/empathy-call-window.c | 20 ++++++++++++++++++--
src/empathy-call-window.ui | 36 +++++++-----------------------------
2 files changed, 25 insertions(+), 31 deletions(-)
---
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 1ddec20..49723c6 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 924bab6..2158b2b 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>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]