[chronojump] Sidebar session much nicer with an VButtonsBox



commit 126a6236e6cb7b157266f9ee9c8b8886df1adec0
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Jul 22 19:41:17 2021 +0200

    Sidebar session much nicer with an VButtonsBox

 glade/app1.glade     | 205 +++++++++++++++++++++++++++------------------------
 src/gui/app1/menu.cs |  13 +---
 src/gui/networks.cs  |   4 +-
 3 files changed, 114 insertions(+), 108 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 9c0f999d5..b78140459 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -448,7 +448,7 @@
                                   <widget class="GtkVBox" id="vbox61">
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
-                                    <property name="spacing">12</property>
+                                    <property name="spacing">10</property>
                                     <child>
                                       <widget class="GtkFrame" id="frame_session">
                                         <property name="visible">True</property>
@@ -469,39 +469,25 @@
                                                 <property name="visible">True</property>
                                                 <property name="can_focus">False</property>
                                                 <child>
-                                                  <widget class="GtkVBox" id="vbox_menu_session">
+                                                  <widget class="GtkTable" id="table_menu_session">
                                                     <property name="visible">True</property>
                                                     <property name="can_focus">False</property>
-                                                    <property name="spacing">4</property>
+                                                    <property name="n_rows">2</property>
+                                                    <property name="n_columns">2</property>
+                                                    <child>
+                                                      <placeholder/>
+                                                    </child>
                                                     <child>
-                                                      <widget class="GtkHBox" id="hbox331">
+                                                      <widget class="GtkCheckButton" id="check_menu_session">
                                                         <property name="visible">True</property>
-                                                        <property name="can_focus">False</property>
-                                                        <property name="spacing">2</property>
-                                                        <child>
-                                                          <widget class="GtkLabel" 
id="label_current_session">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="xalign">0</property>
-                                                            <property name="ellipsize">end</property>
-                                                            <property name="width_chars">15</property>
-                                                          </widget>
-                                                          <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
-                                                            <property name="position">0</property>
-                                                          </packing>
-                                                        </child>
+                                                        <property name="can_focus">True</property>
+                                                        <property name="receives_default">False</property>
+                                                        <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"/>
                                                         <child>
-                                                          <widget class="GtkCheckButton" 
id="check_menu_session">
-                                                            <property name="can_focus">True</property>
-                                                            <property 
name="receives_default">False</property>
-                                                            <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"/>
-                                                            <child>
-                                                            <widget class="GtkEventBox" 
id="eventbox_check_menu_session">
+                                                          <widget class="GtkEventBox" 
id="eventbox_check_menu_session">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <child>
@@ -516,8 +502,8 @@
                                                             <property 
name="stock">gtk-missing-image</property>
                                                             </widget>
                                                             <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
                                                             <property name="position">0</property>
                                                             </packing>
                                                             </child>
@@ -550,75 +536,42 @@
                                                             </child>
                                                             </widget>
                                                             <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">1</property>
-                                                            </packing>
-                                                            </child>
-                                                            </widget>
-                                                            </child>
-                                                            </widget>
-                                                            </child>
-                                                          </widget>
-                                                          <packing>
                                                             <property name="expand">False</property>
                                                             <property name="fill">False</property>
                                                             <property name="position">1</property>
-                                                          </packing>
-                                                        </child>
-                                                        <child>
-                                                          <widget class="GtkButton" 
id="button_menu_session_more">
-                                                            <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="relief">half</property>
-                                                            <signal name="clicked" 
handler="on_button_menu_session_more_clicked" swapped="no"/>
-                                                            <child>
-                                                            <widget class="GtkEventBox" 
id="eventbox_button_menu_session_more">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <child>
-                                                            <widget class="GtkImage" id="image_session_more">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property 
name="stock">gtk-missing-image</property>
-                                                            </widget>
+                                                            </packing>
                                                             </child>
                                                             </widget>
                                                             </child>
                                                           </widget>
-                                                          <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
-                                                            <property name="position">2</property>
-                                                          </packing>
                                                         </child>
                                                       </widget>
                                                       <packing>
-                                                        <property name="expand">True</property>
-                                                        <property name="fill">True</property>
-                                                        <property name="position">0</property>
+                                                        <property name="left_attach">1</property>
+                                                        <property name="right_attach">2</property>
+                                                        <property name="x_options"/>
+                                                        <property name="y_options"/>
                                                       </packing>
                                                     </child>
                                                     <child>
-                                                      <widget class="GtkAlignment" 
id="alignment_menu_session_options">
+                                                      <widget class="GtkLabel" id="label_current_session">
                                                         <property name="visible">True</property>
                                                         <property name="can_focus">False</property>
-                                                        <property name="top_padding">2</property>
+                                                        <property name="xalign">0</property>
+                                                        <property name="ellipsize">end</property>
+                                                        <property name="width_chars">18</property>
+                                                      </widget>
+                                                      <packing>
+                                                        <property name="x_options"/>
+                                                        <property name="y_options"/>
+                                                      </packing>
+                                                    </child>
+                                                    <child>
+                                                      <widget class="GtkVButtonBox" 
id="vbuttonbox_menu_session">
+                                                        <property name="can_focus">False</property>
+                                                        <property name="spacing">8</property>
                                                         <child>
