aboutsummaryrefslogtreecommitdiff
path: root/src/ui/chat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/chat.c')
-rw-r--r--src/ui/chat.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/ui/chat.c b/src/ui/chat.c
index 7e5c1fc..b4dcca9 100644
--- a/src/ui/chat.c
+++ b/src/ui/chat.c
@@ -138,16 +138,16 @@ ui_chat_new(MESSENGER_Application *app)
138 UI_CHAT_Handle *handle = g_malloc(sizeof(UI_CHAT_Handle)); 138 UI_CHAT_Handle *handle = g_malloc(sizeof(UI_CHAT_Handle));
139 UI_MESSENGER_Handle *messenger = &(app->ui.messenger); 139 UI_MESSENGER_Handle *messenger = &(app->ui.messenger);
140 140
141 GtkBuilder* builder = gtk_builder_new_from_file( 141 handle->builder = gtk_builder_new_from_file(
142 "resources/ui/chat.ui" 142 "resources/ui/chat.ui"
143 ); 143 );
144 144
145 handle->chat_box = GTK_WIDGET( 145 handle->chat_box = GTK_WIDGET(
146 gtk_builder_get_object(builder, "chat_box") 146 gtk_builder_get_object(handle->builder, "chat_box")
147 ); 147 );
148 148
149 handle->back_button = GTK_BUTTON( 149 handle->back_button = GTK_BUTTON(
150 gtk_builder_get_object(builder, "back_button") 150 gtk_builder_get_object(handle->builder, "back_button")
151 ); 151 );
152 152
153 g_object_bind_property( 153 g_object_bind_property(
@@ -166,15 +166,15 @@ ui_chat_new(MESSENGER_Application *app)
166 ); 166 );
167 167
168 handle->chat_title = GTK_LABEL( 168 handle->chat_title = GTK_LABEL(
169 gtk_builder_get_object(builder, "chat_title") 169 gtk_builder_get_object(handle->builder, "chat_title")
170 ); 170 );
171 171
172 handle->chat_subtitle = GTK_LABEL( 172 handle->chat_subtitle = GTK_LABEL(
173 gtk_builder_get_object(builder, "chat_subtitle") 173 gtk_builder_get_object(handle->builder, "chat_subtitle")
174 ); 174 );
175 175
176 handle->chat_details_button = GTK_BUTTON( 176 handle->chat_details_button = GTK_BUTTON(
177 gtk_builder_get_object(builder, "chat_details_button") 177 gtk_builder_get_object(handle->builder, "chat_details_button")
178 ); 178 );
179 179
180 g_signal_connect( 180 g_signal_connect(
@@ -185,27 +185,27 @@ ui_chat_new(MESSENGER_Application *app)
185 ); 185 );
186 186
187 handle->messages_listbox = GTK_LIST_BOX( 187 handle->messages_listbox = GTK_LIST_BOX(
188 gtk_builder_get_object(builder, "messages_listbox") 188 gtk_builder_get_object(handle->builder, "messages_listbox")
189 ); 189 );
190 190
191 handle->attach_file_button = GTK_BUTTON( 191 handle->attach_file_button = GTK_BUTTON(
192 gtk_builder_get_object(builder, "attach_file_button") 192 gtk_builder_get_object(handle->builder, "attach_file_button")
193 ); 193 );
194 194
195 handle->send_text_view = GTK_TEXT_VIEW( 195 handle->send_text_view = GTK_TEXT_VIEW(
196 gtk_builder_get_object(builder, "send_text_view") 196 gtk_builder_get_object(handle->builder, "send_text_view")
197 ); 197 );
198 198
199 handle->emoji_button = GTK_BUTTON( 199 handle->emoji_button = GTK_BUTTON(
200 gtk_builder_get_object(builder, "emoji_button") 200 gtk_builder_get_object(handle->builder, "emoji_button")
201 ); 201 );
202 202
203 handle->send_record_button = GTK_BUTTON( 203 handle->send_record_button = GTK_BUTTON(
204 gtk_builder_get_object(builder, "send_record_button") 204 gtk_builder_get_object(handle->builder, "send_record_button")
205 ); 205 );
206 206
207 handle->send_record_symbol = GTK_IMAGE( 207 handle->send_record_symbol = GTK_IMAGE(
208 gtk_builder_get_object(builder, "send_record_symbol") 208 gtk_builder_get_object(handle->builder, "send_record_symbol")
209 ); 209 );
210 210
211 GtkTextBuffer *send_text_buffer = gtk_text_view_get_buffer( 211 GtkTextBuffer *send_text_buffer = gtk_text_view_get_buffer(
@@ -245,5 +245,7 @@ ui_chat_new(MESSENGER_Application *app)
245void 245void
246ui_chat_delete(UI_CHAT_Handle *handle) 246ui_chat_delete(UI_CHAT_Handle *handle)
247{ 247{
248 g_object_unref(handle->builder);
249
248 g_free(handle); 250 g_free(handle);
249} 251}