Commit 31cc01ef authored by Sébastien Blin's avatar Sébastien Blin Committed by Philippe Gorley

currentcallview: fix record button animation

The record button should blink only if the call is really
recording.

Change-Id: Iad3be6235014d2264be05a4877b409640ecf2f85
Reviewed-by: Philippe Gorley's avatarPhilippe Gorley <philippe.gorley@savoirfairelinux.com>
parent cc92ae94
......@@ -294,6 +294,16 @@ on_new_chat_interactions(CurrentCallView* view)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(priv->togglebutton_chat), TRUE);
}
static void
set_record_animation(CurrentCallViewPrivate* priv)
{
auto callToRender = priv->cpp->conversation->callId;
if (!priv->cpp->conversation->confId.empty())
callToRender = priv->cpp->conversation->confId;
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(priv->togglebutton_record),
(*priv->cpp->accountInfo)->callModel->isRecording(callToRender));
}
static void
on_togglebutton_chat_toggled(GtkToggleButton* widget, CurrentCallView* view)
{
......@@ -360,6 +370,8 @@ on_togglebutton_record_clicked(CurrentCallView* view)
if (!priv->cpp->conversation->confId.empty())
callToRecord = priv->cpp->conversation->confId;
(*priv->cpp->accountInfo)->callModel->toggleAudioRecord(callToRecord);
set_record_animation(priv);
}
static void
......@@ -748,6 +760,8 @@ CppImpl::setup(WebKitChatContainer* chat_widget,
gtk_widget_show_all(widgets->list_conversations);
gtk_widget_show(widgets->togglebutton_transfer);
}
set_record_animation(widgets);
}
void
......
......@@ -362,16 +362,14 @@
</style>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="width-request">48</property>
<property name="height-request">48</property>
<property name="action-name">app.record</property>
<property name="has_tooltip">True</property>
<property name="image">image_record</property>
<property name="tooltip-text" translatable="yes">Toggle record audio</property>
<property name="tooltip-text" translatable="yes">Toggle recording</property>
<child internal-child="accessible">
<object class="AtkObject" id="togglebutton_record-atkobject">
<property name="AtkObject::accessible-name" translatable="yes">Record audio</property>
<property name="AtkObject::accessible-name" translatable="yes">Record</property>
</object>
</child>
</object>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment