[chronojump] menu / persons much clearer with radio at top



commit 8e52c0b8df62498c1e114fb6622f6dec2d7607ac
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Mar 26 01:41:18 2020 +0100

    menu / persons much clearer with radio at top

 glade/app1.glade           | 137 ++++++++++++++++++++++-----------------------
 src/gui/app1/chronojump.cs |  15 ++++-
 src/gui/app1/icons.cs      |   5 +-
 src/gui/app1/menu.cs       |  35 ++++++------
 4 files changed, 100 insertions(+), 92 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 062c67e5..a849666b 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -1261,61 +1261,70 @@
                                             <property name="can_focus">False</property>
                                             <property name="spacing">4</property>
                                             <child>
-                                              <widget class="GtkAlignment" id="alignment29">
-                                                <property name="visible">True</property>
+                                              <widget class="GtkAlignment" id="alignment_menu_and_persons">
                                                 <property name="can_focus">False</property>
                                                 <property name="top_padding">3</property>
                                                 <property name="bottom_padding">4</property>
                                                 <property name="left_padding">3</property>
                                                 <property name="right_padding">2</property>
                                                 <child>
-                                                  <widget class="GtkButton" id="button_show_menu">
+                                                  <widget class="GtkHBox" id="hbox367">
                                                     <property name="visible">True</property>
-                                                    <property name="can_focus">True</property>
-                                                    <property name="receives_default">True</property>
-                                                    <signal name="clicked" 
handler="on_button_show_menu_clicked" swapped="no"/>
+                                                    <property name="can_focus">False</property>
+                                                    <property name="spacing">4</property>
                                                     <child>
-                                                      <widget class="GtkEventBox" 
id="eventbox_button_show_menu">
+                                                      <widget class="GtkRadioButton" id="radio_show_menu">
                                                         <property name="visible">True</property>
-                                                        <property name="can_focus">False</property>
+                                                        <property name="can_focus">True</property>
+                                                        <property name="receives_default">False</property>
+                                                        <property name="yalign">0</property>
+                                                        <property name="active">True</property>
+                                                        <property name="draw_indicator">False</property>
+                                                        <signal name="toggled" 
handler="on_radio_show_menu_toggled" swapped="no"/>
                                                         <child>
-                                                          <widget class="GtkHBox" id="hbox367">
+                                                          <widget class="GtkEventBox" 
id="eventbox_radio_show_menu">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="spacing">4</property>
                                                             <child>
-                                                            <widget class="GtkImage" 
id="image_button_show_menu">
+                                                            <widget class="GtkImage" 
id="image_radio_show_menu">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property 
name="stock">gtk-missing-image</property>
                                                             </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
-                                                            <property name="position">0</property>
-                                                            </packing>
                                                             </child>
-                                                            <child>
-                                                            <widget class="GtkLabel" 
id="label_button_show_menu">
+                                                          </widget>
+                                                        </child>
+                                                      </widget>
+                                                      <packing>
+                                                        <property name="expand">False</property>
+                                                        <property name="fill">True</property>
+                                                        <property name="position">0</property>
+                                                      </packing>
+                                                    </child>
+                                                    <child>
+                                                      <widget class="GtkRadioButton" id="radio_show_persons">
+                                                        <property name="visible">True</property>
+                                                        <property name="can_focus">True</property>
+                                                        <property name="receives_default">False</property>
+                                                        <property name="yalign">0</property>
+                                                        <property name="active">True</property>
+                                                        <property name="draw_indicator">False</property>
+                                                        <property name="group">radio_show_menu</property>
+                                                        <signal name="toggled" 
handler="on_radio_show_persons_toggled" swapped="no"/>
+                                                        <child>
+                                                          <widget class="GtkEventBox" 
id="eventbox_radio_show_persons">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="label" 
translatable="yes">Menu</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">1</property>
-                                                            </packing>
-                                                            </child>
                                                             <child>
-                                                            <widget class="GtkHBox" id="hbox368">
+                                                            <widget class="GtkHBox" id="hbox385">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
+                                                            <property name="spacing">4</property>
                                                             <child>
-                                                            <widget class="GtkArrow" 
id="arrow_menu_show_menu_up">
+                                                            <widget class="GtkImage" 
id="image_radio_show_persons">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="arrow_type">up</property>
+                                                            <property 
name="stock">gtk-missing-image</property>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -1324,9 +1333,10 @@
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkArrow" 
id="arrow_menu_show_menu_down">
+                                                            <widget class="GtkLabel" 
id="label_radio_show_persons">
+                                                            <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="arrow_type">down</property>
+                                                            <property name="label" 
translatable="yes">Persons</property>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -1335,15 +1345,16 @@
                                                             </packing>
                                                             </child>
                                                             </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
-                                                            <property name="position">2</property>
-                                                            </packing>
                                                             </child>
                                                           </widget>
                                                         </child>
                                                       </widget>
