[chronojump] Person add/load buttons use a selector frame



commit b9f7a60a634d3abaa823ff7b92ec372a2da9985a
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Feb 20 22:43:03 2017 +0100

    Person add/load buttons use a selector frame

 glade/app1.glade                         |  337 +++++++++++++++++++++++++-----
 images/md/ic_face_blue_24dp_1x.png       |  Bin 0 -> 634 bytes
 images/md/ic_person_pin_blue_24dp_1x.png |  Bin 0 -> 422 bytes
 src/Makefile.am                          |    2 +
 src/gui/chronojump.cs                    |   15 +-
 src/gui/chronojumpIcons.cs               |    4 +
 6 files changed, 304 insertions(+), 54 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index a8cdaed..d8aa254 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -1959,17 +1959,104 @@ Carles</property>
                                                 <property name="can_focus">False</property>
                                                 <property name="spacing">4</property>
                                                 <child>
-                                                  <widget class="GtkHBox" id="hbox_persons_top">
+                                                  <widget class="GtkVBox" id="vbox61">
                                                     <property name="visible">True</property>
                                                     <property name="can_focus">False</property>
-                                                    <property name="spacing">8</property>
                                                     <child>
-                                                      <widget class="GtkHBox" id="hbox77">
+                                                      <widget class="GtkFrame" id="frame_persons_top">
                                                         <property name="visible">True</property>
                                                         <property name="can_focus">False</property>
-                                                        <property name="spacing">2</property>
+                                                        <property name="label_xalign">0</property>
+                                                        <property name="label_yalign">1</property>
+                                                        <property name="shadow_type">in</property>
                                                         <child>
-                                                          <widget class="GtkButton" 
id="button_person_add_single">
+                                                          <widget class="GtkHBox" id="hbox167">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="border_width">2</property>
+                                                            <child>
+                                                            <widget class="GtkVBox" id="vbox62">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="border_width">2</property>
+                                                            <property name="spacing">4</property>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox_persons_top">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">6</property>
+                                                            <child>
+                                                            <widget class="GtkButton" 
id="button_manage_persons">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="can_default">True</property>
+                                                            <property name="receives_default">True</property>
+                                                            <property name="has_tooltip">True</property>
+                                                            <property name="tooltip" 
translatable="yes">Manage persons</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>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkLabel" id="label197">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label" translatable="yes">Manage 
persons</property>
+                                                            <property name="use_markup">True</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkVBox" id="vbox_manage_persons">
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">7</property>
+                                                            <child>
+                                                            <widget class="GtkVBox" id="vbox83">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">2</property>
+                                                            <child>
+                                                            <widget class="GtkLabel" id="label153">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label" translatable="yes">Create 
new</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkHButtonBox" id="hbuttonbox10">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">2</property>
+                                                            <child>
+                                                            <widget class="GtkButton" 
id="button_person_add_single">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="can_default">True</property>
@@ -1978,21 +2065,44 @@ Carles</property>
                                                             <property name="tooltip" translatable="yes">New 
person</property>
                                                             <signal name="clicked" 
handler="on_person_add_single_from_main_gui" swapped="no"/>
                                                             <child>
+                                                            <widget class="GtkVBox" id="vbox91">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <child>
                                                             <widget class="GtkImage" 
id="image_persons_new_1">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property 
name="stock">gtk-missing-image</property>
                                                             </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
                                                             </child>
-                                                          </widget>
-                                                          <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
+                                                            <child>
+                                                            <widget class="GtkLabel" id="label141">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label" 
translatable="yes">One</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
                                                             <property name="position">0</property>
-                                                          </packing>
-                                                        </child>
-                                                        <child>
-                                                          <widget class="GtkButton" 
id="button_person_add_multiple">
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkButton" 
id="button_person_add_multiple">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="can_default">True</property>
@@ -2001,33 +2111,80 @@ Carles</property>
                                                             <property name="tooltip" translatable="yes">New 
persons (multiple)</property>
                                                             <signal name="clicked" 
handler="on_person_add_multiple_clicked" swapped="no"/>
                                                             <child>
+                                                            <widget class="GtkVBox" id="vbox92">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <child>
                                                             <widget class="GtkImage" 
id="image_persons_new_plus">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property 
name="stock">gtk-missing-image</property>
                                                             </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
                                                             </child>
