1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-12-04 20:07:36 +00:00

calls-new-call-box: compose with GtkBin instead of subclassing GtkBox

Part-of: <https://gitlab.gnome.org/GNOME/calls/-/merge_requests/714>
This commit is contained in:
Anton Lazarev 2023-12-13 10:55:07 -08:00
parent 9fa0539ad6
commit b26faf1b13
3 changed files with 69 additions and 64 deletions

View file

@ -44,7 +44,7 @@ enum {
static GParamSpec *props[PROP_LAST_PROP];
struct _CallsNewCallBox {
GtkBox parent_instance;
GtkBin parent_instance;
GtkListBox *origin_list_box;
HdyComboRow *origin_list;
@ -58,7 +58,7 @@ struct _CallsNewCallBox {
gboolean numeric_input_only;
};
G_DEFINE_TYPE (CallsNewCallBox, calls_new_call_box, GTK_TYPE_BOX);
G_DEFINE_TYPE (CallsNewCallBox, calls_new_call_box, GTK_TYPE_BIN);
static CallsOrigin *

View file

@ -30,7 +30,7 @@ G_BEGIN_DECLS
#define CALLS_TYPE_NEW_CALL_BOX (calls_new_call_box_get_type ())
G_DECLARE_FINAL_TYPE (CallsNewCallBox, calls_new_call_box, CALLS, NEW_CALL_BOX, GtkBox)
G_DECLARE_FINAL_TYPE (CallsNewCallBox, calls_new_call_box, CALLS, NEW_CALL_BOX, GtkBin)
CallsNewCallBox *calls_new_call_box_new (void);
void calls_new_call_box_dial (CallsNewCallBox *self,

View file

@ -3,82 +3,87 @@
<interface>
<requires lib="gtk+" version="3.22"/>
<requires lib="libhandy" version="1.0"/>
<template class="CallsNewCallBox" parent="GtkBox">
<property name="margin_left">24</property>
<property name="margin_right">24</property>
<property name="margin_top">6</property>
<property name="orientation">vertical</property>
<template class="CallsNewCallBox" parent="GtkBin">
<property name="visible">True</property>
<child>
<object class="HdyClamp">
<property name="visible">True</property>
<object class="GtkBox">
<property name="margin_left">24</property>
<property name="margin_right">24</property>
<property name="margin_top">6</property>
<property name="orientation">vertical</property>
<property name="visible">True</property>
<child>
<object class="GtkBox">
<object class="HdyClamp">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkListBox" id="origin_list_box">
<object class="GtkBox">
<property name="visible">True</property>
<property name="selection-mode">none</property>
<property name="halign">center</property>
<property name="orientation">vertical</property>
<child>
<object class="HdyComboRow" id="origin_list">
<object class="GtkListBox" id="origin_list_box">
<property name="visible">True</property>
<signal name="notify::selected-index" handler="notify_selected_index_cb" swapped="yes"/>
</object>
</child>
</object>
</child>
<child>
<object class="GtkEntry" id="address_entry">
<property name="visible" bind-source="CallsNewCallBox" bind-property="numeric-input-only" bind-flags="sync-create|invert-boolean"/>
<property name="xalign">0.5</property>
<property name="placeholder-text" translatable="yes">Enter a VoIP address</property>
<signal name="activate" handler="address_activate_cb" swapped="yes"/>
<signal name="changed" handler="address_changed_cb" swapped="yes"/>
<style>
<class name="address-entry"/>
</style>
</object>
</child>
<child>
<object class="CuiDialpad" id="dialpad">
<property name="visible" bind-source="CallsNewCallBox" bind-property="numeric-input-only" bind-flags="sync-create"/>
<signal name="dialed" handler="dialpad_dialed_cb"/>
</object>
</child>
<child>
<object class="GtkListBox" id="result_list">
<property name="visible" bind-source="CallsNewCallBox" bind-property="numeric-input-only" bind-flags="sync-create|invert-boolean"/>
<property name="margin-top">16</property>
<property name="selection-mode">none</property>
<child>
<object class="HdyActionRow" id="result">
<property name="visible">False</property>
<property name="title" bind-source="address_entry" bind-property="text"/>
<property name="width-request">300</property>
<property name="subtitle" translatable="yes">SIP Account</property>
<child type="prefix">
<object class="HdyAvatar">
<property name="selection-mode">none</property>
<property name="halign">center</property>
<child>
<object class="HdyComboRow" id="origin_list">
<property name="visible">True</property>
<property name="show-initials">True</property>
<property name="size">36</property>
<signal name="notify::selected-index" handler="notify_selected_index_cb" swapped="yes"/>
</object>
</child>
</object>
</child>
<child>
<object class="GtkEntry" id="address_entry">
<property name="visible" bind-source="CallsNewCallBox" bind-property="numeric-input-only" bind-flags="sync-create|invert-boolean"/>
<property name="xalign">0.5</property>
<property name="placeholder-text" translatable="yes">Enter a VoIP address</property>
<signal name="activate" handler="address_activate_cb" swapped="yes"/>
<signal name="changed" handler="address_changed_cb" swapped="yes"/>
<style>
<class name="address-entry"/>
</style>
</object>
</child>
<child>
<object class="CuiDialpad" id="dialpad">
<property name="visible" bind-source="CallsNewCallBox" bind-property="numeric-input-only" bind-flags="sync-create"/>
<signal name="dialed" handler="dialpad_dialed_cb"/>
</object>
</child>
<child>
<object class="GtkListBox" id="result_list">
<property name="visible" bind-source="CallsNewCallBox" bind-property="numeric-input-only" bind-flags="sync-create|invert-boolean"/>
<property name="margin-top">16</property>
<property name="selection-mode">none</property>
<child>
<object class="GtkButton" id="dial_result_btn">
<property name="visible">True</property>
<property name="always_show_image">True</property>
<signal name="clicked" handler="dial_result_clicked_cb" swapped="yes"/>
<style>
<class name="rounded-button"/>
</style>
<child>
<object class="GtkImage">
<object class="HdyActionRow" id="result">
<property name="visible">False</property>
<property name="title" bind-source="address_entry" bind-property="text"/>
<property name="width-request">300</property>
<property name="subtitle" translatable="yes">SIP Account</property>
<child type="prefix">
<object class="HdyAvatar">
<property name="visible">True</property>
<property name="icon-name">call-start-symbolic</property>
<property name="show-initials">True</property>
<property name="size">36</property>
</object>
</child>
<child>
<object class="GtkButton" id="dial_result_btn">
<property name="visible">True</property>
<property name="always_show_image">True</property>
<signal name="clicked" handler="dial_result_clicked_cb" swapped="yes"/>
<style>
<class name="rounded-button"/>
</style>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="icon-name">call-start-symbolic</property>
</object>
</child>
</object>
</child>
</object>