Mode changing !

This commit is contained in:
Adrien Bourmault 2023-01-25 19:05:38 +01:00
parent 4d65a51e09
commit bf6db3fa34
No known key found for this signature in database
GPG Key ID: 6EB408FE0ACEC664
1 changed files with 23 additions and 0 deletions

View File

@ -262,6 +262,7 @@ static void gem_graph_client_window_init(GemGraphClientWindow *self)
void uiWindowStackChange(const char *mode) void uiWindowStackChange(const char *mode)
{ {
if (window->main_stack == NULL) { if (window->main_stack == NULL) {
g_printerr("Can't find self->main_stack !\n"); g_printerr("Can't find self->main_stack !\n");
return; return;
@ -276,6 +277,28 @@ void uiWindowStackChange(const char *mode)
gtk_stack_set_visible_child_full(window->side_stack, gtk_stack_set_visible_child_full(window->side_stack,
mode, mode,
GTK_STACK_TRANSITION_TYPE_CROSSFADE); GTK_STACK_TRANSITION_TYPE_CROSSFADE);
// Switch on the first letter of the mode, because switch is soooo simple :)
switch(mode[0]) {
case 'e':
gtk_menu_button_set_icon_name(window->main_button_mode,
"document-edit-symbolic");
break;
case 'r':
gtk_menu_button_set_icon_name(window->main_button_mode,
"system-run-symbolic");
break;
case 'p':
gtk_menu_button_set_icon_name(window->main_button_mode,
"x-office-presentation-symbolic");
break;
case 'h':
gtk_menu_button_set_icon_name(window->main_button_mode,
"user-home-symbolic");
break;
default:
break;
}
} }
void uiWindowSendNotification(const char *message) void uiWindowSendNotification(const char *message)