r132 - in trunk/src/target/OM-2007: artwork/themes/openmoko-standard/gtk-2.0 examples/openmoko-paned-demo libraries/mokoui

mickey at gta01.hmw-consulting.de mickey at gta01.hmw-consulting.de
Fri Oct 27 16:49:20 CEST 2006


Author: mickey
Date: 2006-10-27 14:49:19 +0000 (Fri, 27 Oct 2006)
New Revision: 132

Modified:
   trunk/src/target/OM-2007/artwork/themes/openmoko-standard/gtk-2.0/mokotoolbox
   trunk/src/target/OM-2007/examples/openmoko-paned-demo/demo-main.c
   trunk/src/target/OM-2007/libraries/mokoui/moko-toolbox.c
   trunk/src/target/OM-2007/libraries/mokoui/moko-toolbox.h
Log:
mokoui: more work on mokotoolbox theming


Modified: trunk/src/target/OM-2007/artwork/themes/openmoko-standard/gtk-2.0/mokotoolbox
===================================================================
--- trunk/src/target/OM-2007/artwork/themes/openmoko-standard/gtk-2.0/mokotoolbox	2006-10-26 23:23:54 UTC (rev 131)
+++ trunk/src/target/OM-2007/artwork/themes/openmoko-standard/gtk-2.0/mokotoolbox	2006-10-27 14:49:19 UTC (rev 132)
@@ -45,3 +45,17 @@
 }
 widget "*.mokotoolbox-search-entry" style "mokotoolbox-search-entry"
 
+style "mokotoolbox-action-button" {
+    engine "pixmap" {
+        image {
+            function        = BOX
+            recolorable     = TRUE
+            file            = "openmoko-mokotoolbox-action-button-background.png"
+            border          = { 0, 0, 0, 0 }
+            stretch         = TRUE
+        }
+    }
+    MokoPixmapButton::size-request = { 0, 82, 0, 38 }
+}
+widget "*.mokotoolbox-action-button" style "mokotoolbox-action-button"
+

Modified: trunk/src/target/OM-2007/examples/openmoko-paned-demo/demo-main.c
===================================================================
--- trunk/src/target/OM-2007/examples/openmoko-paned-demo/demo-main.c	2006-10-26 23:23:54 UTC (rev 131)
+++ trunk/src/target/OM-2007/examples/openmoko-paned-demo/demo-main.c	2006-10-27 14:49:19 UTC (rev 132)
@@ -74,12 +74,16 @@
 
     /* tool bar */
     MokoToolBox* toolbox = MOKO_TOOL_BOX(moko_tool_box_new_with_search());
-    GtkToolbar* toolbar = moko_tool_box_get_tool_bar(toolbox);
     moko_paned_window_add_toolbox( window, toolbox );
 
+    moko_tool_box_add_action_button( toolbox );
+    moko_tool_box_add_action_button( toolbox );
+    moko_tool_box_add_action_button( toolbox );
+    moko_tool_box_add_action_button( toolbox );
+
 #if 0
     GtkToolButton* tool_action1 = GTK_TOOL_BUTTON(gtk_tool_button_new( NULL, "action1" ));
-    gtk_toolbar_insert( GTK_TOOLBAR(toolbar), tool_action1, 1 );
+    gtk_toolbar_insert( GTK_TOOLBAR(toolbar), tool_action1, -1 );
 
     GtkMenu* actionmenu = GTK_MENU(gtk_menu_new());
     GtkMenuItem* fooitem = GTK_MENU_ITEM(gtk_menu_item_new_with_label( "Foo" ));
@@ -91,13 +95,13 @@
 
     GtkMenuToolButton* tool_menu = GTK_MENU_TOOL_BUTTON(gtk_menu_tool_button_new( NULL, "amenu" ));
     gtk_menu_tool_button_set_menu( tool_menu, actionmenu );
-    gtk_toolbar_insert( GTK_TOOLBAR(toolbar), GTK_TOOL_BUTTON(tool_menu), 2 );
+    gtk_toolbar_insert( GTK_TOOLBAR(toolbar), GTK_TOOL_BUTTON(tool_menu), -1 );
 
     GtkToolButton* tool_action3 = GTK_TOOL_BUTTON(gtk_tool_button_new( NULL, "action3" ));
-    gtk_toolbar_insert( GTK_TOOLBAR(toolbar), tool_action3, 3 );
+    gtk_toolbar_insert( GTK_TOOLBAR(toolbar), tool_action3, -1 );
 
     GtkToolButton* tool_action4 = GTK_TOOL_BUTTON(gtk_tool_button_new( NULL, "action4" ));
-    gtk_toolbar_insert( GTK_TOOLBAR(toolbar), tool_action4, 4 );
+    gtk_toolbar_insert( GTK_TOOLBAR(toolbar), tool_action4, -1 );
 #endif
     /* details area */
     GtkButton* detailslist = gtk_button_new_with_label( "Hello Details Area!" );

Modified: trunk/src/target/OM-2007/libraries/mokoui/moko-toolbox.c
===================================================================
--- trunk/src/target/OM-2007/libraries/mokoui/moko-toolbox.c	2006-10-26 23:23:54 UTC (rev 131)
+++ trunk/src/target/OM-2007/libraries/mokoui/moko-toolbox.c	2006-10-27 14:49:19 UTC (rev 132)
@@ -21,7 +21,6 @@
 #include "moko-pixmap-button.h"
 
 #include <gtk/gtkentry.h>