-                                                          <widget class="GtkVBox" id="vbox_manage_sessions">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="spacing">8</property>
-                                                            <child>
-                                                            <widget class="GtkHBox" id="hbox297">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="spacing">8</property>
-                                                            <child>
-                                                            <widget class="GtkButton" 
id="button_menu_session_new">
+                                                          <widget class="GtkButton" 
id="button_menu_session_new">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="can_default">True</property>
@@ -632,7 +585,7 @@
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <child>
-                                                            <widget class="GtkHBox" id="hbox370">
+                                                            <widget class="GtkHBox" id="hbox372">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">4</property>
@@ -664,15 +617,15 @@
                                                             </child>
                                                             </widget>
                                                             </child>
-                                                            </widget>
-                                                            <packing>
+                                                          </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_menu_session_load">
+                                                          </packing>
+                                                        </child>
+                                                        <child>
+                                                          <widget class="GtkButton" 
id="button_menu_session_load">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="can_default">True</property>
@@ -686,7 +639,7 @@
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <child>
-                                                            <widget class="GtkHBox" id="hbox372">
+                                                            <widget class="GtkHBox" id="hbox534">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">4</property>
@@ -718,27 +671,71 @@
                                                             </child>
                                                             </widget>
                                                             </child>
+                                                          </widget>
+                                                          <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">1</property>
+                                                          </packing>
+                                                        </child>
+                                                        <child>
+                                                          <widget class="GtkButton" 
id="button_menu_session_more">
+                                                            <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="relief">half</property>
+                                                            <signal name="clicked" 
handler="on_button_menu_session_more_clicked" swapped="no"/>
+                                                            <child>
+                                                            <widget class="GtkEventBox" 
id="eventbox_button_menu_session_more">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox539">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">4</property>
+                                                            <child>
+                                                            <widget class="GtkImage" id="image_session_more">
+                                                            <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">1</property>
+                                                            <property name="position">0</property>
                                                             </packing>
                                                             </child>
+                                                            <child>
+                                                            <widget class="GtkLabel" id="label22">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label" 
translatable="yes">More</property>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">True</property>
                                                             <property name="fill">True</property>
-                                                            <property name="position">0</property>
+                                                            <property name="position">1</property>
                                                             </packing>
                                                             </child>
+                                                            </widget>
+                                                            </child>
+                                                            </widget>
+                                                            </child>
                                                           </widget>
+                                                          <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">2</property>
+                                                          </packing>
                                                         </child>
                                                       </widget>
                                                       <packing>
-                                                        <property name="expand">False</property>
-                                                        <property name="fill">True</property>
-                                                        <property name="position">1</property>
+                                                        <property name="top_attach">1</property>
+                                                        <property name="bottom_attach">2</property>
+                                                        <property name="x_options"/>
                                                       </packing>
                                                     </child>
                                                   </widget>
@@ -841,7 +838,7 @@
                                                           <widget class="GtkHBox" id="hbox373">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="spacing">12</property>
+                                                            <property name="spacing">20</property>
                                                             <child>
                                                             <widget class="GtkCheckButton" 
id="check_manage_persons">
                                                             <property name="visible">True</property>
@@ -25771,6 +25768,12 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -41352,6 +41355,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/src/gui/app1/menu.cs b/src/gui/app1/menu.cs
index 0c6f9057d..641eacab1 100644
--- a/src/gui/app1/menu.cs
+++ b/src/gui/app1/menu.cs
@@ -62,8 +62,7 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.CheckButton check_menu_session;
        [Widget] Gtk.Button button_menu_help;
        [Widget] Gtk.Button button_menu_news;
-       [Widget] Gtk.VBox vbox_menu_session;
-       [Widget] Gtk.Alignment alignment_menu_session_options;
+       [Widget] Gtk.VButtonBox vbuttonbox_menu_session;
        [Widget] Gtk.Alignment alignment_menu_person_options;
        [Widget] Gtk.Label label_session_at_frame_session;
        [Widget] Gtk.Label label_persons_at_frame_persons;
@@ -275,14 +274,10 @@ public partial class ChronoJumpWindow
        private void on_check_menu_session_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)
-               {
-                       alignment_menu_session_options.Visible = true;
-                       alignment_menu_session_options.Show();
-               } else
-                       alignment_menu_session_options.Visible = false;
-*/
+                       vbuttonbox_menu_session.Visible = true;
+               else
+                       vbuttonbox_menu_session.Visible = false;
        }
 
        private void on_button_menu_help_clicked (object o, EventArgs args)
diff --git a/src/gui/networks.cs b/src/gui/networks.cs
index a4aadfa7c..335759f5c 100644
--- a/src/gui/networks.cs
+++ b/src/gui/networks.cs
@@ -452,7 +452,9 @@ public partial class ChronoJumpWindow
                        //hbox_menu_and_preferences_outside_menu_encoder.Visible = true;
 
                        //hide session controls on UNIQUE and MONTHLY
-                       vbox_menu_session.Visible = false;
+                       vbuttonbox_menu_session.Visible = false;
+                       check_menu_session.Visible = false;
+
                        vbox_menu_session1.Visible = false;
 
 


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