+                                                      <packing>
+                                                        <property name="expand">False</property>
+                                                        <property name="fill">True</property>
+                                                        <property name="pack_type">end</property>
+                                                        <property name="position">1</property>
+                                                      </packing>
                                                     </child>
                                                   </widget>
                                                 </child>
@@ -3353,6 +3364,7 @@
                                                             <property name="spacing">4</property>
                                                             <child>
                                                             <widget class="GtkButton" 
id="button_manage_persons">
+                                                            <property name="label" 
translatable="yes">Manage</property>
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="can_default">True</property>
@@ -3362,13 +3374,6 @@
                                                             <property name="relief">half</property>
                                                             <property name="xalign">0</property>
                                                             <signal name="clicked" 
handler="on_button_manage_persons_clicked" swapped="no"/>
-                                                            <child>
-                                                            <widget class="GtkImage" 
id="image_manage_persons">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property 
name="stock">gtk-missing-image</property>
-                                                            </widget>
-                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -3377,20 +3382,6 @@
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkLabel" id="label_persons">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="xalign">0</property>
-                                                            <property name="label" 
translatable="yes">Persons</property>
-                                                            <property name="use_markup">True</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">1</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
                                                             <widget class="GtkHBox" id="hbox91">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
@@ -3451,7 +3442,7 @@
                                                             <property name="expand">False</property>
                                                             <property name="fill">False</property>
                                                             <property name="pack_type">end</property>
-                                                            <property name="position">2</property>
+                                                            <property name="position">1</property>
                                                             </packing>
                                                             </child>
                                                             </widget>
@@ -25167,6 +25158,9 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -27481,6 +27475,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>
@@ -27517,18 +27523,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>
@@ -35025,6 +35019,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/chronojump.cs b/src/gui/app1/chronojump.cs
index 48825812..ff92c54f 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -2404,7 +2404,13 @@ public partial class ChronoJumpWindow
                        //show hidden widgets
                        sensitiveGuiNoSession();
                        sensitiveGuiYesSession();
-                       on_button_show_menu_clicked (new object (), new EventArgs ());  //hide menu
+
+                       if( ! configChronojump.PersonWinHide) {
+                               alignment_menu_and_persons.Visible = true;
+                               //on_radio_show_persons_clicked (new object (), new EventArgs ());
+                               radio_show_persons.Active = true;
+                       }
+
                        definedSession = true;
 
                        //for sure, jumpsExists is false, because we create a new session
@@ -2485,7 +2491,12 @@ public partial class ChronoJumpWindow
                //show hidden widgets
                sensitiveGuiNoSession();
                sensitiveGuiYesSession();
-               on_button_show_menu_clicked (new object (), new EventArgs ());  //hide menu
+
+               if( ! configChronojump.PersonWinHide) {
+                       alignment_menu_and_persons.Visible = true;
+                       //on_radio_show_persons_clicked (new object (), new EventArgs ());
+                       radio_show_persons.Active = true;
+               }
 
                definedSession = true;
                
diff --git a/src/gui/app1/icons.cs b/src/gui/app1/icons.cs
index dbeaf9af..a529133c 100644
--- a/src/gui/app1/icons.cs
+++ b/src/gui/app1/icons.cs
@@ -43,7 +43,6 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Image image_session_delete;
        [Widget] Gtk.Image image_session_preferences;
        [Widget] Gtk.Image image_mode_encoder_capture;
-       [Widget] Gtk.Image image_manage_persons;
        [Widget] Gtk.Image image_current_person_zoom;
        [Widget] Gtk.Image image_current_person_zoom_h;
        [Widget] Gtk.Image image_person;
@@ -271,7 +270,7 @@ public partial class ChronoJumpWindow
                image_menu_quit1.Pixbuf = pixbuf;
 
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_menu.png");
-               image_button_show_menu.Pixbuf = pixbuf;
+               image_radio_show_menu.Pixbuf = pixbuf;
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_modes.png");
                image_button_show_modes.Pixbuf = pixbuf;
                image_button_show_modes1.Pixbuf = pixbuf;
@@ -363,7 +362,7 @@ public partial class ChronoJumpWindow
                image_selector_start_back.Pixbuf = pixbuf;
 
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_person_pin.png");
-               image_manage_persons.Pixbuf = pixbuf;
+               image_radio_show_persons.Pixbuf = pixbuf;
 
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_person.png");
                image_person.Pixbuf = pixbuf;