-                                                          </widget>
-                                                          <packing>
+                                                            <child>
+                                                            <widget class="GtkLabel" id="label257">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label" 
translatable="yes">Multiple</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
                                                             <property name="expand">False</property>
                                                             <property name="fill">False</property>
-                                                            <property name="position">1</property>
-                                                          </packing>
-                                                        </child>
-                                                      </widget>
-                                                      <packing>
-                                                        <property name="expand">False</property>
-                                                        <property name="fill">False</property>
-                                                        <property name="position">0</property>
-                                                      </packing>
-                                                    </child>
-                                                    <child>
-                                                      <widget class="GtkHBox" id="hbox78">
-                                                        <property name="visible">True</property>
-                                                        <property name="can_focus">False</property>
-                                                        <property name="spacing">2</property>
-                                                        <child>
-                                                          <widget class="GtkButton" 
id="button_recuperate_person">
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkVBox" id="vbox87">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">2</property>
+                                                            <child>
+                                                            <widget class="GtkLabel" id="label156">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label" 
translatable="yes">Load</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkHButtonBox" id="hbuttonbox11">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">2</property>
+                                                            <child>
+                                                            <widget class="GtkButton" 
id="button_recuperate_person">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="can_default">True</property>
@@ -2036,21 +2193,44 @@ Carles</property>
                                                             <property name="tooltip" translatable="yes">Load 
person</property>
                                                             <signal name="clicked" 
handler="on_recuperate_person_clicked" swapped="no"/>
                                                             <child>
+                                                            <widget class="GtkVBox" id="vbox98">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <child>
                                                             <widget class="GtkImage" 
id="image_persons_open_1">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="stock">gtk-open</property>
                                                             </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
                                                             </child>
-                                                          </widget>
-                                                          <packing>
+                                                            <child>
+                                                            <widget class="GtkLabel" id="label258">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label" 
translatable="yes">One</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
                                                             <property name="expand">False</property>
                                                             <property name="fill">False</property>
                                                             <property name="position">0</property>
-                                                          </packing>
-                                                        </child>
-                                                        <child>
-                                                          <widget class="GtkButton" 
id="button_recuperate_persons_from_session">
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkButton" 
id="button_recuperate_persons_from_session">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="can_default">True</property>
@@ -2059,31 +2239,89 @@ Carles</property>
                                                             <property name="tooltip" translatable="yes">Load 
persons from other session</property>
                                                             <signal name="clicked" 
handler="on_recuperate_persons_from_session_clicked" swapped="no"/>
                                                             <child>
+                                                            <widget class="GtkVBox" id="vbox99">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <child>
                                                             <widget class="GtkImage" 
id="image_persons_open_plus">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="stock">gtk-open</property>
                                                             </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
                                                             </child>
-                                                          </widget>
-                                                          <packing>
+                                                            <child>
+                                                            <widget class="GtkLabel" id="label259">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label" 
translatable="yes">Multiple</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
                                                             <property name="expand">False</property>
                                                             <property name="fill">False</property>
                                                             <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                          </widget>
+                                                        </child>
+                                                        <child>
+                                                          <placeholder/>
+                                                          <packing>
+                                                            <property name="type">label_item</property>
                                                           </packing>
                                                         </child>
                                                       </widget>
                                                       <packing>
                                                         <property name="expand">False</property>
                                                         <property name="fill">False</property>
-                                                        <property name="pack_type">end</property>
-                                                        <property name="position">1</property>
+                                                        <property name="position">-1</property>
                                                       </packing>
                                                     </child>
                                                   </widget>
                                                   <packing>
                                                     <property name="expand">False</property>
-                                                    <property name="fill">True</property>
+                                                    <property name="fill">False</property>
                                                     <property name="position">0</property>
                                                   </packing>
                                                 </child>
@@ -2466,12 +2704,7 @@ Carles</property>
                                           </widget>
                                         </child>
                                         <child>
-                                          <widget class="GtkLabel" id="label197">
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
-                                            <property name="label" 
translatable="yes">&lt;b&gt;Persons&lt;/b&gt;</property>
-                                            <property name="use_markup">True</property>
-                                          </widget>
+                                          <placeholder/>
                                           <packing>
                                             <property name="type">label_item</property>
                                           </packing>
