diff options
Diffstat (limited to 'src/ui/messenger.c')
-rw-r--r-- | src/ui/messenger.c | 52 |
1 files changed, 42 insertions, 10 deletions
diff --git a/src/ui/messenger.c b/src/ui/messenger.c index 45da0cd..b4d12af 100644 --- a/src/ui/messenger.c +++ b/src/ui/messenger.c | |||
@@ -140,9 +140,7 @@ handle_new_contact_button_click(UNUSED GtkButton* button, | |||
140 | MESSENGER_Application *app = (MESSENGER_Application*) user_data; | 140 | MESSENGER_Application *app = (MESSENGER_Application*) user_data; |
141 | 141 | ||
142 | hdy_flap_set_reveal_flap(HDY_FLAP(app->ui.messenger.flap_user_details), FALSE); | 142 | hdy_flap_set_reveal_flap(HDY_FLAP(app->ui.messenger.flap_user_details), FALSE); |
143 | |||
144 | ui_new_contact_dialog_init(app, &(app->ui.new_contact)); | 143 | ui_new_contact_dialog_init(app, &(app->ui.new_contact)); |
145 | |||
146 | gtk_widget_show(GTK_WIDGET(app->ui.new_contact.dialog)); | 144 | gtk_widget_show(GTK_WIDGET(app->ui.new_contact.dialog)); |
147 | } | 145 | } |
148 | 146 | ||
@@ -153,9 +151,7 @@ handle_new_group_button_click(UNUSED GtkButton* button, | |||
153 | MESSENGER_Application *app = (MESSENGER_Application*) user_data; | 151 | MESSENGER_Application *app = (MESSENGER_Application*) user_data; |
154 | 152 | ||
155 | hdy_flap_set_reveal_flap(HDY_FLAP(app->ui.messenger.flap_user_details), FALSE); | 153 | hdy_flap_set_reveal_flap(HDY_FLAP(app->ui.messenger.flap_user_details), FALSE); |
156 | |||
157 | ui_new_group_dialog_init(app, &(app->ui.new_group)); | 154 | ui_new_group_dialog_init(app, &(app->ui.new_group)); |
158 | |||
159 | gtk_widget_show(GTK_WIDGET(app->ui.new_group.dialog)); | 155 | gtk_widget_show(GTK_WIDGET(app->ui.new_group.dialog)); |
160 | } | 156 | } |
161 | 157 | ||
@@ -166,9 +162,7 @@ handle_new_platform_button_click(UNUSED GtkButton* button, | |||
166 | MESSENGER_Application *app = (MESSENGER_Application*) user_data; | 162 | MESSENGER_Application *app = (MESSENGER_Application*) user_data; |
167 | 163 | ||
168 | hdy_flap_set_reveal_flap(HDY_FLAP(app->ui.messenger.flap_user_details), FALSE); | 164 | hdy_flap_set_reveal_flap(HDY_FLAP(app->ui.messenger.flap_user_details), FALSE); |
169 | |||
170 | ui_new_platform_dialog_init(app, &(app->ui.new_platform)); | 165 | ui_new_platform_dialog_init(app, &(app->ui.new_platform)); |
171 | |||
172 | gtk_widget_show(GTK_WIDGET(app->ui.new_platform.dialog)); | 166 | gtk_widget_show(GTK_WIDGET(app->ui.new_platform.dialog)); |
173 | } | 167 | } |
174 | 168 | ||
@@ -179,9 +173,7 @@ handle_contacts_button_click(UNUSED GtkButton* button, | |||
179 | MESSENGER_Application *app = (MESSENGER_Application*) user_data; | 173 | MESSENGER_Application *app = (MESSENGER_Application*) user_data; |
180 | 174 | ||
181 | hdy_flap_set_reveal_flap(HDY_FLAP(app->ui.messenger.flap_user_details), FALSE); | 175 | hdy_flap_set_reveal_flap(HDY_FLAP(app->ui.messenger.flap_user_details), FALSE); |
182 | |||
183 | ui_contacts_dialog_init(app, &(app->ui.contacts)); | 176 | ui_contacts_dialog_init(app, &(app->ui.contacts)); |
184 | |||
185 | gtk_widget_show(GTK_WIDGET(app->ui.contacts.dialog)); | 177 | gtk_widget_show(GTK_WIDGET(app->ui.contacts.dialog)); |
186 | } | 178 | } |
187 | 179 | ||
@@ -192,13 +184,22 @@ handle_settings_button_click(UNUSED GtkButton* button, | |||
192 | MESSENGER_Application *app = (MESSENGER_Application*) user_data; | 184 | MESSENGER_Application *app = (MESSENGER_Application*) user_data; |
193 | 185 | ||
194 | hdy_flap_set_reveal_flap(HDY_FLAP(app->ui.messenger.flap_user_details), FALSE); | 186 | hdy_flap_set_reveal_flap(HDY_FLAP(app->ui.messenger.flap_user_details), FALSE); |
195 | |||
196 | ui_settings_dialog_init(app, &(app->ui.settings)); | 187 | ui_settings_dialog_init(app, &(app->ui.settings)); |
197 | |||
198 | gtk_widget_show(GTK_WIDGET(app->ui.settings.dialog)); | 188 | gtk_widget_show(GTK_WIDGET(app->ui.settings.dialog)); |
199 | } | 189 | } |
200 | 190 | ||
201 | static void | 191 | static void |
192 | handle_about_button_click(UNUSED GtkButton* button, | ||
193 | gpointer user_data) | ||
194 | { | ||
195 | MESSENGER_Application *app = (MESSENGER_Application*) user_data; | ||
196 | |||
197 | hdy_flap_set_reveal_flap(HDY_FLAP(app->ui.messenger.flap_user_details), FALSE); | ||
198 | ui_about_dialog_init(app, &(app->ui.about)); | ||
199 | gtk_widget_show(GTK_WIDGET(app->ui.about.dialog)); | ||
200 | } | ||
201 | |||
202 | static void | ||
202 | handle_chats_listbox_row_activated(UNUSED GtkListBox* listbox, | 203 | handle_chats_listbox_row_activated(UNUSED GtkListBox* listbox, |
203 | GtkListBoxRow* row, | 204 | GtkListBoxRow* row, |
204 | gpointer user_data) | 205 | gpointer user_data) |
@@ -295,6 +296,16 @@ ui_messenger_init(MESSENGER_Application *app, | |||
295 | gtk_builder_get_object(handle->builder, "main_window") | 296 | gtk_builder_get_object(handle->builder, "main_window") |
296 | ); | 297 | ); |
297 | 298 | ||
299 | gtk_window_set_startup_id( | ||
300 | GTK_WINDOW(handle->main_window), | ||
301 | MESSENGER_APPLICATION_ID | ||
302 | ); | ||
303 | |||
304 | gtk_window_set_icon_name( | ||
305 | GTK_WINDOW(handle->main_window), | ||
306 | MESSENGER_APPLICATION_ID | ||
307 | ); | ||
308 | |||
298 | gtk_application_add_window( | 309 | gtk_application_add_window( |
299 | app->application, | 310 | app->application, |
300 | GTK_WINDOW(handle->main_window) | 311 | GTK_WINDOW(handle->main_window) |
@@ -317,6 +328,16 @@ ui_messenger_init(MESSENGER_Application *app, | |||
317 | gtk_builder_get_object(handle->builder, "title_bar") | 328 | gtk_builder_get_object(handle->builder, "title_bar") |
318 | ); | 329 | ); |
319 | 330 | ||
331 | hdy_header_bar_set_title( | ||
332 | handle->title_bar, | ||
333 | MESSENGER_APPLICATION_TITLE | ||
334 | ); | ||
335 | |||
336 | hdy_header_bar_set_subtitle( | ||
337 | handle->title_bar, | ||
338 | MESSENGER_APPLICATION_SUBTITLE | ||
339 | ); | ||
340 | |||
320 | g_object_bind_property( | 341 | g_object_bind_property( |
321 | handle->leaflet_chat, | 342 | handle->leaflet_chat, |
322 | "folded", | 343 | "folded", |
@@ -458,6 +479,17 @@ ui_messenger_init(MESSENGER_Application *app, | |||
458 | app | 479 | app |
459 | ); | 480 | ); |
460 | 481 | ||
482 | handle->about_button = GTK_BUTTON( | ||
483 | gtk_builder_get_object(handle->builder, "about_button") | ||
484 | ); | ||
485 | |||
486 | g_signal_connect( | ||
487 | handle->about_button, | ||
488 | "clicked", | ||
489 | G_CALLBACK(handle_about_button_click), | ||
490 | app | ||
491 | ); | ||
492 | |||
461 | handle->user_details_button = GTK_BUTTON( | 493 | handle->user_details_button = GTK_BUTTON( |
462 | gtk_builder_get_object(handle->builder, "user_details_button") | 494 | gtk_builder_get_object(handle->builder, "user_details_button") |
463 | ); | 495 | ); |