diff --git a/src/gui/app1/menu.cs b/src/gui/app1/menu.cs
index 440ab96e..bef1dd19 100644
--- a/src/gui/app1/menu.cs
+++ b/src/gui/app1/menu.cs
@@ -27,15 +27,15 @@ using System.Collections.Generic; //List
 
 public partial class ChronoJumpWindow
 {
-       [Widget] Gtk.Arrow arrow_menu_show_menu_up;
-       [Widget] Gtk.Arrow arrow_menu_show_menu_down;
+       [Widget] Gtk.Alignment alignment_menu_and_persons;
        [Widget] Gtk.Arrow arrow_menu_show_session_up;
        [Widget] Gtk.Arrow arrow_menu_show_session_down;
        [Widget] Gtk.Arrow arrow_menu_show_encoder_up;
        [Widget] Gtk.Arrow arrow_menu_show_encoder_down;
        [Widget] Gtk.Arrow arrow_menu_show_help_up;
        [Widget] Gtk.Arrow arrow_menu_show_help_down;
-       [Widget] Gtk.Button button_show_menu;
+       [Widget] Gtk.RadioButton radio_show_menu;
+       [Widget] Gtk.RadioButton radio_show_persons;
        [Widget] Gtk.Button button_show_modes;
        [Widget] Gtk.HPaned hpaned_contacts_main;
        [Widget] Gtk.Alignment alignment_viewport_menu_top;
@@ -44,7 +44,8 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Viewport viewport_menu_top;
        [Widget] Gtk.Viewport viewport_menu;
        [Widget] Gtk.Viewport viewport_persons;
-       [Widget] Gtk.EventBox eventbox_button_show_menu;
+       [Widget] Gtk.EventBox eventbox_radio_show_menu;
+       [Widget] Gtk.EventBox eventbox_radio_show_persons;
        [Widget] Gtk.EventBox eventbox_button_show_modes;
        [Widget] Gtk.EventBox eventbox_check_menu_session;
        [Widget] Gtk.EventBox eventbox_button_menu_preferences;
@@ -69,7 +70,8 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Button button_menu_help_about;
 
        //menu icons
-       [Widget] Gtk.Image image_button_show_menu;
+       [Widget] Gtk.Image image_radio_show_menu;
+       [Widget] Gtk.Image image_radio_show_persons;
        [Widget] Gtk.Image image_menu_folders;
        [Widget] Gtk.Image image_session_new3;
        [Widget] Gtk.Image image_session_load2;
@@ -158,7 +160,8 @@ public partial class ChronoJumpWindow
        private void menuSetTextAndIcons ()
        {
                //icons
-               image_button_show_menu.Visible = preferences.menuType != Preferences.MenuTypes.TEXT;
+               //image_radio_show_menu.Visible = preferences.menuType != Preferences.MenuTypes.TEXT;
+               //image_radio_show_persons.Visible = preferences.menuType != Preferences.MenuTypes.TEXT;
                image_menu_folders.Visible = preferences.menuType != Preferences.MenuTypes.TEXT;
                image_session_new3.Visible = preferences.menuType != Preferences.MenuTypes.TEXT;
                image_session_load2.Visible = preferences.menuType != Preferences.MenuTypes.TEXT;
@@ -188,7 +191,8 @@ public partial class ChronoJumpWindow
                //UtilGtk.ViewportColor(viewport_menu, UtilGtk.GRAY_LIGHT);
                //UtilGtk.ViewportColor(viewport_persons, UtilGtk.BLUE_CLEAR2);
 
-               UtilGtk.EventBoxColorBackgroundActive (eventbox_button_show_menu, UtilGtk.YELLOW);
+               UtilGtk.EventBoxColorBackgroundActive (eventbox_radio_show_menu, UtilGtk.YELLOW);
+               UtilGtk.EventBoxColorBackgroundActive (eventbox_radio_show_persons, UtilGtk.YELLOW);
                UtilGtk.EventBoxColorBackgroundActive (eventbox_button_show_modes, UtilGtk.YELLOW);
                UtilGtk.EventBoxColorBackgroundActive (eventbox_check_menu_session, UtilGtk.YELLOW);
                UtilGtk.EventBoxColorBackgroundActive (eventbox_button_menu_preferences, UtilGtk.YELLOW);
@@ -203,25 +207,22 @@ public partial class ChronoJumpWindow
                a_down.Visible = ! selected;
        }
 
-       private void on_button_show_menu_clicked (object o, EventArgs args)
+       private void on_radio_show_menu_toggled (object o, EventArgs args)
        {
-               if(! viewport_menu.Visible)
-               {
                        if(check_menu_session.Active)
                                check_menu_session.Active = false;
                        if(check_menu_help.Active)
                                check_menu_help.Active = false;
                        if(check_menu_encoder.Active)
                                check_menu_encoder.Active = false;
-               }
-
-               viewport_menu.Visible = ! viewport_menu.Visible;
-               menuShowVerticalArrow (viewport_menu.Visible, arrow_menu_show_menu_up, 
arrow_menu_show_menu_down);
 
-               if(viewport_menu.Visible)
+                       viewport_menu.Visible = true;
                        viewport_persons.Visible = false;
-               else
-                       viewport_persons.Visible = (currentSession != null);
+       }
+       private void on_radio_show_persons_toggled (object o, EventArgs args)
+       {
+               viewport_menu.Visible = false;
+               viewport_persons.Visible = (currentSession != null);
        }
 
        private void on_check_menu_session_clicked (object o, EventArgs args)


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