WIP: relation entre les états EXEC / EDIT et RUN / STOP (en cours...)

This commit is contained in:
Jean Sirmai 2024-06-03 06:13:03 +02:00
parent 7820dde7c2
commit 4e14d68b1e
Signed by: jean
GPG Key ID: FB3115C340E057E3
4 changed files with 17 additions and 4 deletions

View File

@ -51,6 +51,7 @@ void ui_toggle_exec_edit (GtkWidget *btt_exec_xor_edit, gpointer data)
set_exec_edit_mode (0); set_exec_edit_mode (0);
} else { } else {
gtk_button_set_icon_name (GTK_BUTTON (btt_exec_xor_edit), "document-edit-symbolic"); gtk_button_set_icon_name (GTK_BUTTON (btt_exec_xor_edit), "document-edit-symbolic");
gtk_button_set_icon_name (GTK_BUTTON (btt_exec_xor_edit), "text-editor-symbolic"); // I hesitate
set_exec_edit_mode (1); set_exec_edit_mode (1);
} }
} }
@ -62,7 +63,17 @@ void ui_toggle_model_exec (GtkWidget *btt_run_stop_model_exec, gpointer data)
set_run_xor_stop_exec (0); set_run_xor_stop_exec (0);
} else { } else {
gtk_button_set_icon_name (GTK_BUTTON (btt_run_stop_model_exec), "media-playback-pause-symbolic"); gtk_button_set_icon_name (GTK_BUTTON (btt_run_stop_model_exec), "media-playback-pause-symbolic");
// gtk_button_set_icon_name (GTK_BUTTON (btt_run_stop_model_exec), "system-shutdown-symbolic");
// I hesitate : The button should then toggle between activable xor inactivable states
set_run_xor_stop_exec (1); set_run_xor_stop_exec (1);
} }
} }
void ui_model_exec_depends_on_edition (GtkWidget *btt_run_stop_model_exec, gpointer data)
{
if (get_run_xor_stop_exec() && get_exec_edit_mode()) {
gtk_button_set_icon_name (GTK_BUTTON (btt_run_stop_model_exec), "media-playback-start-symbolic");
// set_run_xor_stop_exec (0);
}
}

View File

@ -10,8 +10,9 @@ void ui_disable_action (const char *name);
// @see application . gem_graph_client_application_init (GemGraphClientApplication *self) { // @see application . gem_graph_client_application_init (GemGraphClientApplication *self) {
// g_action_map_add_action_entries (G_ACTION_MAP(self), app_actions, G_N_ELEMENTS(app_actions), self); ... // g_action_map_add_action_entries (G_ACTION_MAP(self), app_actions, G_N_ELEMENTS(app_actions), self); ...
void ui_toggle_exec_edit (); void ui_toggle_exec_edit (GtkWidget *btt_exec_xor_edit, gpointer data);
void ui_toggle_model_exec (); void ui_toggle_model_exec (GtkWidget *btt_run_stop_model_exec, gpointer data);
void ui_model_exec_depends_on_edition (GtkWidget *btt_run_stop_model_exec, gpointer data);
void on_quit_action (GSimpleAction *action, GVariant *parameter, gpointer user_data); void on_quit_action (GSimpleAction *action, GVariant *parameter, gpointer user_data);
void on_about_action (GSimpleAction *action, GVariant *parameter, gpointer user_data); void on_about_action (GSimpleAction *action, GVariant *parameter, gpointer user_data);

View File

@ -287,6 +287,7 @@ void window_header_bar (GtkWindow *window, char *title){
gtk_button_set_icon_name (exec_xor_edit, "text-editor-symbolic"); gtk_button_set_icon_name (exec_xor_edit, "text-editor-symbolic");
gtk_button_set_icon_name (exec_xor_edit, "system-run-symbolic"); gtk_button_set_icon_name (exec_xor_edit, "system-run-symbolic");
g_signal_connect (exec_xor_edit, "clicked", G_CALLBACK (ui_toggle_exec_edit), NULL); g_signal_connect (exec_xor_edit, "clicked", G_CALLBACK (ui_toggle_exec_edit), NULL);
g_signal_connect (exec_xor_edit, "clicked", G_CALLBACK (ui_model_exec_depends_on_edition), NULL);
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (exec_xor_edit)); gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (exec_xor_edit));
gtk_window_set_titlebar (window, header_bar); gtk_window_set_titlebar (window, header_bar);

View File

@ -111,8 +111,8 @@ GtkBox *get_RUN_STOP_box(){
GtkBox *get_ZOOM_box(){ GtkBox *get_ZOOM_box(){
GtkBox *ZOOM_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0)); GtkBox *ZOOM_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0));
GtkWidget *ZOOM_Label = GTK_WIDGET (gtk_label_new (\ GtkWidget *ZOOM_Label = GTK_WIDGET (gtk_label_new (\
"\n TOOLS\n ---\n zoom\n ---\n (space\n struct.)\n\ "\n TOOLS\n ---\n zoom\n ---\n space\n struct.\n\
---\n (arrows\n struct.)\n")); ---\n arrows\n struct.\n ---\n orient\n state\n in space\n"));
gtk_widget_set_size_request (GTK_WIDGET (ZOOM_box), 10, 80); gtk_widget_set_size_request (GTK_WIDGET (ZOOM_box), 10, 80);
gtk_box_append (ZOOM_box, ZOOM_Label); gtk_box_append (ZOOM_box, ZOOM_Label);
return ZOOM_box; return ZOOM_box;