[chronojump] sidebar menu session and persons cannot be unfolded at the same time



commit 84870540efd4ad667eb2282ff5e7def41f7bc2ca
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Jul 22 21:32:05 2021 +0200

    sidebar menu session and persons cannot be unfolded at the same time

 glade/app1.glade                  | 34 ++++++++++++++++++++--------------
 src/gui/app1/chronojumpPersons.cs | 14 --------------
 src/gui/app1/menu.cs              | 38 ++++++++++++++++++++++++++++++++------
 3 files changed, 52 insertions(+), 34 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 679f33241..1e20b5ab7 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -485,7 +485,7 @@
                                                         <property name="tooltip" 
translatable="yes">Session</property>
                                                         <property name="active">True</property>
                                                         <property name="draw_indicator">False</property>
-                                                        <signal name="clicked" 
handler="on_check_menu_session_clicked" swapped="no"/>
+                                                        <signal name="clicked" 
handler="on_check_menu_session_or_persons_clicked" swapped="no"/>
                                                         <child>
                                                           <widget class="GtkEventBox" 
id="eventbox_check_menu_session">
                                                             <property name="visible">True</property>
@@ -844,7 +844,7 @@
                                                             <property name="can_focus">True</property>
                                                             <property 
name="receives_default">False</property>
                                                             <property name="draw_indicator">False</property>
-                                                            <signal name="clicked" 
handler="on_check_manage_persons_clicked" swapped="no"/>
+                                                            <signal name="clicked" 
handler="on_check_menu_session_or_persons_clicked" swapped="no"/>
                                                             <child>
                                                             <widget class="GtkEventBox" 
id="eventbox_check_manage_persons">
                                                             <property name="visible">True</property>
@@ -25775,6 +25775,9 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -32086,6 +32089,18 @@ Concentric</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">6</property>
                                                             <child>
+                                                            <widget class="GtkLabel" 
id="label_video_encoder_tests_will_be_filmed">
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label" translatable="yes">Tests 
will be filmed</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="pack_type">end</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
                                                             <widget class="GtkHBox" 
id="hbox_video_encoder_capturing">
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">4</property>
@@ -32122,18 +32137,6 @@ Concentric</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkLabel" 
id="label_video_encoder_tests_will_be_filmed">
-                                                            <property name="can_focus">False</property>
-                                                            <property name="label" translatable="yes">Tests 
will be filmed</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
-                                                            <property name="pack_type">end</property>
-                                                            <property name="position">0</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
                                                             <widget class="GtkHBox" 
id="hbox_video_encoder_no_capturing">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
@@ -41362,6 +41365,9 @@ then click this button.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
diff --git a/src/gui/app1/chronojumpPersons.cs b/src/gui/app1/chronojumpPersons.cs
index 774f2982e..ff07a45d3 100644
--- a/src/gui/app1/chronojumpPersons.cs
+++ b/src/gui/app1/chronojumpPersons.cs
@@ -51,20 +51,6 @@ public partial class ChronoJumpWindow
                }
        }
 
-       private void on_check_manage_persons_clicked (object o, EventArgs args)
-       {
-               if(vbox_manage_persons.Visible)
-               {
-                       vbox_manage_persons.Visible = false;
-                       arrow_manage_persons_down.Visible = true;
-                       arrow_manage_persons_up.Visible = false;
-               } else {
-                       vbox_manage_persons.Visible = true;
-                       arrow_manage_persons_down.Visible = false;
-                       arrow_manage_persons_up.Visible = true;
-               }
-       }
-
        private void showPersonPhoto (bool showPhoto)
        {
                hbox_persons_bottom_photo.Visible = showPhoto;
diff --git a/src/gui/app1/menu.cs b/src/gui/app1/menu.cs
index 641eacab1..4e5245931 100644
--- a/src/gui/app1/menu.cs
+++ b/src/gui/app1/menu.cs
@@ -60,6 +60,7 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Label label_current_person;
 
        [Widget] Gtk.CheckButton check_menu_session;
+       [Widget] Gtk.CheckButton check_manage_persons;
        [Widget] Gtk.Button button_menu_help;
        [Widget] Gtk.Button button_menu_news;
        [Widget] Gtk.VButtonBox vbuttonbox_menu_session;
@@ -271,13 +272,38 @@ public partial class ChronoJumpWindow
                a_down.Visible = ! selected;
        }
 
-       private void on_check_menu_session_clicked (object o, EventArgs args)
+       private void on_check_menu_session_or_persons_clicked (object o, EventArgs args)
        {
-               menuShowVerticalArrow (check_menu_session.Active, arrow_menu_show_session_up, 
arrow_menu_show_session_down);
-               if(check_menu_session.Active)
-                       vbuttonbox_menu_session.Visible = true;
-               else
-                       vbuttonbox_menu_session.Visible = false;
+               /*
+                  if one checkbutton unfolds, the other should get folded.
+                  do not need to care for circular calls, because it sets the other as false
+                  */
+
+               if(o == (object) check_menu_session)
+               {
+                       menuShowVerticalArrow (check_menu_session.Active, arrow_menu_show_session_up, 
arrow_menu_show_session_down);
+                       if(check_menu_session.Active)
+                       {
+                               vbuttonbox_menu_session.Visible = true;
+
+                               if(check_manage_persons.Active)
+                                       check_manage_persons.Active = false; //changing the other checkbutton
+                       }
+                       else
+                               vbuttonbox_menu_session.Visible = false;
+               }
+               else if(o == (object) check_manage_persons)
+               {
+                       menuShowVerticalArrow (check_manage_persons.Active, arrow_manage_persons_up, 
arrow_manage_persons_down);
+                       if(check_manage_persons.Active)
+                       {
+                               vbox_manage_persons.Visible = true;
+
+                               if(check_menu_session.Active)
+                                       check_menu_session.Active = false; //changing the other checkbutton
+                       } else
+                               vbox_manage_persons.Visible = false;
+               }
        }
 
        private void on_button_menu_help_clicked (object o, EventArgs args)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]