-#include <gtk/gtktoolbar.h>
 #include <gtk/gtkvbox.h>
 
 #define MOKO_TOOL_BOX_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), MOKO_TYPE_TOOL_BOX, MokoToolBoxPriv));
@@ -29,7 +28,7 @@
 typedef struct _MokoToolBoxPriv
 {
     MokoPixmapContainer* toolbar_page;
-    GtkToolbar* toolbar;
+    GtkHBox* buttonbox;
     MokoPixmapContainer* searchbar_page;
     GtkEntry* entry;
 } MokoToolBoxPriv;
@@ -115,6 +114,9 @@
     MokoPixmapButton* search = moko_pixmap_button_new();
     gtk_widget_set_name( GTK_WIDGET(search), "mokotoolbox-search-button" );
     gtk_fixed_put( GTK_FIXED(priv->toolbar_page), search, 0, 0 );
+    priv->buttonbox = gtk_hbox_new( FALSE, 17 ); //FIXME need to get from style
+    gtk_fixed_put( GTK_FIXED(priv->toolbar_page), GTK_WIDGET(priv->buttonbox), 84, 7 ); //FIXME need to get from style
+    //gtk_widget_set_size_request( GTK_WIDGET(priv->buttonbox), 400, 52 ); //FIXME need to get from style
 
     gtk_notebook_append_page( GTK_NOTEBOOK(self), priv->toolbar_page, NULL );
 
@@ -126,15 +128,14 @@
 
     MokoPixmapButton* back = moko_pixmap_button_new();
     gtk_widget_set_name( GTK_WIDGET(back), "mokotoolbox-back-button" );
-#warning NEED TO GET FROM STYLE
-    gtk_fixed_put( GTK_FIXED(priv->searchbar_page), back, 400, 0 );
+    gtk_fixed_put( GTK_FIXED(priv->searchbar_page), back, 400, 0 ); //FIXME need to get from style
     g_signal_connect( G_OBJECT(back), "clicked", G_CALLBACK(button_release), self );
 
-    GtkEntry* entry = gtk_entry_new();
-    gtk_entry_set_has_frame( entry, FALSE );
-    gtk_entry_set_inner_border( entry, FALSE );
-    gtk_widget_set_name( GTK_WIDGET(entry), "mokotoolbox-search-entry" );
-    moko_pixmap_container_set_cargo( priv->searchbar_page, GTK_WIDGET(entry) );
+    priv->entry = gtk_entry_new();
+    gtk_entry_set_has_frame( priv->entry, FALSE );
+    gtk_entry_set_inner_border( priv->entry, FALSE );
+    gtk_widget_set_name( GTK_WIDGET(priv->entry), "mokotoolbox-search-entry" );
+    moko_pixmap_container_set_cargo( priv->searchbar_page, GTK_WIDGET(priv->entry) );
 
     return GTK_WIDGET(self);
 }
@@ -158,8 +159,19 @@
 #endif
 }
 
-GtkToolbar* moko_tool_box_get_tool_bar(MokoToolBox* self)
+GtkHBox* moko_tool_box_get_button_box(MokoToolBox* self)
 {
     MokoToolBoxPriv* priv = MOKO_TOOL_BOX_GET_PRIVATE(self);
-    return priv->toolbar;
+    return priv->buttonbox;
 }
+
+void moko_tool_box_add_action_button(MokoToolBox* self)
+{
+    g_debug( "moko_tool_box_add_action_button" );
+    MokoToolBoxPriv* priv = MOKO_TOOL_BOX_GET_PRIVATE(self);
+
+    MokoPixmapButton* button = moko_pixmap_button_new();
+    gtk_widget_set_name( GTK_WIDGET(button), "mokotoolbox-action-button" );
+
+    gtk_box_pack_start( GTK_BOX(priv->buttonbox), GTK_WIDGET(button), FALSE, FALSE, 0 );
+}
\ No newline at end of file

Modified: trunk/src/target/OM-2007/libraries/mokoui/moko-toolbox.h
===================================================================
--- trunk/src/target/OM-2007/libraries/mokoui/moko-toolbox.h	2006-10-26 23:23:54 UTC (rev 131)
+++ trunk/src/target/OM-2007/libraries/mokoui/moko-toolbox.h	2006-10-27 14:49:19 UTC (rev 132)
@@ -22,7 +22,7 @@
 #include <glib.h>
 #include <glib-object.h>
 #include <gtk/gtknotebook.h>
-#include <gtk/gtktoolbar.h>
+#include <gtk/gtkhbox.h>
 
 G_BEGIN_DECLS
 
@@ -54,7 +54,8 @@
 
 /* add additional methods here */
 void moko_tool_box_add_search_button(MokoToolBox* self );
-GtkToolbar*    moko_tool_box_get_tool_bar(MokoToolBox* self);
+GtkHBox* moko_tool_box_get_button_box( MokoToolBox* self );
+void moko_tool_box_add_action_button(MokoToolBox* self );
 
 G_END_DECLS
 





More information about the commitlog mailing list