diff options
Diffstat (limited to 'src/ui/message.c')
-rw-r--r-- | src/ui/message.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/ui/message.c b/src/ui/message.c index 4c89edb..6f379d7 100644 --- a/src/ui/message.c +++ b/src/ui/message.c | |||
@@ -106,6 +106,10 @@ ui_message_new(UI_MESSAGE_Type type, | |||
106 | gtk_builder_get_object(builder, "read_receipt_image") | 106 | gtk_builder_get_object(builder, "read_receipt_image") |
107 | ); | 107 | ); |
108 | 108 | ||
109 | handle->content_stack = GTK_STACK( | ||
110 | gtk_builder_get_object(builder, "content_stack") | ||
111 | ); | ||
112 | |||
109 | handle->text_label = GTK_LABEL( | 113 | handle->text_label = GTK_LABEL( |
110 | gtk_builder_get_object(builder, "text_label") | 114 | gtk_builder_get_object(builder, "text_label") |
111 | ); | 115 | ); |
@@ -129,9 +133,26 @@ ui_message_new(UI_MESSAGE_Type type, | |||
129 | 133 | ||
130 | switch (content_type) | 134 | switch (content_type) |
131 | { | 135 | { |
136 | case UI_MESSAGE_CONTENT_TEXT: | ||
137 | gtk_stack_set_visible_child( | ||
138 | handle->content_stack, | ||
139 | GTK_WIDGET(handle->text_label) | ||
140 | ); | ||
141 | break; | ||
132 | case UI_MESSAGE_CONTENT_FILE: | 142 | case UI_MESSAGE_CONTENT_FILE: |
143 | gtk_stack_set_visible_child( | ||
144 | handle->content_stack, | ||
145 | GTK_WIDGET(handle->file_revealer) | ||
146 | ); | ||
147 | |||
133 | gtk_revealer_set_reveal_child(handle->file_revealer, TRUE); | 148 | gtk_revealer_set_reveal_child(handle->file_revealer, TRUE); |
134 | break; | 149 | break; |
150 | case UI_MESSAGE_CONTENT_PREVIEW: | ||
151 | gtk_stack_set_visible_child( | ||
152 | handle->content_stack, | ||
153 | GTK_WIDGET(handle->preview_drawing_area) | ||
154 | ); | ||
155 | break; | ||
135 | default: | 156 | default: |
136 | break; | 157 | break; |
137 | } | 158 | } |
@@ -145,6 +166,18 @@ ui_message_new(UI_MESSAGE_Type type, | |||
145 | } | 166 | } |
146 | 167 | ||
147 | void | 168 | void |
169 | ui_message_update(UI_MESSAGE_Handle *handle, | ||
170 | struct GNUNET_CHAT_Message *msg) | ||
171 | { | ||
172 | struct GNUNET_CHAT_File *file = GNUNET_CHAT_message_get_file(msg); | ||
173 | |||
174 | if (!file) | ||
175 | return; | ||
176 | |||
177 | // TODO | ||
178 | } | ||
179 | |||
180 | void | ||
148 | ui_message_delete(UI_MESSAGE_Handle *handle) | 181 | ui_message_delete(UI_MESSAGE_Handle *handle) |
149 | { | 182 | { |
150 | g_object_unref(handle->builder); | 183 | g_object_unref(handle->builder); |