[glom] Main window: Moved the Records/Found widgets to the top-right.



commit a68539d72da76dee7de966a5b2f630fa6c36e6ab
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Jun 23 13:49:54 2011 +0200

    Main window: Moved the Records/Found widgets to the top-right.
    
    * ui/operator/window_main.glade: Remove the footer row of widgets.
    * glom/frame_glom.[h|cc]: Instead build them manually and add them (in a box)
    to the notebook at the right-hand side next to the tabs.

 ChangeLog                     |   10 +++-
 glom/frame_glom.cc            |   40 ++++++--------
 glom/frame_glom.h             |    9 ++--
 ui/operator/window_main.glade |  116 +----------------------------------------
 4 files changed, 31 insertions(+), 144 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 87a0f40..80ed572 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,12 @@
-2011-06-23  Murray Cumming  <murrayc murrayc-desktop>
+2011-06-23  Murray Cumming  <murrayc murrayc com>
+
+	Main window: Moved the Records/Found widgets to the top-right.
+	
+	* ui/operator/window_main.glade: Remove the footer row of widgets.
+	* glom/frame_glom.[h|cc]: Instead build them manually and add them (in a box) 
+	to the notebook at the right-hand side next to the tabs.
+
+2011-06-23  Murray Cumming  <murrayc murrayc com>
 
 	Split the operator .glade files up into one file per top-level ID.
 