@@ -19126,6 +19359,12 @@ then click this button.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
diff --git a/images/md/ic_face_blue_24dp_1x.png b/images/md/ic_face_blue_24dp_1x.png
new file mode 100644
index 0000000..b25c586
Binary files /dev/null and b/images/md/ic_face_blue_24dp_1x.png differ
diff --git a/images/md/ic_person_pin_blue_24dp_1x.png b/images/md/ic_person_pin_blue_24dp_1x.png
new file mode 100644
index 0000000..b80a344
Binary files /dev/null and b/images/md/ic_person_pin_blue_24dp_1x.png differ
diff --git a/src/Makefile.am b/src/Makefile.am
index c1e7d35..d65f8b6 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -366,6 +366,8 @@ RESOURCES = \
        ../images/md/ic_folder_open_blue_24dp_2x.png,folder_open_big.png \
        ../images/md/ic_folder_open_blue_24dp_1x.png,folder_open.png \
        ../images/md/ic_visibility_blue_24dp_1x.png,image_visibility.png \
+       ../images/md/ic_person_pin_blue_24dp_1x.png,image_person_pin.png \
+       ../images/md/ic_face_blue_24dp_1x.png,image_face.png \
        ../images/md/ic_person_add_blue_24dp_1x.png,image_person_add.png \
        ../images/md/ic_group_add_blue_24dp_1x.png,image_group_add.png \
        ../images/md/ic_person_outline_blue_24dp_1x.png,image_person_outline.png \
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 517408c..004013f 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -297,7 +297,7 @@ public partial class ChronoJumpWindow
 
        //widgets for enable or disable
        [Widget] Gtk.Frame frame_persons;
-       [Widget] Gtk.HBox hbox_persons_top;
+       [Widget] Gtk.Frame frame_persons_top;
        [Widget] Gtk.Frame frame_persons_rest;
        [Widget] Gtk.HBox hbox_persons_bottom;
        [Widget] Gtk.Button button_recuperate_person;
@@ -2407,7 +2407,12 @@ public partial class ChronoJumpWindow
                        sensitiveGuiYesPerson();
                }
        }
-       
+
+       [Widget] Gtk.VBox vbox_manage_persons;
+       private void on_button_manage_persons_clicked (object o, EventArgs args) {
+               vbox_manage_persons.Visible = ! vbox_manage_persons.Visible;
+       }
+
        bool person_add_single_called_from_person_select_window;
        private void on_person_add_single_from_main_gui (object o, EventArgs args) {
                person_add_single_called_from_person_select_window = false;
@@ -6438,7 +6443,7 @@ LogB.Debug("X");
 
                if(cont)
                {
-                       hbox_persons_top.Sensitive = false;
+                       frame_persons_top.Sensitive = false;
                        //treeview_persons is shown (person can be changed)
                        frame_persons_rest.Sensitive = false;
                        hbox_persons_bottom.Sensitive = false;
@@ -6488,8 +6493,8 @@ LogB.Debug("X");
 
                frame_persons.Sensitive = true;
                //check this is sensitive (because on cont was unsensitive)
-               if(! hbox_persons_top.Sensitive)
-                       hbox_persons_top.Sensitive = true;
+               if(! frame_persons_top.Sensitive)
+                       frame_persons_top.Sensitive = true;
                if(! frame_persons_rest.Sensitive)
                        frame_persons_rest.Sensitive = true;
                if(! hbox_persons_bottom.Sensitive)
diff --git a/src/gui/chronojumpIcons.cs b/src/gui/chronojumpIcons.cs
index 8f60b98..5dbe0f2 100644
--- a/src/gui/chronojumpIcons.cs
+++ b/src/gui/chronojumpIcons.cs
@@ -33,6 +33,7 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Image image_session_new;
        [Widget] Gtk.Image image_session_load;
        [Widget] Gtk.Image image_mode_encoder_capture;
+       [Widget] Gtk.Image image_manage_persons;
        [Widget] Gtk.Image image_person;
        [Widget] Gtk.Image image_edit_current_person;
        [Widget] Gtk.Image image_persons_up;
@@ -86,6 +87,9 @@ public partial class ChronoJumpWindow
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_capture.png");
                image_mode_encoder_capture.Pixbuf = pixbuf;
 
+               pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_person_pin.png");
+               image_manage_persons.Pixbuf = pixbuf;
+
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_person.png");
                image_person.Pixbuf = pixbuf;
 



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