diff options
Diffstat (limited to 'src/ui/messenger.c')
-rw-r--r-- | src/ui/messenger.c | 143 |
1 files changed, 88 insertions, 55 deletions
diff --git a/src/ui/messenger.c b/src/ui/messenger.c index 4bf3164..37827d8 100644 --- a/src/ui/messenger.c +++ b/src/ui/messenger.c | |||
@@ -103,71 +103,85 @@ ui_messenger_init(MESSENGER_Application *app, | |||
103 | GTK_WINDOW(handle->main_window) | 103 | GTK_WINDOW(handle->main_window) |
104 | ); | 104 | ); |
105 | 105 | ||
106 | handle->profile_avatar = HDY_AVATAR( | 106 | gtk_window_set_default_size( |
107 | gtk_builder_get_object(builder, "profile_avatar") | 107 | GTK_WINDOW(handle->main_window), |
108 | 1100, 700 | ||
108 | ); | 109 | ); |
109 | 110 | ||
110 | handle->profile_label = GTK_LABEL( | 111 | handle->leaflet_chat = HDY_LEAFLET( |
111 | gtk_builder_get_object(builder, "profile_label") | 112 | gtk_builder_get_object(builder, "leaflet_chat") |
113 | ); | ||
114 | |||
115 | handle->flap_user_details = HDY_FLAP( | ||
116 | gtk_builder_get_object(builder, "flap_user_details") | ||
117 | ); | ||
118 | |||
119 | handle->flap_chat_details = HDY_FLAP( | ||
120 | gtk_builder_get_object(builder, "flap_chat_details") | ||
112 | ); | 121 | ); |
113 | 122 | ||
114 | handle->title_bar = HDY_HEADER_BAR( | 123 | handle->title_bar = HDY_HEADER_BAR( |
115 | gtk_builder_get_object(builder, "title_bar") | 124 | gtk_builder_get_object(builder, "title_bar") |
116 | ); | 125 | ); |
117 | 126 | ||
118 | handle->leaflet_chat = HDY_LEAFLET( | 127 | g_object_bind_property( |
119 | gtk_builder_get_object(builder, "leaflet_chat") | 128 | handle->leaflet_chat, |
129 | "folded", | ||
130 | handle->title_bar, | ||
131 | "show-close-button", | ||
132 | G_BINDING_INVERT_BOOLEAN | ||
120 | ); | 133 | ); |
121 | 134 | ||
122 | if (app->ui.mobile) | 135 | if (app->ui.mobile) |
123 | { | ||
124 | g_object_bind_property( | 136 | g_object_bind_property( |
125 | handle->leaflet_chat, | 137 | handle->leaflet_chat, |
126 | "folded", | 138 | "folded", |
127 | handle->title_bar, | 139 | handle->title_bar, |
128 | "visible", | 140 | "visible", |
129 | G_BINDING_SYNC_CREATE | | 141 | G_BINDING_SYNC_CREATE | |
130 | G_BINDING_INVERT_BOOLEAN | 142 | G_BINDING_INVERT_BOOLEAN |
131 | ); | 143 | ); |
132 | } | ||
133 | 144 | ||
134 | hdy_leaflet_set_homogeneous(handle->leaflet_chat, FALSE, GTK_ORIENTATION_HORIZONTAL, FALSE); | 145 | handle->back_button = GTK_BUTTON( |
146 | gtk_builder_get_object(builder, "back_button") | ||
147 | ); | ||
135 | 148 | ||
136 | handle->chats_listbox = GTK_LIST_BOX( | 149 | g_object_bind_property( |
137 | gtk_builder_get_object(builder, "chats_listbox") | 150 | handle->leaflet_chat, |
151 | "folded", | ||
152 | handle->back_button, | ||
153 | "visible", | ||
154 | G_BINDING_SYNC_CREATE | ||
138 | ); | 155 | ); |
139 | 156 | ||
140 | g_signal_connect( | 157 | g_signal_connect( |
141 | handle->chats_listbox, | 158 | handle->back_button, |
142 | "row-activated", | 159 | "clicked", |
143 | G_CALLBACK(handle_chats_listbox_row_activated), | 160 | G_CALLBACK(handle_back_button_click), |
144 | handle->leaflet_chat | 161 | handle->leaflet_chat |
145 | ); | 162 | ); |
146 | 163 | ||
147 | handle->user_details_button = GTK_BUTTON( | 164 | handle->profile_avatar = HDY_AVATAR( |
148 | gtk_builder_get_object(builder, "user_details_button") | 165 | gtk_builder_get_object(builder, "profile_avatar") |
149 | ); | 166 | ); |
150 | 167 | ||
151 | handle->hide_user_details_button = GTK_BUTTON( | 168 | handle->profile_label = GTK_LABEL( |
152 | gtk_builder_get_object(builder, "hide_user_details_button") | 169 | gtk_builder_get_object(builder, "profile_label") |
153 | ); | 170 | ); |
154 | 171 | ||
155 | handle->flap_user_details = HDY_FLAP( | 172 | handle->hide_user_details_button = GTK_BUTTON( |
156 | gtk_builder_get_object(builder, "flap_user_details") | 173 | gtk_builder_get_object(builder, "hide_user_details_button") |
157 | ); | 174 | ); |
158 | 175 | ||
159 | g_signal_connect( | 176 | g_signal_connect( |
160 | handle->user_details_button, | 177 | handle->hide_user_details_button, |
161 | "clicked", | 178 | "clicked", |
162 | G_CALLBACK(handle_flap_via_button_click), | 179 | G_CALLBACK(handle_flap_via_button_click), |
163 | handle->flap_user_details | 180 | handle->flap_user_details |
164 | ); | 181 | ); |
165 | 182 | ||
166 | g_signal_connect( | 183 | handle->favourites_button = GTK_BUTTON( |
167 | handle->hide_user_details_button, | 184 | gtk_builder_get_object(builder, "favourites_button") |
168 | "clicked", | ||
169 | G_CALLBACK(handle_flap_via_button_click), | ||
170 | handle->flap_user_details | ||
171 | ); | 185 | ); |
172 | 186 | ||
173 | handle->account_details_button = GTK_BUTTON( | 187 | handle->account_details_button = GTK_BUTTON( |
@@ -185,35 +199,54 @@ ui_messenger_init(MESSENGER_Application *app, | |||
185 | handle->account_details_revealer | 199 | handle->account_details_revealer |
186 | ); | 200 | ); |
187 | 201 | ||
188 | handle->back_button = GTK_BUTTON( | 202 | handle->accounts_listbox = GTK_LIST_BOX( |
189 | gtk_builder_get_object(builder, "back_button") | 203 | gtk_builder_get_object(builder, "accounts_listbox") |
204 | ); | ||
205 | |||
206 | handle->new_contact_button = GTK_BUTTON( | ||
207 | gtk_builder_get_object(builder, "new_contact_button") | ||
208 | ); | ||
209 | |||
210 | handle->new_group_button = GTK_BUTTON( | ||
211 | gtk_builder_get_object(builder, "new_group_button") | ||
212 | ); | ||
213 | |||
214 | handle->new_platform_button = GTK_BUTTON( | ||
215 | gtk_builder_get_object(builder, "new_platform_button") | ||
216 | ); | ||
217 | |||
218 | handle->contacts_button = GTK_BUTTON( | ||
219 | gtk_builder_get_object(builder, "contacts_button") | ||
220 | ); | ||
221 | |||
222 | handle->settings_button = GTK_BUTTON( | ||
223 | gtk_builder_get_object(builder, "settings_button") | ||
224 | ); | ||
225 | |||
226 | handle->user_details_button = GTK_BUTTON( | ||
227 | gtk_builder_get_object(builder, "user_details_button") | ||
190 | ); | 228 | ); |
191 | 229 | ||
192 | g_signal_connect( | 230 | g_signal_connect( |
193 | handle->back_button, | 231 | handle->user_details_button, |
194 | "clicked", | 232 | "clicked", |
195 | G_CALLBACK(handle_back_button_click), | 233 | G_CALLBACK(handle_flap_via_button_click), |
196 | handle->leaflet_chat | 234 | handle->flap_user_details |
197 | ); | 235 | ); |
198 | 236 | ||
199 | g_object_bind_property( | 237 | handle->chats_search = GTK_SEARCH_ENTRY( |
200 | handle->leaflet_chat, | 238 | gtk_builder_get_object(builder, "chats_search") |
201 | "folded", | ||
202 | handle->back_button, | ||
203 | "visible", | ||
204 | G_BINDING_SYNC_CREATE | ||
205 | ); | 239 | ); |
206 | 240 | ||
207 | g_object_bind_property( | 241 | handle->chats_listbox = GTK_LIST_BOX( |
208 | handle->leaflet_chat, | 242 | gtk_builder_get_object(builder, "chats_listbox") |
209 | "folded", | ||
210 | handle->title_bar, | ||
211 | "show-close-button", | ||
212 | G_BINDING_INVERT_BOOLEAN | ||
213 | ); | 243 | ); |
214 | 244 | ||
215 | handle->flap_chat_details = HDY_FLAP( | 245 | g_signal_connect( |
216 | gtk_builder_get_object(builder, "flap_chat_details") | 246 | handle->chats_listbox, |
247 | "row-activated", | ||
248 | G_CALLBACK(handle_chats_listbox_row_activated), | ||
249 | handle->leaflet_chat | ||
217 | ); | 250 | ); |
218 | 251 | ||
219 | handle->chat_title = GTK_LABEL( | 252 | handle->chat_title = GTK_LABEL( |
@@ -228,10 +261,6 @@ ui_messenger_init(MESSENGER_Application *app, | |||
228 | gtk_builder_get_object(builder, "chat_details_button") | 261 | gtk_builder_get_object(builder, "chat_details_button") |
229 | ); | 262 | ); |
230 | 263 | ||
231 | handle->hide_chat_details_button = GTK_BUTTON( | ||
232 | gtk_builder_get_object(builder, "hide_chat_details_button") | ||
233 | ); | ||
234 | |||
235 | g_signal_connect( | 264 | g_signal_connect( |
236 | handle->chat_details_button, | 265 | handle->chat_details_button, |
237 | "clicked", | 266 | "clicked", |
@@ -239,6 +268,10 @@ ui_messenger_init(MESSENGER_Application *app, | |||
239 | handle->flap_chat_details | 268 | handle->flap_chat_details |
240 | ); | 269 | ); |
241 | 270 | ||
271 | handle->hide_chat_details_button = GTK_BUTTON( | ||
272 | gtk_builder_get_object(builder, "hide_chat_details_button") | ||
273 | ); | ||
274 | |||
242 | g_signal_connect( | 275 | g_signal_connect( |
243 | handle->hide_chat_details_button, | 276 | handle->hide_chat_details_button, |
244 | "clicked", | 277 | "clicked", |