diff --git a/glom/frame_glom.cc b/glom/frame_glom.cc
index c46142e..f2620c6 100644
--- a/glom/frame_glom.cc
+++ b/glom/frame_glom.cc
@@ -80,11 +80,8 @@ Frame_Glom::Frame_Glom(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>
 : PlaceHolder(cobject, builder),
   m_pLabel_Table_DataMode(0),
   m_pLabel_Table_FindMode(0),
-  m_box_footer(0),
-  m_pBox_RecordsCount(0),
-  m_pLabel_RecordsCount(0),
-  m_pLabel_FoundCount(0),
-  m_pButton_FindAll(0),
+  m_Box_RecordsCount(false, Utils::DEFAULT_SPACING_SMALL),
+  m_Button_FindAll(_("Find All")),
   m_pBox_Mode(0),
 #ifndef GLOM_ENABLE_MAEMO
   m_pBox_Tables(0),
@@ -110,13 +107,9 @@ Frame_Glom::Frame_Glom(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>
   m_dialog_progess_connection_cleanup(0),
   m_pDialogConnection(0)
 {
-  //Load widgets from glade file:
-  builder->get_widget("hbox_footer", m_box_footer);
-
   //Hide unnecessary widgets on maemo that take too much space,
   //and reduce the border width:
   #ifdef GLOM_ENABLE_MAEMO
-  m_box_footer->hide();
   set_border_width(Glom::Utils::DEFAULT_SPACING_LARGE);
   #endif
 
@@ -164,12 +157,17 @@ Frame_Glom::Frame_Glom(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>
   placeholder_quickfind->add(*m_pBox_QuickFind);
   #endif //GLOM_ENABLE_MAEMO
 
-
-  builder->get_widget("hbox_records_count", m_pBox_RecordsCount);
-  builder->get_widget("label_records_count", m_pLabel_RecordsCount);
-  builder->get_widget("label_records_found_count", m_pLabel_FoundCount);
-  builder->get_widget("button_find_all", m_pButton_FindAll);
-  m_pButton_FindAll->signal_clicked().connect(
+  //Add the Records/Found widgets at the right of the notebook tabs:
+  m_Box_RecordsCount.pack_start(
+    *Gtk::manage(new Gtk::Label(_("Records:"))), Gtk::PACK_SHRINK);
+  m_Box_RecordsCount.pack_start(m_Label_RecordsCount, Gtk::PACK_SHRINK);
+  m_Box_RecordsCount.pack_start(
+    *Gtk::manage(new Gtk::Label(_("Found:"))), Gtk::PACK_SHRINK);
+  m_Box_RecordsCount.pack_start(m_Label_FoundCount, Gtk::PACK_SHRINK);
+  m_Box_RecordsCount.pack_start(m_Button_FindAll, Gtk::PACK_SHRINK);
+  m_Box_RecordsCount.show_all();
+  m_Notebook_Data.set_action_widget(&m_Box_RecordsCount, Gtk::PACK_END);
+  m_Button_FindAll.signal_clicked().connect(
     sigc::mem_fun(*this, &Frame_Glom::on_button_find_all) );
 
   builder->get_widget_derived("vbox_mode", m_pBox_Mode);
@@ -366,14 +364,10 @@ bool Frame_Glom::set_mode(enumModes mode)
       m_pEntry_QuickFind->grab_focus();
       //m_pButton_QuickFind->grab_default();
     }
-
-    m_pBox_RecordsCount->hide();
   }
   else
   {
     m_pBox_QuickFind->hide();
-
-    m_pBox_RecordsCount->show();
   }
 
   return changed;
@@ -2577,7 +2571,7 @@ void Frame_Glom::update_records_count()
     else
       str_count_found = str_count_all;
 
-    m_pButton_FindAll->hide();
+    m_Button_FindAll.hide();
   }
   else
   {
@@ -2585,11 +2579,11 @@ void Frame_Glom::update_records_count()
     the_stream << count_found;
     the_stream >> str_count_found;
 
-    m_pButton_FindAll->show();
+    m_Button_FindAll.show();
   }
 
-  m_pLabel_RecordsCount->set_text(str_count_all);
-  m_pLabel_FoundCount->set_text(str_count_found);
+  m_Label_RecordsCount.set_text(str_count_all);
+  m_Label_FoundCount.set_text(str_count_found);
 
 }
 
diff --git a/glom/frame_glom.h b/glom/frame_glom.h
index ffb5c2f..fe2e1ad 100644
--- a/glom/frame_glom.h
+++ b/glom/frame_glom.h
@@ -255,12 +255,11 @@ private:
   //Child widgets:
   Gtk::Label* m_pLabel_Table_DataMode;
   Gtk::Label* m_pLabel_Table_FindMode;
-  Gtk::HBox* m_box_footer;
 
-  Gtk::HBox* m_pBox_RecordsCount; //Only show this when in Data mode.
-  Gtk::Label* m_pLabel_RecordsCount;
-  Gtk::Label* m_pLabel_FoundCount;
-  Gtk::Button* m_pButton_FindAll;
+  Gtk::HBox m_Box_RecordsCount; //Only show this when in Data mode.
+  Gtk::Label m_Label_RecordsCount;
+  Gtk::Label m_Label_FoundCount;
+  Gtk::Button m_Button_FindAll;
 
   PlaceHolder* m_pBox_Mode; //Contains e.g. design mode notebook.
 
diff --git a/ui/operator/window_main.glade b/ui/operator/window_main.glade
index bb34935..381f3f7 100644
--- a/ui/operator/window_main.glade
+++ b/ui/operator/window_main.glade
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <requires lib="gtk+" version="2.16"/>
+  <!-- interface-naming-policy toplevel-contextual -->
   <object class="GtkWindow" id="window_main">
     <property name="can_focus">False</property>
     <property name="title" translatable="yes">Glom</property>
@@ -66,121 +67,6 @@
                 <property name="position">2</property>
               </packing>
             </child>
-            <child>
-              <object class="GtkHBox" id="hbox_footer">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="spacing">6</property>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <object class="GtkHBox" id="hbox_records_count">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="spacing">6</property>
-                    <child>
-                      <object class="GtkHBox" id="hbox_records">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="spacing">6</property>
-                        <child>
-                          <object class="GtkLabel" id="label205">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="label" translatable="yes">Records: </property>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkLabel" id="label_records_count">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="label" translatable="yes">0</property>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">1</property>
-                          </packing>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkHBox" id="hbox_found">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="spacing">6</property>
-                        <child>
-                          <object class="GtkLabel" id="label204">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="label" translatable="yes">Found:</property>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkLabel" id="label_records_found_count">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="label" translatable="yes">0</property>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">2</property>
-                          </packing>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkButton" id="button_find_all">
-                        <property name="label" translatable="yes">Find All</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_action_appearance">False</property>
-                        <property name="use_underline">True</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">2</property>
-                      </packing>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="pack_type">end</property>
-                    <property name="position">2</property>
-                  </packing>
-                </child>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">3</property>
-              </packing>
-            </child>
           </object>
           <packing>
             <property name="expand">True</property>



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