[glom/maemo5] Maemo: Related Records / AddDel: Use icon-only Hildon buttons.



commit eb085d91920590a205db06b67bc73bad68bf644d
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Oct 5 17:36:01 2009 +0200

    Maemo: Related Records / AddDel: Use icon-only Hildon buttons.
    
    * glom/utility_widgets/db_adddel/db_adddel_withbuttons.[h|cc]: Use Hildon
    Buttons, with only icons.

 ChangeLog                                          |    7 ++++++
 .../db_adddel/db_adddel_withbuttons.cc             |   22 ++++++++++++++++++++
 .../db_adddel/db_adddel_withbuttons.h              |   17 ++++++++++++--
 3 files changed, 43 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 199c5f4..f7a3c30 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2009-10-05  Murray Cumming  <murrayc murrayc com>
 
+	Maemo: Related Records / AddDel: Use icon-only Hildon buttons.
+	
+	* glom/utility_widgets/db_adddel/db_adddel_withbuttons.[h|cc]: Use Hildon 
+	Buttons, with only icons.
+
+2009-10-05  Murray Cumming  <murrayc murrayc com>
+
 	Maemo: Hide group titles by default.
 	
 	* glom/libglom/data_structure/translatable_item.[h|cc]:
diff --git a/glom/utility_widgets/db_adddel/db_adddel_withbuttons.cc b/glom/utility_widgets/db_adddel/db_adddel_withbuttons.cc
index 32ce893..627a186 100644
--- a/glom/utility_widgets/db_adddel/db_adddel_withbuttons.cc
+++ b/glom/utility_widgets/db_adddel/db_adddel_withbuttons.cc
@@ -26,9 +26,15 @@ namespace Glom
 
 DbAddDel_WithButtons::DbAddDel_WithButtons()
 : m_HBox(false, Utils::DEFAULT_SPACING_SMALL),
+#ifndef GLOM_ENABLE_MAEMO
   m_Button_Add(Gtk::Stock::ADD),
   m_Button_Del(Gtk::Stock::DELETE),
   m_Button_Edit(Gtk::Stock::OPEN)
+#else
+  m_Button_Add(Gtk::Hildon::SIZE_FINGER_HEIGHT, Hildon::BUTTON_ARRANGEMENT_HORIZONTAL),
+  m_Button_Del(Gtk::Hildon::SIZE_FINGER_HEIGHT, Hildon::BUTTON_ARRANGEMENT_HORIZONTAL),
+  m_Button_Edit(Gtk::Hildon::SIZE_FINGER_HEIGHT, Hildon::BUTTON_ARRANGEMENT_HORIZONTAL)
+#endif
 {
   m_HBox.set_spacing(Utils::DEFAULT_SPACING_SMALL);
 
@@ -44,6 +50,22 @@ DbAddDel_WithButtons::DbAddDel_WithButtons()
   m_HBox.pack_end(m_Button_Del, Gtk::PACK_SHRINK);
   m_HBox.pack_end(m_Button_Add, Gtk::PACK_SHRINK);
 
+#ifdef GLOM_ENABLE_MAEMO
+  //Use smaller icon-only buttons for these infrequently-clicked buttons,
+  //to save screen space.
+  
+  //Note that icons of size Gtk::ICON_SIZE_MENU are smaller, 
+  //but it seems impossible to have Hildon::Buttons smaller than Gtk::Hildon::SIZE_FINGER_HEIGHT.
+  Gtk::Image* image = Gtk::manage(new Gtk::Image(Gtk::Stock::ADD, Gtk::ICON_SIZE_SMALL_TOOLBAR));
+  m_Button_Add.set_image(*image);
+  
+  image = Gtk::manage(new Gtk::Image(Gtk::Stock::DELETE, Gtk::ICON_SIZE_SMALL_TOOLBAR));
+  m_Button_Del.set_image(*image);
+  
+  image = Gtk::manage(new Gtk::Image(Gtk::Stock::OPEN, Gtk::ICON_SIZE_SMALL_TOOLBAR));
+  m_Button_Edit.set_image(*image);
+#endif //GLOM_ENABLE_MAEMO
+
   setup_buttons();
 }
 
diff --git a/glom/utility_widgets/db_adddel/db_adddel_withbuttons.h b/glom/utility_widgets/db_adddel/db_adddel_withbuttons.h
index a462981..6d89260 100644
--- a/glom/utility_widgets/db_adddel/db_adddel_withbuttons.h
+++ b/glom/utility_widgets/db_adddel/db_adddel_withbuttons.h
@@ -23,6 +23,10 @@
 
 #include "db_adddel.h"
 
+#ifdef GLOM_ENABLE_MAEMO
+#include <hildonmm/button.h>
+#endif
+
 namespace Glom
 {
 
@@ -50,9 +54,16 @@ private:
 
   //member widgets:
   Gtk::HBox m_HBox;
-  Gtk::Button m_Button_Add;
-  Gtk::Button m_Button_Del;
-  Gtk::Button m_Button_Edit;
+  
+#ifndef GLOM_ENABLE_MAEMO
+  typedef Gtk::Button type_button; 
+#else
+  typedef Hildon::Button type_button; 
+#endif
+
+  type_button m_Button_Add;
+  type_button m_Button_Del;
+  type_button m_Button_Edit;
 };
 
 } //namespace Glom



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